public XMLWriter(Writer writer, OutputFormat format) { this.writer = writer; this.format = format; namespaceStack.push(Namespace.NO_NAMESPACE); }
public XMLWriter() throws UnsupportedEncodingException { this.format = DEFAULT_FORMAT; this.writer = new BufferedWriter( new OutputStreamWriter( System.out, StandardCharsets.UTF_8) ); this.autoFlush = true; namespaceStack.push(Namespace.NO_NAMESPACE); }
public XMLWriter(OutputStream out, OutputFormat format) throws UnsupportedEncodingException { this.format = format; this.writer = createWriter(out, format.getEncoding()); this.autoFlush = true; namespaceStack.push(Namespace.NO_NAMESPACE); }
public XMLWriter(OutputStream out) throws UnsupportedEncodingException { this.format = DEFAULT_FORMAT; this.writer = createWriter(out, format.getEncoding()); this.autoFlush = true; namespaceStack.push(Namespace.NO_NAMESPACE); }
public XMLWriter(OutputFormat format) throws UnsupportedEncodingException { this.format = format; this.writer = createWriter( System.out, format.getEncoding() ); this.autoFlush = true; namespaceStack.push(Namespace.NO_NAMESPACE); }
if (!ns.getURI().equals(uri)) { // output a new namespace declaration writeNamespace(ns); namespaceStack.push(ns); if (namespaceStack.getNamespaceForPrefix(prefix) == null) { String uri = attribute.getValue(); namespaceStack.push(prefix, uri); writeNamespace(prefix, uri); if (namespaceStack.getDefaultNamespace() == null) { String uri = attribute.getValue(); namespaceStack.push(null, uri); writeNamespace(null, uri);
public XMLWriter(Writer writer, OutputFormat format) { this.writer = writer; this.format = format; namespaceStack.push(Namespace.NO_NAMESPACE); }
public void startPrefixMapping(String prefix, String uri) throws SAXException { namespaceStack.push(prefix, uri); }
public void startPrefixMapping(String prefix, String uri) throws SAXException { namespaceStack.push(prefix, uri); }
public XMLWriter() { this.format = DEFAULT_FORMAT; this.writer = new BufferedWriter(new OutputStreamWriter(System.out)); this.autoFlush = true; namespaceStack.push(Namespace.NO_NAMESPACE); }
protected void resetNamespaceStack() { namespaceStack.clear(); namespaceStack.push(Namespace.XML_NAMESPACE); } }
/** * Adds a new namespace to the stack * * @param prefix * DOCUMENT ME! * @param uri * DOCUMENT ME! * * @return DOCUMENT ME! */ public Namespace addNamespace(String prefix, String uri) { Namespace namespace = createNamespace(prefix, uri); push(namespace); return namespace; }
/** * Adds a namepace to the stack with the given prefix and URI * * @param prefix * DOCUMENT ME! * @param uri * DOCUMENT ME! */ public void push(String prefix, String uri) { if (uri == null) { uri = ""; } Namespace namespace = createNamespace(prefix, uri); push(namespace); }
public XMLWriter(OutputFormat format) throws UnsupportedEncodingException { this.format = format; this.writer = createWriter(System.out, format.getEncoding()); this.autoFlush = true; namespaceStack.push(Namespace.NO_NAMESPACE); }
/** * Writes all namespaces declared directly on element. * * @throws IOException */ protected void writeNamespaces(Element element) throws IOException { assert element != null; for (Namespace ns : element.declaredNamespaces()) { writeNamespace(ns); namespaceStack.push(ns); } }
public XMLWriter(OutputStream out) throws UnsupportedEncodingException { this.format = DEFAULT_FORMAT; this.writer = createWriter(out, format.getEncoding()); this.autoFlush = true; namespaceStack.push(Namespace.NO_NAMESPACE); }
public XMLWriter(OutputStream out, OutputFormat format) throws UnsupportedEncodingException { this.format = format; this.writer = createWriter(out, format.getEncoding()); this.autoFlush = true; namespaceStack.push(Namespace.NO_NAMESPACE); }
protected void clearNamespaceStack() { namespaceStack.clear(); if (!namespaceStack.contains(Namespace.XML_NAMESPACE)) { namespaceStack.push(Namespace.XML_NAMESPACE); } }