Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[hyades-dev] Additional JDK 1.4 XML utilities.



Two new APIs have been added including:

    /**
     * Serializes a DOM to an XML document array of bytes.
     * <p>
     * The parameter DOM is serialized to the returned XML document array
of bytes,
     * which is  formatted (e.g. line breaks, indentation, etc.).
     * <p>
     * The encoding for the serialized XML document array of bytes is
explicitly set to "UTF-8"
     * for all platforms excluding z/OS and OS/390 platforms. The encoding
for the
     * serialized XML document array of bytes is explicitly set to "IBM-
1047" for z/OS and OS/390
     * platforms only.
     * <p>
     *
     * @param document The DOM to be serialized to a formatted XML document
array of bytes.
     * @return The DOM serialized as a formatted XML document array of
bytes, otherwise null.
     * @throws TransformerException If the <code>TransformerFactory</code>
cannot create a new XML <code>Transformer</code> instance or an error
occurs during                       serialization.
     */
    public static byte[] serializeAsByteArray(Document document) throws
TransformerException


    /**
     * Serializes a DOM to an XML document array of bytes.
     * <p>
     * The parameter DOM is serialized to the returned XML document array
of bytes,
     * which may be potentially formatted.
     * <p>
     * The returned XML document array of bytes is formatted (e.g. line
breaks, indentation,
     * etc.) if the parameter <code>format</code> flag is true.
     * <p>
     * The encoding for the serialized XML document array of bytes is
explicitly set to "UTF-8"
     * for all platforms excluding z/OS and OS/390 platforms. The encoding
for the
     * serialized XML document array of bytes is explicitly set to "IBM-
1047" for z/OS and OS/390
     * platforms only.
     * <p>
     *
     * @param document The DOM to be serialized to a potentially formatted
XML document array of bytes.
     * @param format If the serialized XML document array of bytes is
formatted (e.g. line breaks, indentation, etc.).
     * @return The DOM serialized as a potentially formatted XML document
array of bytes, otherwise null.
     * @throws TransformerException If the <code>TransformerFactory</code>
cannot create a new XML <code>Transformer</code> instance or an error
occurs during                       serialization.
     */
    public static byte[] serializeAsByteArray(Document document, boolean
format) throws TransformerException

PS

----------------------------------------------
Paul Slauenwhite
IBM Toronto Lab, Canada

Internet: paules@xxxxxxxxxx
Telephone: (905) 413-3861
Tie Line: 969-3861
Fax: (905) 413-4920
---------------------------------------------



Back to the top