예제 #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);
   }
 }
예제 #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);
 }
예제 #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);
 }
예제 #4
0
 @Override
 public String escapeAttributeValue(Object o) {
   return options.escapeAttributeValue(o);
 }
예제 #5
0
 @Override
 public String escapeTextValue(Object o) {
   return options.escapeTextValue(o);
 }
예제 #6
0
 static XmlNode createText(XmlProcessor processor, String value) {
   return createImpl(processor.newDocument().createTextNode(value));
 }
예제 #7
0
 String toXmlString(XmlProcessor processor) {
   return processor.ecmaToXmlString(this.dom);
 }
예제 #8
0
 static XmlNode createElement(XmlProcessor processor, String namespaceUri, String xml)
     throws org.xml.sax.SAXException {
   return createImpl(processor.toXml(namespaceUri, xml));
 }