protected void handleStartElement() throws XMLStreamException { String nsUri = in.getNamespaceURI(); out.writeStartElement( fixNull(in.getPrefix()), in.getLocalName(), fixNull(nsUri) ); // start namespace bindings int nsCount = in.getNamespaceCount(); for (int i = 0; i < nsCount; i++) { out.writeNamespace( in.getNamespacePrefix(i), fixNull(in.getNamespaceURI(i))); // zephyr doesn't like null, I don't know what is correct, so just fix null to "" for now } // write attributes int attCount = in.getAttributeCount(); for (int i = 0; i < attCount; i++) { handleAttribute(i); } }
protected void handleStartElement() throws XMLStreamException { String nsUri = in.getNamespaceURI(); out.writeStartElement( fixNull(in.getPrefix()), in.getLocalName(), fixNull(nsUri) ); // start namespace bindings int nsCount = in.getNamespaceCount(); for (int i = 0; i < nsCount; i++) { out.writeNamespace( in.getNamespacePrefix(i), fixNull(in.getNamespaceURI(i))); // zephyr doesn't like null, I don't know what is correct, so just fix null to "" for now } // write attributes int attCount = in.getAttributeCount(); for (int i = 0; i < attCount; i++) { handleAttribute(i); } }
protected void handleStartElement() throws XMLStreamException { String nsUri = in.getNamespaceURI(); out.writeStartElement( fixNull(in.getPrefix()), in.getLocalName(), fixNull(nsUri) ); // start namespace bindings int nsCount = in.getNamespaceCount(); for (int i = 0; i < nsCount; i++) { out.writeNamespace( in.getNamespacePrefix(i), fixNull(in.getNamespaceURI(i))); // zephyr doesn't like null, I don't know what is correct, so just fix null to "" for now } // write attributes int attCount = in.getAttributeCount(); for (int i = 0; i < attCount; i++) { handleAttribute(i); } }
/** * Writes out the {@code i}-th attribute of the current element. * * <p> * Used from {@link #handleStartElement()}. */ protected void handleAttribute(int i) throws XMLStreamException { String nsUri = in.getAttributeNamespace(i); String prefix = in.getAttributePrefix(i); if (fixNull(nsUri).equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) { //Its a namespace decl, ignore as it is already written. return; } if(nsUri==null || prefix == null || prefix.equals("")) { out.writeAttribute( in.getAttributeLocalName(i), in.getAttributeValue(i) ); } else { out.writeAttribute( prefix, nsUri, in.getAttributeLocalName(i), in.getAttributeValue(i) ); } }
/** * Writes out the {@code i}-th attribute of the current element. * * <p> * Used from {@link #handleStartElement()}. */ protected void handleAttribute(int i) throws XMLStreamException { String nsUri = in.getAttributeNamespace(i); String prefix = in.getAttributePrefix(i); if (fixNull(nsUri).equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) { //Its a namespace decl, ignore as it is already written. return; } if(nsUri==null || prefix == null || prefix.equals("")) { out.writeAttribute( in.getAttributeLocalName(i), in.getAttributeValue(i) ); } else { out.writeAttribute( prefix, nsUri, in.getAttributeLocalName(i), in.getAttributeValue(i) ); } }
/** * Writes out the {@code i}-th attribute of the current element. * * <p> * Used from {@link #handleStartElement()}. */ protected void handleAttribute(int i) throws XMLStreamException { String nsUri = in.getAttributeNamespace(i); String prefix = in.getAttributePrefix(i); if (fixNull(nsUri).equals(XMLConstants.XMLNS_ATTRIBUTE_NS_URI)) { //Its a namespace decl, ignore as it is already written. return; } if(nsUri==null || prefix == null || prefix.equals("")) { out.writeAttribute( in.getAttributeLocalName(i), in.getAttributeValue(i) ); } else { out.writeAttribute( prefix, nsUri, in.getAttributeLocalName(i), in.getAttributeValue(i) ); } }