@Override protected void startDocumentInternal() throws XMLStreamException { this.eventWriter.add(this.eventFactory.createStartDocument()); }
@Override public void writeStartDocument() throws XMLStreamException { closeEmptyElementIfNecessary(); this.eventWriter.add(this.eventFactory.createStartDocument()); }
@Override public void writeStartDocument(String version) throws XMLStreamException { closeEmptyElementIfNecessary(); this.eventWriter.add(this.eventFactory.createStartDocument(DEFAULT_ENCODING, version)); }
@Override public void writeStartDocument(String encoding, String version) throws XMLStreamException { closeEmptyElementIfNecessary(); this.eventWriter.add(this.eventFactory.createStartDocument(encoding, version)); }
@Override protected void startDocumentInternal() throws XMLStreamException { this.eventWriter.add(this.eventFactory.createStartDocument()); }
@Override public void writeStartDocument() throws XMLStreamException { closeEmptyElementIfNecessary(); this.eventWriter.add(this.eventFactory.createStartDocument()); }
@Override public void writeStartDocument(String version) throws XMLStreamException { closeEmptyElementIfNecessary(); this.eventWriter.add(this.eventFactory.createStartDocument(DEFAULT_ENCODING, version)); }
@Override public void writeStartDocument(String encoding, String version) throws XMLStreamException { closeEmptyElementIfNecessary(); this.eventWriter.add(this.eventFactory.createStartDocument(encoding, version)); }
@Override public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws IOException, SAXException, XMLStreamException { super.startDocument(serializer, fragment,nsUriIndex2prefixIndex,nsContext); if(!fragment) out.add(ef.createStartDocument()); }
writer.add(factory.createStartDocument(getEncoding(), getVersion()));
@Override public void marshal(Object graph, Result result) throws XmlMappingException, IOException { Assert.isInstanceOf(Result.class, result); try { XMLEventFactory factory = XMLEventFactory.newInstance(); XMLEventWriter writer = StaxTestUtils.getXmlEventWriter(result); writer.add(factory.createStartDocument("UTF-8")); writer.add(factory.createStartElement("prefix", "namespace", graph.toString())); writer.add(factory.createEndElement("prefix", "namespace", graph.toString())); writer.add(factory.createEndDocument()); } catch ( Exception e) { throw new RuntimeException("Exception while writing to output file", e); } }
/** * StartDocument and EndDocument events are not passed to the wrapped * writer. */ public void testNoStartEnd() throws Exception { XMLEvent event = eventFactory.createComment("testEvent"); // mock expects only a single event wrappedWriter.add(event); writer.add(eventFactory.createStartDocument()); writer.add(event); writer.add(eventFactory.createEndDocument()); }
/** * Constructs a STAX {@link StartDocument}event from a DOM4J {@link * Document}. * * @param doc * The {@link Document}from which to construct the event. * * @return The constructed {@link StartDocument}event. */ public StartDocument createStartDocument(Document doc) { String encoding = doc.getXMLEncoding(); if (encoding != null) { return factory.createStartDocument(encoding); } else { return factory.createStartDocument(); } }
@Override protected void startDocumentInternal() throws XMLStreamException { consumeEvent(eventFactory.createStartDocument()); }
public void writeStartDocument(String encoding, String version) throws XMLStreamException { eventWriter.add(eventFactory.createStartDocument(encoding, version)); }
public void writeStartDocument() throws XMLStreamException { eventWriter.add(eventFactory.createStartDocument()); }
public void writeStartDocument(String version) throws XMLStreamException { eventWriter.add(eventFactory.createStartDocument(DEFAULT_ENCODING, version)); }
@Override public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws IOException, SAXException, XMLStreamException { super.startDocument(serializer, fragment,nsUriIndex2prefixIndex,nsContext); if(!fragment) out.add(ef.createStartDocument()); }
out.add(eventfactory.createStartDocument(null, null)); } else if (fstack.isOmitEncoding()) { out.add(eventfactory.createStartDocument(null, "1.0")); if (fstack.getLineSeparator() != null) { out.add(eventfactory.createCharacters(fstack.getLineSeparator())); out.add(eventfactory.createStartDocument(fstack.getEncoding(), "1.0")); if (fstack.getLineSeparator() != null) { out.add(eventfactory.createCharacters(fstack.getLineSeparator()));
public void startDocument() throws SAXException { try { staxWriter.add(staxEventFactory.createStartDocument()); } catch (XMLStreamException e) { throw new SAXException(e); } }