public String[] getDeclaredPrefixes() { getDeclarations(); // Make sure, that the prefixes array is valid return prefixes; } }
public static String getNamespacePrefix(Element el, String ns) { if (DOM_LEVEL_3) { return getNamespacePrefixDomLevel3(el, ns); } return getNamespaceContext(el).getPrefix(ns); } private static String getNamespacePrefixDomLevel3(Element el, String ns) {
public void add(String prefix, String namespaceURI) { put(prefix, namespaceURI); }
private XmlSchema addNameSpaces(int i) { XmlSchema schema = (XmlSchema) schemaList.get(i); NamespaceMap map = (NamespaceMap) namespaceMap.clone(); NamespacePrefixList namespaceContext = schema.getNamespaceContext(); String prefixes[] = namespaceContext.getDeclaredPrefixes(); for (int j = 0; j < prefixes.length; j++) { String prefix = prefixes[j]; map.add(prefix, namespaceContext.getNamespaceURI(prefix)); } schema.setNamespaceContext(map); return schema; }
public SchemaCollection(XmlSchemaCollection col) { schemaCollection = col; if (schemaCollection.getNamespaceContext() == null) { // an empty prefix map avoids extra checks for null. schemaCollection.setNamespaceContext(new NamespaceMap()); } }
public static NodeNamespaceContext getNamespaceContext(Node pNode) { final Map declarations = new HashMap(); new PrefixCollector() { protected void declare(String pPrefix, String pNamespaceURI) { declarations.put(pPrefix, pNamespaceURI); } }.searchAllPrefixDeclarations(pNode); return new NodeNamespaceContext(declarations); }
public static String getNamespaceURI(Element el, String pfx) { if ("xml".equals(pfx)) { return "http://www.w3.org/XML/1998/namespace"; } else if ("xmlns".equals(pfx)) { return "http://www.w3.org/2000/xmlns/"; } if (DOM_LEVEL_3) { return getNamespaceURIDomLevel3(el, pfx); } return getNamespaceContext(el).getNamespaceURI(pfx); } private static String getNamespaceURIDomLevel3(Element el, String pfx) {
/** * Searches for namespace prefix declarations in the given node. * For any prefix declaration, it invokes {@link #declare(String, String)}. * This method works recursively: The parent nodes prefix * declarations are collected before the current nodes. */ public void searchAllPrefixDeclarations(Node pNode) { Node parent = pNode.getParentNode(); if (parent != null) { searchAllPrefixDeclarations(parent); } searchLocalPrefixDeclarations(pNode); } }
public String[] getDeclaredPrefixes() { Set keys = keySet(); return (String[]) keys.toArray(new String[keys.size()]); }
public String getNamespaceURI(String prefix) { Object o = get(prefix); return o == null ? null : o.toString(); }
private XmlSchema addNameSpaces(int i) { XmlSchema schema = (XmlSchema) schemaList.get(i); NamespaceMap map = (NamespaceMap) namespaceMap.clone(); NamespacePrefixList namespaceContext = schema.getNamespaceContext(); String prefixes[] = namespaceContext.getDeclaredPrefixes(); for (int j = 0; j < prefixes.length; j++) { String prefix = prefixes[j]; map.add(prefix, namespaceContext.getNamespaceURI(prefix)); } schema.setNamespaceContext(map); return schema; }
public SchemaCollection(XmlSchemaCollection col) { schemaCollection = col; if (schemaCollection.getNamespaceContext() == null) { // an empty prefix map avoids extra checks for null. schemaCollection.setNamespaceContext(new NamespaceMap()); } }
public void add(String prefix, String namespaceURI) { put(prefix, namespaceURI); }
public String[] getDeclaredPrefixes() { Set keys = keySet(); return (String[]) keys.toArray(new String[keys.size()]); }
public String getNamespaceURI(String prefix) { return get(prefix).toString(); }
public SchemaCollection(XmlSchemaCollection col) { schemaCollection = col; if (schemaCollection.getNamespaceContext() == null) { // an empty prefix map avoids extra checks for null. schemaCollection.setNamespaceContext(new NamespaceMap()); } }
public void add(String prefix, String namespaceURI) { put(prefix, namespaceURI); }
public String[] getDeclaredPrefixes() { Set keys = keySet(); return (String[]) keys.toArray(new String[keys.size()]); }
public SchemaCollection(XmlSchemaCollection col) { schemaCollection = col; if (schemaCollection.getNamespaceContext() == null) { // an empty prefix map avoids extra checks for null. schemaCollection.setNamespaceContext(new NamespaceMap()); } }
public SchemaCollection(XmlSchemaCollection col) { schemaCollection = col; if (schemaCollection.getNamespaceContext() == null) { // an empty prefix map avoids extra checks for null. schemaCollection.setNamespaceContext(new NamespaceMap()); } }