/** * Obtains the namespace URI currently associated to the given prefix. * If no namespace URI is associated, return null. */ public String getNamespaceURI( String prefix ) { String uri = (String)decls.get(prefix); if(uri!=null) return uri; return nss.getURI(prefix); }
/** * Obtains the namespace URI currently associated to the given prefix. * If no namespace URI is associated, return null. */ public String getNamespaceURI( String prefix ) { String uri = (String)decls.get(prefix); if(uri!=null) return uri; return nss.getURI(prefix); }
/** * Obtains the namespace URI currently associated to the given prefix. * If no namespace URI is associated, return null. */ public String getNamespaceURI( String prefix ) { String uri = (String)decls.get(prefix); if(uri!=null) return uri; return nss.getURI(prefix); }
/** * Obtains the namespace URI currently associated to the given prefix. * If no namespace URI is associated, return null. */ public String getNamespaceURI( String prefix ) { String uri = (String)decls.get(prefix); if(uri!=null) return uri; return nss.getURI(prefix); }
public Iterator getPrefixes( String namespaceUri ) { // not particularly efficient implementation. Set s = new HashSet(); String prefix = (String)reverseDecls.get(namespaceUri); if(prefix!=null) s.add(prefix); if( nss.getURI("").equals(namespaceUri) ) s.add(""); for( Enumeration e=nss.getPrefixes(namespaceUri); e.hasMoreElements(); ) s.add(e.nextElement()); return s.iterator(); }
public Iterator getPrefixes( String namespaceUri ) { // not particularly efficient implementation. Set s = new HashSet(); String prefix = (String)reverseDecls.get(namespaceUri); if(prefix!=null) s.add(prefix); if( nss.getURI("").equals(namespaceUri) ) s.add(""); for( Enumeration e=nss.getPrefixes(namespaceUri); e.hasMoreElements(); ) s.add(e.nextElement()); return s.iterator(); }
public Iterator getPrefixes( String namespaceUri ) { // not particularly efficient implementation. Set s = new HashSet(); String prefix = (String)reverseDecls.get(namespaceUri); if(prefix!=null) s.add(prefix); if( nss.getURI("").equals(namespaceUri) ) s.add(""); for( Enumeration e=nss.getPrefixes(namespaceUri); e.hasMoreElements(); ) s.add(e.nextElement()); return s.iterator(); }
public Iterator getPrefixes( String namespaceUri ) { // not particularly efficient implementation. Set s = new HashSet(); String prefix = (String)reverseDecls.get(namespaceUri); if(prefix!=null) s.add(prefix); if( nss.getURI("").equals(namespaceUri) ) s.add(""); for( Enumeration e=nss.getPrefixes(namespaceUri); e.hasMoreElements(); ) s.add(e.nextElement()); return s.iterator(); }
/** Iterates all newly declared namespace prefixes for this element. */ public void iterateDeclaredPrefixes( PrefixCallback callback ) throws SAXException { for( Enumeration e=nss.getDeclaredPrefixes(); e.hasMoreElements(); ) { String p = (String)e.nextElement(); String uri = nss.getURI(p); callback.onPrefixMapping( p, uri ); } }
/** Iterates all newly declared namespace prefixes for this element. */ public void iterateDeclaredPrefixes( PrefixCallback callback ) throws SAXException { for( Enumeration e=nss.getDeclaredPrefixes(); e.hasMoreElements(); ) { String p = (String)e.nextElement(); String uri = nss.getURI(p); callback.onPrefixMapping( p, uri ); } }
/** Iterates all newly declared namespace prefixes for this element. */ public void iterateDeclaredPrefixes( PrefixCallback callback ) throws SAXException { for( Enumeration e=nss.getDeclaredPrefixes(); e.hasMoreElements(); ) { String p = (String)e.nextElement(); String uri = nss.getURI(p); callback.onPrefixMapping( p, uri ); } }
/** Iterates all newly declared namespace prefixes for this element. */ public void iterateDeclaredPrefixes( PrefixCallback callback ) throws SAXException { for( Enumeration e=nss.getDeclaredPrefixes(); e.hasMoreElements(); ) { String p = (String)e.nextElement(); String uri = nss.getURI(p); callback.onPrefixMapping( p, uri ); } }
/** * Reconciles the namespace URI/prefix mapping requests since the * last startElement method invocation and finalizes them. * * This method must be called after all the necessary namespace URIs * for this element is reported through the declareNamespace method * or the getPrefix method. */ public void endNamespaceDecls() { if(!decls.isEmpty()) { // most of the times decls is empty, so take advantage of it. for( Iterator itr=decls.entrySet().iterator(); itr.hasNext(); ) { Map.Entry e = (Map.Entry)itr.next(); String prefix = (String)e.getKey(); String uri = (String)e.getValue(); if(!uri.equals(nss.getURI(prefix))) // avoid redundant decls. nss.declarePrefix( prefix, uri ); } decls.clear(); reverseDecls.clear(); } inCollectingMode = false; }
/** * Reconciles the namespace URI/prefix mapping requests since the * last startElement method invocation and finalizes them. * * This method must be called after all the necessary namespace URIs * for this element is reported through the declareNamespace method * or the getPrefix method. */ public void endNamespaceDecls() { if(!decls.isEmpty()) { // most of the times decls is empty, so take advantage of it. for( Iterator itr=decls.entrySet().iterator(); itr.hasNext(); ) { Map.Entry e = (Map.Entry)itr.next(); String prefix = (String)e.getKey(); String uri = (String)e.getValue(); if(!uri.equals(nss.getURI(prefix))) // avoid redundant decls. nss.declarePrefix( prefix, uri ); } decls.clear(); reverseDecls.clear(); } inCollectingMode = false; }
/** * Reconciles the namespace URI/prefix mapping requests since the * last startElement method invocation and finalizes them. * * This method must be called after all the necessary namespace URIs * for this element is reported through the declareNamespace method * or the getPrefix method. */ public void endNamespaceDecls() { if(!decls.isEmpty()) { // most of the times decls is empty, so take advantage of it. for( Iterator itr=decls.entrySet().iterator(); itr.hasNext(); ) { Map.Entry e = (Map.Entry)itr.next(); String prefix = (String)e.getKey(); String uri = (String)e.getValue(); if(!uri.equals(nss.getURI(prefix))) // avoid redundant decls. nss.declarePrefix( prefix, uri ); } decls.clear(); reverseDecls.clear(); } inCollectingMode = false; }
/** * Reconciles the namespace URI/prefix mapping requests since the * last startElement method invocation and finalizes them. * * This method must be called after all the necessary namespace URIs * for this element is reported through the declareNamespace method * or the getPrefix method. */ public void endNamespaceDecls() { if(!decls.isEmpty()) { // most of the times decls is empty, so take advantage of it. for( Iterator itr=decls.entrySet().iterator(); itr.hasNext(); ) { Map.Entry e = (Map.Entry)itr.next(); String prefix = (String)e.getKey(); String uri = (String)e.getValue(); if(!uri.equals(nss.getURI(prefix))) // avoid redundant decls. nss.declarePrefix( prefix, uri ); } decls.clear(); reverseDecls.clear(); } inCollectingMode = false; }
while (allPrefixes.hasMoreElements()) { String prefix = (String)allPrefixes.nextElement(); if (uri.equals(getURI(prefix))) { prefixes.addElement(prefix);
if( !requirePrefix && nss.getURI("").equals(namespaceUri) ) return ""; // can use the default prefix. use it whenever we can
if( !requirePrefix && nss.getURI("").equals(namespaceUri) ) return ""; // can use the default prefix. use it whenever we can
if( !requirePrefix && nss.getURI("").equals(namespaceUri) ) return ""; // can use the default prefix. use it whenever we can