private void writeDocument(Document document, Writer writer) throws IOException { String v = document.getXmlVersion(); writer.append("<?xml "); writer.append(" version='").append(v == null ? "1.0" : v).append("'"); writer.append(" encoding='").append(encoding.name()).append("'"); if (document.getXmlStandalone()) { writer.append(" standalone='yes'"); } writer.append("?>").append(lineSeparator); NodeList nodes = document.getChildNodes(); for (int i = 0, imax = nodes.getLength(); i < imax; ++i) { write(nodes.item(i), writer, 0); } }
public boolean getXmlStandalone() { return this.doc.getXmlStandalone(); }
/** * @inheritDoc */ public boolean getXmlStandalone() { return dom.getXmlStandalone(); }
@Override public boolean getXmlStandalone() { return original_.getXmlStandalone(); }
public boolean isStandalone() { return dom3 && node != null ? ((Document)node).getXmlStandalone() : true; }
@Override public boolean getXmlStandalone() { return document.getXmlStandalone(); }
@Override public boolean getXmlStandalone() { return original_.getXmlStandalone(); }
public boolean getXmlStandalone() { return _delegate.getXmlStandalone(); }
/** * @return * @see org.w3c.dom.Document#getXmlStandalone() */ public boolean getXmlStandalone() { return getParent().getXmlStandalone(); }
@Override public boolean getXmlStandalone() { return document.getDomDocument().getXmlStandalone(); }
private void writeDocument(Document document, Writer writer) throws IOException { String v = document.getXmlVersion(); writer.append("<?xml "); writer.append(" version='").append(v == null ? "1.0" : v).append("'"); writer.append(" encoding='").append(encoding.name()).append("'"); if (document.getXmlStandalone()) { writer.append(" standalone='yes'"); } writer.append("?>").append(lineSeparator); NodeList nodes = document.getChildNodes(); for (int i = 0, imax = nodes.getLength(); i < imax; ++i) { write(nodes.item(i), writer, 0); } }
private void writeDocument(Document document, Writer writer) throws IOException { String v = document.getXmlVersion(); writer.append("<?xml "); writer.append(" version='").append(v == null ? "1.0" : v).append("'"); writer.append(" encoding='").append(encoding.name()).append("'"); if (document.getXmlStandalone()) { writer.append(" standalone='yes'"); } writer.append("?>").append(lineSeparator); NodeList nodes = document.getChildNodes(); for (int i = 0, imax = nodes.getLength(); i < imax; ++i) { write(nodes.item(i), writer, 0); } }
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder = factory.newDocumentBuilder(); Document document = documentBuilder.parse(new File("myFile.xml")); String version = document.getXmlVersion(); String encoding = document.getXmlEncoding(); boolean standalone = document.getXmlStandalone();
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; boolean standalone; doc = (Document) load("barfoo_standalone_yes", false); standalone = doc.getXmlStandalone(); assertTrue("documentgetxmlstandalone04", standalone); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; boolean standalone; doc = (Document) load("barfoo_standalone_no", false); standalone = doc.getXmlStandalone(); assertFalse("documentgetxmlstandalone03", standalone); } /**
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; boolean standalone; doc = (Document) load("hc_staff", false); standalone = doc.getXmlStandalone(); assertFalse("documentgetxmlstandalone01", standalone); } /**
private void setDocumentInfo(Document document) { if (!document.getXmlStandalone()) _handler.setStandalone(Boolean.toString(document.getXmlStandalone())); setXMLVersion(document.getXmlVersion()); setEncoding(document.getXmlEncoding()); }
private void setDocumentInfo(Document document) { if (!document.getXmlStandalone()) _handler.setStandalone(Boolean.toString(document.getXmlStandalone())); setXMLVersion(document.getXmlVersion()); setEncoding(document.getXmlEncoding()); }
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; boolean standalone; doc = (Document) load("hc_staff", true); doc.setXmlStandalone(true); standalone = doc.getXmlStandalone(); assertTrue("documentsetxmlstandalone01", standalone); } /**
private void init() throws XMLStreamException { _namespaceTracker = new NamespaceReaderContext(); declareNamespaces(); if (_current instanceof Document) { Document document = (Document) _current; _encoding = document.getXmlEncoding(); _version = document.getXmlVersion(); _standalone = document.getXmlStandalone(); } }