/** * Writes an Element to an XMLStreamWriter. The writer must already have * started the document (via writeStartDocument()). Also, this probably * won't work with just a fragment of a document. The Element should be the * root element of the document. * * @param e * @param writer * @throws XMLStreamException */ public static void writeElement(Element e, XMLStreamWriter writer, boolean repairing) throws XMLStreamException { writeElement(e, writer, repairing, true); }
/** * Writes an Element to an XMLStreamWriter. The writer must already have * started the document (via writeStartDocument()). Also, this probably * won't work with just a fragment of a document. The Element should be the * root element of the document. * * @param e * @param writer * @throws XMLStreamException */ public static void writeElement(Element e, XMLStreamWriter writer, boolean repairing) throws XMLStreamException { writeElement(e, writer, repairing, true); }
/** * Writes an Element to an XMLStreamWriter. The writer must already have * started the document (via writeStartDocument()). Also, this probably * won't work with just a fragment of a document. The Element should be the * root element of the document. * * @param e * @param writer * @throws XMLStreamException */ public static void writeElement(Element e, XMLStreamWriter writer, boolean repairing) throws XMLStreamException { writeElement(e, writer, repairing, true); }
/** * Writes an Element to an XMLStreamWriter. The writer must already have * started the document (via writeStartDocument()). Also, this probably * won't work with just a fragment of a document. The Element should be the * root element of the document. * * @param e * @param writer * @throws XMLStreamException */ public static void writeElement(Element e, XMLStreamWriter writer, boolean repairing) throws XMLStreamException { writeElement(e, writer, repairing, true); }
/** * Writes an Element to an XMLStreamWriter. The writer must already have * started the document (via writeStartDocument()). Also, this probably * won't work with just a fragment of a document. The Element should be the * root element of the document. * * @param e * @param writer * @throws XMLStreamException */ public static void writeElement(Element e, XMLStreamWriter writer, boolean repairing) throws XMLStreamException { writeElement(e, writer, repairing, true); }
JAXWSAConstants.WSA_REFERENCEPARAMETERS_NAME, JAXWSAConstants.NS_WSA); for (Element ele : referenceParameters) { StaxUtils.writeElement(ele, writer, true); StaxUtils.writeElement(e, writer, true); StaxUtils.writeElement(e, writer, true);
protected void write(Source object, XMLStreamWriter writer) throws FactoryConfigurationError, XMLStreamException, DatabindingException { if (object == null) { return; } if (object instanceof DOMSource) { DOMSource ds = (DOMSource)object; Element element = null; if (ds.getNode() instanceof Element) { element = (Element)ds.getNode(); } else if (ds.getNode() instanceof Document) { element = ((Document)ds.getNode()).getDocumentElement(); } else { throw new DatabindingException("Node type " + ds.getNode().getClass() + " was not understood."); } StaxUtils.writeElement(element, writer, false); } else { StaxUtils.copy(object, writer); } }
protected void write(Source object, XMLStreamWriter writer) throws FactoryConfigurationError, XMLStreamException, DatabindingException { if (object == null) { return; } if (object instanceof DOMSource) { DOMSource ds = (DOMSource)object; Element element = null; if (ds.getNode() instanceof Element) { element = (Element)ds.getNode(); } else if (ds.getNode() instanceof Document) { element = ((Document)ds.getNode()).getDocumentElement(); } else { throw new DatabindingException("Node type " + ds.getNode().getClass() + " was not understood."); } StaxUtils.writeElement(element, writer, false); } else { StaxUtils.copy(object, writer); } }
@Override public void writeObject(Object object, MessageWriter writer, Context context) throws DatabindingException { Document doc = (Document)object; try { Element docElement = doc.getDocumentElement(); if (docElement == null) { if (isNillable()) { writer.writeXsiNil(); } else { throw new DatabindingException("Could not write xml: null document element."); } } else { StaxUtils.writeElement(docElement, ((ElementWriter)writer).getXMLStreamWriter(), false); } } catch (XMLStreamException e) { throw new DatabindingException("Could not write xml.", e); } } }
@Override public void writeObject(Object object, MessageWriter writer, Context context) throws DatabindingException { Document doc = (Document)object; try { Element docElement = doc.getDocumentElement(); if (docElement == null) { if (isNillable()) { writer.writeXsiNil(); } else { throw new DatabindingException("Could not write xml: null document element."); } } else { StaxUtils.writeElement(docElement, ((ElementWriter)writer).getXMLStreamWriter(), false); } } catch (XMLStreamException e) { throw new DatabindingException("Could not write xml.", e); } } }
writeElement((Element)n, writer, repairing); break; case Node.TEXT_NODE:
writeElement((Element)n, writer, repairing); break; case Node.TEXT_NODE:
writeElement((Element)n, writer, repairing); break; case Node.TEXT_NODE:
writeElement((Element)n, writer, repairing); break; case Node.TEXT_NODE:
writeElement((Element)n, writer, repairing); break; case Node.TEXT_NODE:
StaxUtils.writeElement(DomUtil.getFirstChildElement(bodyElement), xmlWriter, true); } else { StaxUtils.writeElement(element, xmlWriter, true);
JAXWSAConstants.WSA_REFERENCEPARAMETERS_NAME, JAXWSAConstants.NS_WSA); for (Element ele : referenceParameters) { StaxUtils.writeElement(ele, writer, true); StaxUtils.writeElement(e, writer, true); StaxUtils.writeElement(e, writer, true);