protected void handleSpace() throws XMLStreamException { handleCharacters(); }
event = in.next(); if (event == XMLStreamConstants.COMMENT) handleComment(); case XMLStreamConstants.START_ELEMENT : depth++; handleStartElement(); break; case XMLStreamConstants.END_ELEMENT : handleEndElement(); depth--; if(depth==0) break; case XMLStreamConstants.CHARACTERS : handleCharacters(); break; case XMLStreamConstants.ENTITY_REFERENCE : handleEntityReference(); break; case XMLStreamConstants.PROCESSING_INSTRUCTION : handlePI(); break; case XMLStreamConstants.COMMENT : handleComment(); break; case XMLStreamConstants.DTD : handleDTD(); break;
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) ); } }
event = in.next(); if (event == XMLStreamConstants.COMMENT) handleComment(); case XMLStreamConstants.START_ELEMENT : depth++; handleStartElement(); break; case XMLStreamConstants.END_ELEMENT : handleEndElement(); depth--; if(depth==0) break; case XMLStreamConstants.CHARACTERS : handleCharacters(); break; case XMLStreamConstants.ENTITY_REFERENCE : handleEntityReference(); break; case XMLStreamConstants.PROCESSING_INSTRUCTION : handlePI(); break; case XMLStreamConstants.COMMENT : handleComment(); break; case XMLStreamConstants.DTD : handleDTD(); break;
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) ); } }
event = in.next(); if (event == XMLStreamConstants.COMMENT) handleComment(); case XMLStreamConstants.START_ELEMENT : depth++; handleStartElement(); break; case XMLStreamConstants.END_ELEMENT : handleEndElement(); depth--; if(depth==0) break; case XMLStreamConstants.CHARACTERS : handleCharacters(); break; case XMLStreamConstants.ENTITY_REFERENCE : handleEntityReference(); break; case XMLStreamConstants.PROCESSING_INSTRUCTION : handlePI(); break; case XMLStreamConstants.COMMENT : handleComment(); break; case XMLStreamConstants.DTD : handleDTD(); break;
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 handleSpace() throws XMLStreamException { handleCharacters(); }
/** * 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) ); } }
protected void handleSpace() throws XMLStreamException { handleCharacters(); }