public void node(Node node, NamespaceResolver resolver) { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } try { if(node.getNodeType() == Node.DOCUMENT_NODE) { node = ((Document)node).getDocumentElement(); } domToXMLEventWriter.writeToEventWriter(node, this.xmlEventWriter); } catch(XMLStreamException e) { throw XMLMarshalException.marshalException(e); } }
public void node(Node node, NamespaceResolver resolver, String uri, String name) { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } try { if(node.getNodeType() == Node.DOCUMENT_NODE) { node = ((Document)node).getDocumentElement(); } domToXMLEventWriter.writeToEventWriter(node, uri, name, xmlEventWriter); } catch(XMLStreamException e) { throw XMLMarshalException.marshalException(e); } }
@Override public void node(Node node, NamespaceResolver resolver, String uri, String name) { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } try { if(node.getNodeType() == Node.DOCUMENT_NODE) { node = ((Document)node).getDocumentElement(); } domToXMLEventWriter.writeToEventWriter(node, uri, name, xmlEventWriter); } catch(XMLStreamException e) { throw XMLMarshalException.marshalException(e); } }
public void characters(String value) { try { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } XMLEvent charactersEvent = this.xmlEventFactory.createCharacters(value); this.xmlEventWriter.add(charactersEvent); } catch(Exception e) { throw XMLMarshalException.marshalException(e); } }
public void endDocument() { try { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } XMLEvent endDoc = this.xmlEventFactory.createEndDocument(); this.xmlEventWriter.add(endDoc); } catch(Exception e) { throw XMLMarshalException.marshalException(e); } }
public void openStartElement(XPathFragment xPathFragment, NamespaceResolver namespaceResolver) { super.openStartElement(xPathFragment, namespaceResolver); if (isStartElementOpen) { openAndCloseStartElement(); } isStartElementOpen = true; this.namespaceURI = xPathFragment.getNamespaceURI(); this.xPathFragment = xPathFragment; this.attributes = null; this.namespaceDeclarations = null; writePrefixMappings(); }
@Override public void characters(String value) { try { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } xmlEventWriter.add(xmlEventFactory.createCharacters(value)); } catch(Exception e) { throw XMLMarshalException.marshalException(e); } }
public void characters(String value) { try { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } xmlEventWriter.add(xmlEventFactory.createCharacters(value)); } catch(Exception e) { throw XMLMarshalException.marshalException(e); } }
public void cdata(String value) { try { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } XMLEvent cdataEvent = this.xmlEventFactory.createCData(value); this.xmlEventWriter.add(cdataEvent); } catch(Exception e) { throw XMLMarshalException.marshalException(e); } }
public void cdata(String value) { try { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } xmlEventWriter.add(xmlEventFactory.createCData(value)); } catch(Exception e) { throw XMLMarshalException.marshalException(e); } }
public void endDocument() { try { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } xmlEventWriter.add(xmlEventFactory.createEndDocument()); xmlEventWriter.flush(); } catch(Exception e) { throw XMLMarshalException.marshalException(e); } }
@Override public void endDocument() { try { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } xmlEventWriter.add(xmlEventFactory.createEndDocument()); xmlEventWriter.flush(); } catch(Exception e) { throw XMLMarshalException.marshalException(e); } }
@Override public void cdata(String value) { try { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } for(String part : MarshalRecord.splitCData(value)) { xmlEventWriter.add(xmlEventFactory.createCData(part)); } } catch(Exception e) { throw XMLMarshalException.marshalException(e); } }
public void endElement(XPathFragment pathFragment, NamespaceResolver namespaceResolver) { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } String prefix = getPrefixForFragment(pathFragment); if(null == prefix) { prefix = Constants.EMPTY_STRING; } try { xmlEventWriter.add(xmlEventFactory.createEndElement(prefix, xPathFragment.getNamespaceURI(), pathFragment.getLocalName())); } catch(Exception e) { throw XMLMarshalException.marshalException(e); } }
@Override public void openStartElement(XPathFragment xPathFragment, NamespaceResolver namespaceResolver) { super.openStartElement(xPathFragment, namespaceResolver); if (isStartElementOpen) { openAndCloseStartElement(); } isStartElementOpen = true; this.xPathFragment = xPathFragment; this.attributes = null; this.namespaceDeclarations = null; if(xPathFragment.isGeneratedPrefix()){ namespaceDeclaration(xPathFragment.getPrefix(), xPathFragment.getNamespaceURI()); } writePrefixMappings(); }
public void openStartElement(XPathFragment xPathFragment, NamespaceResolver namespaceResolver) { super.openStartElement(xPathFragment, namespaceResolver); if (isStartElementOpen) { openAndCloseStartElement(); } isStartElementOpen = true; this.xPathFragment = xPathFragment; this.attributes = null; this.namespaceDeclarations = null; if(xPathFragment.isGeneratedPrefix()){ namespaceDeclaration(xPathFragment.getPrefix(), xPathFragment.getNamespaceURI()); } writePrefixMappings(); }
@Override public void endElement(XPathFragment pathFragment, NamespaceResolver namespaceResolver) { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } String prefix = getPrefixForFragment(pathFragment); if(null == prefix) { prefix = Constants.EMPTY_STRING; } try { xmlEventWriter.add(xmlEventFactory.createEndElement(prefix, xPathFragment.getNamespaceURI(), pathFragment.getLocalName())); } catch(Exception e) { throw XMLMarshalException.marshalException(e); } }
public void endElement(XPathFragment pathFragment, NamespaceResolver namespaceResolver) { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } String namespaceURI = pathFragment.getNamespaceURI(); String prefix = pathFragment.getPrefix(); if(prefix == null) { prefix = XMLConstants.EMPTY_STRING; } try { XMLEvent endElement = this.xmlEventFactory.createEndElement(prefix, namespaceURI, pathFragment.getLocalName()); this.xmlEventWriter.add(endElement); } catch(Exception e) { throw XMLMarshalException.marshalException(e); } }
@Override public void element(XPathFragment frag) { try { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } String namespaceURI = frag.getNamespaceURI(); String localName = frag.getLocalName(); String prefix = getPrefixForFragment(xPathFragment); if(null == prefix) { prefix = Constants.EMPTY_STRING; } xmlEventWriter.add(xmlEventFactory.createStartElement(prefix, namespaceURI, localName)); xmlEventWriter.add(xmlEventFactory.createEndElement(prefix, namespaceURI, localName)); } catch(Exception e) { throw XMLMarshalException.marshalException(e); } }
public void element(XPathFragment frag) { try { if(isStartElementOpen) { openAndCloseStartElement(); isStartElementOpen = false; } String prefix = frag.getPrefix(); if(null == prefix) { prefix = XMLConstants.EMPTY_STRING; } XMLEvent startElement = this.xmlEventFactory.createStartElement(prefix, frag.getNamespaceURI(), frag.getLocalName()); this.xmlEventWriter.add(startElement); this.xmlEventWriter.add(this.xmlEventFactory.createEndElement(prefix, frag.getNamespaceURI(), frag.getLocalName())); } catch(Exception e) { throw XMLMarshalException.marshalException(e); } }