コード例 #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));
 }