Exemplo n.º 1
0
 String ecmaToXMLString(XmlProcessor processor) {
   if (this.isElementType()) {
     Element copy = (Element) this.dom.cloneNode(true);
     Namespace[] inScope = this.getInScopeNamespaces();
     for (int i = 0; i < inScope.length; i++) {
       declareNamespace(copy, inScope[i].getPrefix(), inScope[i].getUri());
     }
     return processor.ecmaToXmlString(copy);
   } else {
     return processor.ecmaToXmlString(dom);
   }
 }
Exemplo n.º 2
0
 String debug() {
   XmlProcessor raw = new XmlProcessor();
   raw.setIgnoreComments(false);
   raw.setIgnoreProcessingInstructions(false);
   raw.setIgnoreWhitespace(false);
   raw.setPrettyPrinting(false);
   return raw.ecmaToXmlString(this.dom);
 }
Exemplo n.º 3
0
 static XmlNode newElementWithText(
     XmlProcessor processor, XmlNode reference, XmlNode.QName qname, String value) {
   if (reference instanceof org.w3c.dom.Document)
     throw new IllegalArgumentException("Cannot use Document node as reference");
   Document document = null;
   if (reference != null) {
     document = reference.dom.getOwnerDocument();
   } else {
     document = processor.newDocument();
   }
   Node referenceDom = (reference != null) ? reference.dom : null;
   Element e = document.createElementNS(qname.getUri(), qname.qualify(referenceDom));
   if (value != null) {
     e.appendChild(document.createTextNode(value));
   }
   return XmlNode.createImpl(e);
 }
Exemplo n.º 4
0
 @Override
 public String escapeAttributeValue(Object o) {
   return options.escapeAttributeValue(o);
 }
Exemplo n.º 5
0
 @Override
 public String escapeTextValue(Object o) {
   return options.escapeTextValue(o);
 }
Exemplo n.º 6
0
 static XmlNode createText(XmlProcessor processor, String value) {
   return createImpl(processor.newDocument().createTextNode(value));
 }
Exemplo n.º 7
0
 String toXmlString(XmlProcessor processor) {
   return processor.ecmaToXmlString(this.dom);
 }
Exemplo n.º 8
0
 static XmlNode createElement(XmlProcessor processor, String namespaceUri, String xml)
     throws org.xml.sax.SAXException {
   return createImpl(processor.toXml(namespaceUri, xml));
 }