@Override public String getNamespaceURI(String prefix) { return this.startElement.getNamespaceURI(prefix); } }
@Override public String getNamespaceURI(String prefix) { return this.startElement.getNamespaceURI(prefix); } }
@Override public String getNamespaceURI(String prefix) { return delegate.getNamespaceURI(prefix); }
@Override public String getNamespaceURI(String prefix) { return delegate.getNamespaceURI(prefix); }
/** * Gets the URI used in the XML document for the given prefix used in JAXB annotations. * At marshalling time, events are created by JAXB using namespaces used in JAXB annotations. * {@link TransformingWriter} wraps those events for converting those namespaces to the ones used * in the XML document. * * <div class="note"><b>Example:</b> the {@code "cit"} prefix from ISO 19115-3:2016 standard * represents the {@code "http://standards.iso.org/iso/19115/-3/mdb/1.0"} namespace, which is * mapped to {@code "http://www.isotc211.org/2005/gmd"} in the legacy ISO 19139:2007 standard. * That later URI is returned.</div> */ @Override public String getNamespaceURI(final String prefix) { return version.exportNS(event.getNamespaceURI(prefix)); }
/** * Gets the URI used by JAXB annotations for the given prefix used in the XML document. * Returns {@code null} if no unique URI can be provided for the given prefix. * * <div class="note"><b>Example:</b> * the {@code "gmd"} prefix from legacy ISO 19139:2007 standard can map to the * {@code "http://standards.iso.org/iso/19115/-3/mdb/1.0"}, {@code "…/cit/1.0"} * and other namespaces in ISO 19115-3:2016. Because of this ambiguity, * this method returns {@code null}.</div> * * <p>At unmarshalling time, events are created by an arbitrary {@link javax.xml.stream.XMLEventReader} * with namespaces used in the XML document. {@link TransformingReader} wraps those events using this * class for converting the XML namespaces to the namespaces used by JAXB annotations.</p> * * <p>At marshalling time, events are created by JAXB using namespaces used in JAXB annotations. * {@link TransformingWriter} wraps those events for converting those namespaces to the ones used * in the XML document. This is the opposite than the work performed by this default implementation * and must be handled by a {@code Start} subclass.</p> */ @Override public String getNamespaceURI(final String prefix) { return version.importNS(event.getNamespaceURI(prefix)); }
if (!settings.contains(Setting.ManualNamespaces)) return value; if (element.getNamespaceURI("_") == null) return value; namespaceURI = "http://www.w3.org/1999/xhtml/vocab#"; } else { namespaceURI = element.getNamespaceURI(prefix); if (isForSAX) { if (namespaceURI != null) {
if (!settings.contains(Setting.ManualNamespaces)) return value; if (element.getNamespaceURI("_") == null) return value; namespaceURI = "http://www.w3.org/1999/xhtml/vocab#"; } else { namespaceURI = element.getNamespaceURI(prefix); if (isForSAX) { if (namespaceURI != null) {
event.getNamespaceURI(prefix));
event.getNamespaceURI(prefix));
@SuppressWarnings("unchecked") private void handleStartElement(StartElement event) throws XMLStreamException { try { for (Iterator<Namespace> i = event.getNamespaces(); i.hasNext(); ) { String prefix = i.next().getPrefix(); if (prefix == null) { // true for default namespace prefix = ""; } this.filter.startPrefixMapping(prefix, event.getNamespaceURI(prefix)); } QName qName = event.getName(); String prefix = qName.getPrefix(); String rawname; if (prefix == null || prefix.length() == 0) { rawname = qName.getLocalPart(); } else { rawname = prefix + ':' + qName.getLocalPart(); } Attributes saxAttrs = getAttributes(event); this.filter.startElement(qName.getNamespaceURI(), qName.getLocalPart(), rawname, saxAttrs); } catch (SAXException e) { throw new XMLStreamException(e); } }
else namespaceMap.put(n.getPrefix(), el.getNamespaceURI(n.getPrefix()));
@SuppressWarnings("unchecked") private void handleStartElement(StartElement event) throws XMLStreamException { try { // start namespace bindings for (Iterator i = event.getNamespaces(); i.hasNext();) { String prefix = ((Namespace) i.next()).getPrefix(); if (prefix == null) { // true for default namespace prefix = ""; } this.filter.startPrefixMapping(prefix, event.getNamespaceURI(prefix)); } // fire startElement QName qName = event.getName(); String prefix = qName.getPrefix(); String rawname; if (prefix == null || prefix.length() == 0) { rawname = qName.getLocalPart(); } else { rawname = prefix + ':' + qName.getLocalPart(); } Attributes saxAttrs = this.getAttributes(event); this.filter.startElement(qName.getNamespaceURI(), qName.getLocalPart(), rawname, saxAttrs); } catch (SAXException e) { throw new XMLStreamException(e); } }
private void handleStartElement(StartElement event) throws XMLStreamException { try { // start namespace bindings for (@SuppressWarnings("unchecked") Iterator<Namespace> i = event.getNamespaces(); i.hasNext();) { String prefix = i.next().getPrefix(); // true for default namespace if (prefix == null) { prefix = ""; } this.filter.startPrefixMapping(prefix, event.getNamespaceURI(prefix)); } // fire startElement QName qName = event.getName(); String prefix = qName.getPrefix(); String rawname; if (prefix == null || prefix.length() == 0) { rawname = qName.getLocalPart(); } else { rawname = prefix + ':' + qName.getLocalPart(); } Attributes saxAttrs = this.getAttributes(event); this.filter.startElement(qName.getNamespaceURI(), qName.getLocalPart(), rawname, saxAttrs); } catch (SAXException e) { throw new XMLStreamException(e); } }
event.getNamespaceURI(prefix));
final StartElement element = event.asStartElement(); if (STREAM_NAME.equals(element.getName()) && XMPPNamespaces.ACCEPT.equals(element.getNamespaceURI(null))) { if (!serverName.equals(element.getAttributeByName(new QName("from")).getValue())) { throw new Exception("server name mismatch");
this.addEventToQueue(eventFactory.createStartElement("", startElement.getNamespaceURI(""), startElement .getName().getLocalPart(), startElement.getAttributes(), null, startElement .getNamespaceContext()));