001    /*
002     * Copyright 1999,2004 The Apache Software Foundation.
003     * 
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     *      http://www.apache.org/licenses/LICENSE-2.0
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    
017    package org.apache.commons.feedparser;
018    
019    import org.jaxen.SimpleNamespaceContext;
020    import org.jdom.Namespace;
021    
022    /**
023     * A class to manage XML namespaces
024     *
025     * @author <a href="mailto:burton@apache.org">Kevin A. Burton (burtonator)</a>
026     * @version $Id: NS.java 373614 2006-01-30 22:31:21Z mvdb $
027     */
028    public class NS {
029    
030        public static final Namespace RDFS =
031            Namespace.getNamespace( "rdfs", "http://www.w3.org/2000/01/rdf-schema#" );
032    
033        public static final Namespace FOAF =
034            Namespace.getNamespace( "foaf", "http://xmlns.com/foaf/0.1/" );
035    
036        public static final Namespace KR =
037            Namespace.getNamespace( "kr", "http://ksa.peerfear.org/ksa-rdf#" );
038    
039        public static final Namespace CONTENT =
040            Namespace.getNamespace( "content", "http://purl.org/rss/1.0/modules/content/" );
041    
042        public static final Namespace QUOTE =
043            Namespace.getNamespace( "quote", "http://purl.org/rss/1.0/modules/quote/" );
044    
045        public static final Namespace RDF =
046            Namespace.getNamespace( "rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#" );
047    
048        public static final Namespace RSS =
049            Namespace.getNamespace( "rss", "http://purl.org/rss/1.0/" );
050    
051        public static final Namespace AGG =
052            Namespace.getNamespace( "agg", "http://purl.org/rss/modules/aggregation/" );
053    
054        public static final Namespace IM =
055            Namespace.getNamespace( "im", "http://purl.org/rss/1.0/item-images/" );
056    
057        public static final Namespace DC =
058            Namespace.getNamespace( "dc", "http://purl.org/dc/elements/1.1/" );
059    
060        public static final Namespace DCTERMS =
061            Namespace.getNamespace( "dcterms", "http://purl.org/dc/terms/" );
062    
063        public static final Namespace SUBSCRIPTION =
064            Namespace.getNamespace( "sub", "http://purl.org/rss/1.0/modules/subscription/" );
065    
066        public static final Namespace NC =
067            Namespace.getNamespace( "NC", "http://home.netscape.com/NC-rdf#" );
068    
069        public static final Namespace XHTML =
070            Namespace.getNamespace( "xhtml", "http://www.w3.org/1999/xhtml" );
071    
072        public static final Namespace ATOM =
073            Namespace.getNamespace( "atom", "http://purl.org/atom/ns#" );
074    
075        public static final Namespace WFW =
076            Namespace.getNamespace( "wfw", "http://wellformedweb.org/CommentAPI/" );
077        
078        /**
079         * mod_taxonomy
080         */
081        public static final Namespace TAXO =
082            Namespace.getNamespace( "taxo", "http://purl.org/rss/1.0/modules/taxonomy/" );
083    
084        public static SimpleNamespaceContext context = null;
085    
086        static {
087    
088            //create all namespace contexts and do it ONCE
089            context = new SimpleNamespaceContext();
090            context.addNamespace( ATOM.getPrefix(), ATOM.getURI() );
091            context.addNamespace( DC.getPrefix(), DC.getURI() );
092            context.addNamespace( FOAF.getPrefix(), FOAF.getURI() );
093            context.addNamespace( RDF.getPrefix(), RDF.getURI() );
094            context.addNamespace( RDFS.getPrefix(), RDFS.getURI() );
095            context.addNamespace( TAXO.getPrefix(), TAXO.getURI() );
096    
097        }
098        
099    }