Enumeration allPrefixes = getPrefixes(); while (allPrefixes.hasMoreElements()) { String prefix = (String) allPrefixes.nextElement();
public void scan( Element e) throws SAXException { setCurrentLocation( e ); receiver.setDocumentLocator(locator); receiver.startDocument(); NamespaceSupport nss = new NamespaceSupport(); buildNamespaceSupport( nss, e.getParentNode() ); for( Enumeration en = nss.getPrefixes(); en.hasMoreElements(); ) { String prefix = (String)en.nextElement(); receiver.startPrefixMapping( prefix, nss.getURI(prefix) ); } visit(e); for( Enumeration en = nss.getPrefixes(); en.hasMoreElements(); ) { String prefix = (String)en.nextElement(); receiver.endPrefixMapping( prefix ); } setCurrentLocation( e ); receiver.endDocument(); }
@SuppressWarnings("unchecked") private List<String> getPrefixes(NamespaceSupport ctx) { Enumeration<String> prefixes = ctx.getPrefixes(); List<String> l = new ArrayList<String>(); while (prefixes.hasMoreElements()) { l.add(prefixes.nextElement()); } return l; }
@Override Enumeration next(NamespaceSupport nsSupport) { return nsSupport.getPrefixes(); } };
@Override public Enumeration getPrefixes() { return new CompositeEnumeration(super.getPrefixes()) { @Override Enumeration next(NamespaceSupport nsSupport) { return nsSupport.getPrefixes(); } }; }
@Override Enumeration next(NamespaceSupport nsSupport) { return nsSupport.getPrefixes(uri); } };
@Override public Enumeration getPrefixes(final String uri) { return new CompositeEnumeration(super.getPrefixes(uri)) { @Override Enumeration next(NamespaceSupport nsSupport) { return nsSupport.getPrefixes(uri); } }; }
public Iterator getPrefixes(String namespaceURI) { final Enumeration e = namespaceSupport.getPrefixes(namespaceURI); return new Iterator() { public void remove() { throw new UnsupportedOperationException(); } public boolean hasNext() { return e.hasMoreElements(); } public Object next() { return e.nextElement(); } }; } }
String findGMLPrefix(Encoder encoder) { NamespaceSupport ns = encoder.getNamespaces(); Enumeration<String> p = ns.getPrefixes(); while (p.hasMoreElements()) { String prefix = p.nextElement(); String uri = ns.getURI(prefix); if (uri.startsWith(GML.NAMESPACE)) { return prefix; } } return "gml"; }
private static void addNamespaces(NamespaceSupport ns, JXPathContext context) { Enumeration<String> prefixes = ns.getPrefixes(); while (prefixes.hasMoreElements()) { String prefix = prefixes.nextElement(); String uri = ns.getURI(prefix); context.registerNamespace(prefix, uri); } }
public void scan( Element e) throws SAXException { setCurrentLocation( e ); receiver.setDocumentLocator(locator); receiver.startDocument(); NamespaceSupport nss = new NamespaceSupport(); buildNamespaceSupport( nss, e.getParentNode() ); for( Enumeration en = nss.getPrefixes(); en.hasMoreElements(); ) { String prefix = (String)en.nextElement(); receiver.startPrefixMapping( prefix, nss.getURI(prefix) ); } visit(e); for( Enumeration en = nss.getPrefixes(); en.hasMoreElements(); ) { String prefix = (String)en.nextElement(); receiver.endPrefixMapping( prefix ); } setCurrentLocation( e ); receiver.endDocument(); }
for (Enumeration e = namespaceContext.getPrefixes(); e.hasMoreElements(); ) { String prefix = (String) e.nextElement(); if (mappedPrefixes.contains(prefix)) {
/** * Deep clones a {@link NamespaceSupport} so that it can be used outside of this parse (as its * state changes during the parse, and we need to keep all namespace mapping present at this * point for later usage) * * @param namespaceSupport * @return */ public static NamespaceSupport copyNamespaceSupport(NamespaceSupport namespaceSupport) { NamespaceSupport copy = new NamespaceSupport(); Enumeration prefixes = namespaceSupport.getPrefixes(); while (prefixes.hasMoreElements()) { String prefix = (String) prefixes.nextElement(); String uri = namespaceSupport.getURI(prefix); copy.declarePrefix(prefix, uri); } // the above did not cover the default prefix String defaultUri = namespaceSupport.getURI(""); if (defaultUri != null) { copy.declarePrefix("", defaultUri); } return copy; } }
java.util.Enumeration e = ns.getPrefixes();
public org.geotools.xml.transform.Translator createTranslator(ContentHandler handler) { FeatureTranslator t = createTranslator( handler, collectionPrefix, collectionNamespace, featureTypeNamespaces, schemaLocation); java.util.Enumeration prefixes = nsLookup.getPrefixes(); // setGmlPrefixing(true); t.setNumDecimals(numDecimals); t.setPadWithZeros(padWithZeros); t.setForceDecimalEncoding(forceDecimalEncoding); t.setGmlPrefixing(prefixGml); t.setSrsName(srsName); t.setLockId(lockId); t.setFeatureBounding(featureBounding); t.setCollectionBounding(collectionBounding); while (prefixes.hasMoreElements()) { String prefix = prefixes.nextElement().toString(); String uri = nsLookup.getURI(prefix); t.getNamespaceSupport().declarePrefix(prefix, uri); } return t; }
for (Enumeration e = namespaces.getPrefixes(); e.hasMoreElements(); ) { String prefix = (String) e.nextElement(); String uri = namespaces.getURI(prefix);
@Override @SuppressWarnings({"unchecked"}) public Enumeration<String> getPrefixes(String uri){ return super.getPrefixes(uri); }
@Override @SuppressWarnings({"unchecked"}) public Enumeration<String> getPrefixes(String uri){ return super.getPrefixes(uri); }
@Override @SuppressWarnings({"unchecked"}) public Enumeration<String> getPrefixes(){ return super.getPrefixes(); }
private static void addNamespaces(NamespaceSupport ns, JXPathContext context) { Enumeration<String> prefixes = ns.getPrefixes(); while (prefixes.hasMoreElements()) { String prefix = prefixes.nextElement(); String uri = ns.getURI(prefix); context.registerNamespace(prefix, uri); } }