public void pushContext() { fNamespaceContext.pushContext(); }
/** * Constructs a namespace context object and initializes it with * the prefixes declared in the specified context. */ public NamespaceSupport(NamespaceContext context) { pushContext(); // copy declaration in the context Enumeration prefixes = context.getAllPrefixes(); while (prefixes.hasMoreElements()){ String prefix = (String)prefixes.nextElement(); String uri = context.getURI(prefix); declarePrefix(prefix, uri); } } // <init>(NamespaceContext)
public void startPrefixMapping(String prefix, String uri) throws SAXException { if (fNeedPushNSContext) { fNeedPushNSContext = false; fNamespaceContext.pushContext(); } if (!fStringsInternalized) { prefix = (prefix != null) ? fSymbolTable.addSymbol(prefix) : XMLSymbols.EMPTY_STRING; uri = (uri != null && uri.length() > 0) ? fSymbolTable.addSymbol(uri) : null; } else { if (prefix == null) { prefix = XMLSymbols.EMPTY_STRING; } if (uri != null && uri.length() == 0) { uri = null; } } fNamespaceContext.declarePrefix(prefix, uri); }
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { if (fNeedPushNSContext) { fNamespaceContext.pushContext(); } fNeedPushNSContext = true; // Fill element QName and XMLAttributes fillQName(fElementQName, uri, localName, qName); fillXMLAttributes(atts); // Add namespace declarations if necessary if (!fNamespacePrefixes) { final int prefixCount = fNamespaceContext.getDeclaredPrefixCount(); if (prefixCount > 0) { addNamespaceDeclarations(prefixCount); } } try { fSchemaDOMParser.startElement(fElementQName, fAttributes, null); } catch (XMLParseException e) { convertToSAXParseException(e); } catch (XNIException e) { convertToSAXException(e); } }
fCurrentElement = node; fNamespaceContext.pushContext();