/** * Records the namespace mapping and passes the call to the proxied * content handler. */ public void startPrefixMapping(String prefix, String uri) throws SAXException { namespaces.put(prefix, uri); super.startPrefixMapping(prefix, uri); }
/** * Adds the recorded namespace mappings (if any) as "xmlns" attributes * before passing the call on to the proxied content handler. */ public void startElement( String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { if (!namespaces.isEmpty()) { AttributesImpl attributes = new AttributesImpl(atts); Iterator iterator = namespaces.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); String prefix = (String) entry.getKey(); String uri = (String) entry.getValue(); if (prefix.length() == 0) { attributes.addAttribute( XMLNS_NAMESPACE, "xmlns", "xmlns", "CDATA", uri); } else { attributes.addAttribute( XMLNS_NAMESPACE, prefix, "xmlns:" + prefix, "CDATA", uri); } } atts = attributes; namespaces.clear(); } super.startElement(namespaceURI, localName, qName, atts); }
/** * Adds the recorded namespace mappings (if any) as "xmlns" attributes * before passing the call on to the proxied content handler. */ public void startElement( String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { if (!namespaces.isEmpty()) { AttributesImpl attributes = new AttributesImpl(atts); Iterator iterator = namespaces.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); String prefix = (String) entry.getKey(); String uri = (String) entry.getValue(); if (prefix.length() == 0) { attributes.addAttribute( XMLNS_NAMESPACE, "xmlns", "xmlns", "CDATA", uri); } else { attributes.addAttribute( XMLNS_NAMESPACE, prefix, "xmlns:" + prefix, "CDATA", uri); } } atts = attributes; namespaces.clear(); } super.startElement(namespaceURI, localName, qName, atts); }
/** * Records the namespace mapping and passes the call to the proxied * content handler. */ public void startPrefixMapping(String prefix, String uri) throws SAXException { namespaces.put(prefix, uri); super.startPrefixMapping(prefix, uri); }
/** * Adds the recorded namespace mappings (if any) as "xmlns" attributes * before passing the call on to the proxied content handler. */ public void startElement( String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { if (!namespaces.isEmpty()) { AttributesImpl attributes = new AttributesImpl(atts); Iterator iterator = namespaces.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = (Map.Entry) iterator.next(); String prefix = (String) entry.getKey(); String uri = (String) entry.getValue(); if (prefix.length() == 0) { attributes.addAttribute( XMLNS_NAMESPACE, "xmlns", "xmlns", "CDATA", uri); } else { attributes.addAttribute( XMLNS_NAMESPACE, prefix, "xmlns:" + prefix, "CDATA", uri); } } atts = attributes; namespaces.clear(); } super.startElement(namespaceURI, localName, qName, atts); }
/** * Records the namespace mapping and passes the call to the proxied * content handler. */ public void startPrefixMapping(String prefix, String uri) throws SAXException { namespaces.put(prefix, uri); super.startPrefixMapping(prefix, uri); }