You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2009/05/12 00:01:56 UTC

svn commit: r773706 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java

Author: adrianc
Date: Mon May 11 22:01:55 2009
New Revision: 773706

URL: http://svn.apache.org/viewvc?rev=773706&view=rev
Log:
Small change to new JAXP TrAX methods - they now accept Node arguments instead of Element arguments.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java?rev=773706&r1=773705&r2=773706&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilXml.java Mon May 11 22:01:55 2009
@@ -184,23 +184,23 @@
         return transformerFactory.newTransformer(new StreamSource(bis));
     }
 
-    /** Serializes a DOM <code>Element</code> to an <code>OutputStream</code>
+    /** Serializes a DOM <code>Node</code> to an <code>OutputStream</code>
      * using JAXP TrAX.
      * @param transformer A <code>Transformer</code> instance
-     * @param element The <code>Element</code> to serialize
+     * @param element The <code>Node</code> to serialize
      * @param os The <code>OutputStream</code> to serialize to
      * @see <a href="http://java.sun.com/javase/6/docs/api/javax/xml/transform/package-summary.html">JAXP TrAX</a>
      * @throws TransformerException
      */
-    public static void transformDomDocument(Transformer transformer, Element element, OutputStream os) throws TransformerException {
-        DOMSource source = new DOMSource(element);
+    public static void transformDomDocument(Transformer transformer, Node node, OutputStream os) throws TransformerException {
+        DOMSource source = new DOMSource(node);
         StreamResult result = new StreamResult(os);
         transformer.transform(source, result);
     }
 
-    /** Serializes a DOM <code>Element</code> to an <code>OutputStream</code>
+    /** Serializes a DOM <code>Node</code> to an <code>OutputStream</code>
      * using JAXP TrAX.
-     * @param element The <code>Element</code> to serialize
+     * @param element The <code>Node</code> to serialize
      * @param os The <code>OutputStream</code> to serialize to
      * @param encoding Optional encoding, defaults to UTF-8
      * @param omitXmlDeclaration If <code>true</code> the xml declaration
@@ -211,9 +211,9 @@
      * @see <a href="http://java.sun.com/javase/6/docs/api/javax/xml/transform/package-summary.html">JAXP TrAX</a>
      * @throws TransformerException
      */
-    public static void writeXmlDocument(Element element, OutputStream os, String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount) throws TransformerException {
+    public static void writeXmlDocument(Node node, OutputStream os, String encoding, boolean omitXmlDeclaration, boolean indent, int indentAmount) throws TransformerException {
         Transformer transformer = createOutputTransformer(encoding, omitXmlDeclaration, indent, indentAmount);
-        transformDomDocument(transformer, element, os);
+        transformDomDocument(transformer, node, os);
     }
 
     // ------------------------------------ //