soapical.util
Class PrettyXML

java.lang.Object
  extended bysoapical.util.PrettyXML

public class PrettyXML
extends java.lang.Object

Prints XML as in some HTML form, for example, with syntactic highlighting and indentation. This printing is controlled by an XSLT sytlesheet. If the XML is not well-formed, or the stylesheet is missing/broken, it is printed in raw form with an error message. Note: for this to work, you have to set the system property

Version:
$Revision: 1.2 $
$Date: 2003/08/01 14:44:11 $
Author:
Eric Kow (kow at loria point fr)

Constructor Summary
PrettyXML()
           
 
Method Summary
static java.lang.String formatError(java.lang.String error)
           
static java.lang.String getFancyCSS()
          Returns the contents of CSS stylesheet, which will be useful for the output of writeFancily.
static java.lang.String toSimpleHTML(java.lang.String string)
          Returns the XML string as HTML, with all the brackets quoted and the newlines treated as breaks.
static void writeBoringly(java.io.Reader reader, java.io.Writer writer)
          Writes the XML from the reader parameter to the writer as plain HTML (with the brackets converted.
static void writeFancily(java.io.Reader reader, java.io.Writer writer)
          Writes the XML from the reader parameter to the writer via an XSLT sytlesheet.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrettyXML

public PrettyXML()
Method Detail

writeFancily

public static void writeFancily(java.io.Reader reader,
                                java.io.Writer writer)
                         throws java.io.IOException
Writes the XML from the reader parameter to the writer via an XSLT sytlesheet.

Throws:
java.io.IOException
See Also:
getFancyCSS()

writeBoringly

public static void writeBoringly(java.io.Reader reader,
                                 java.io.Writer writer)
                          throws java.io.IOException
Writes the XML from the reader parameter to the writer as plain HTML (with the brackets converted.

Throws:
java.io.IOException

getFancyCSS

public static java.lang.String getFancyCSS()
Returns the contents of CSS stylesheet, which will be useful for the output of writeFancily. The idea is that you would call this once, before calling writeFancily as many times as you like. It's up to you to decide whether to put this in a style block or a as a link

See Also:
writeFancily(java.io.Reader, java.io.Writer)

formatError

public static java.lang.String formatError(java.lang.String error)

toSimpleHTML

public static java.lang.String toSimpleHTML(java.lang.String string)
Returns the XML string as HTML, with all the brackets quoted and the newlines treated as breaks.