Class fr.bizolin.xml.Canon
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class fr.bizolin.xml.Canon

java.lang.Object
   |
   +----fr.bizolin.xml.Canon

public class Canon
extends Object
Canon by Bizolin (c)Cyril Vincent
www.multimania.com/cvincent/
March 2000
Canonize and write an XML from a file or a DOM document
Canonize an XML means that all tags are separate by a carriage return, puts indentations and replaces special characters by meta characters
This class needs the org.w3c.dom and oracle.xml.parser.v2 packages.

Version:
0.1.000315
Author:
Cyril Vincent

Constructor Index

 o Canon(boolean)
 o Canon(boolean, OutputStream)
 o Canon(XMLEncoding, boolean, OutputStream)

Method Index

 o main(String[])
Main program entry point.
 o print(Document, boolean, XMLEncoding, OutputStream)
Main function Prints the resulting document tree.
 o print(Document, OutputStream)
Prints the resulting document tree.
 o print(Document, XMLEncoding)
Prints the resulting document tree.
 o print(Document, XMLEncoding, OutputStream)
Prints the resulting document tree.
 o print(Node)
Prints the specified node, recursively node DOM Node
 o print(String, boolean, XMLEncoding)
Prints the resulting document tree.
 o print(String, boolean, XMLEncoding, OutputStream)
Prints the resulting document tree.

Constructors

 o Canon
 public Canon(XMLEncoding _encoding,
              boolean _canonical,
              OutputStream os) throws UnsupportedEncodingException
Parameters:
_encoding - set the encoding
_canonical - is true for a canonical output
outputStream - Output stream
 o Canon
 public Canon(boolean _canonical) throws UnsupportedEncodingException
Parameters:
_canonical - is true for a canonical output
 o Canon
 public Canon(boolean _canonical,
              OutputStream os) throws UnsupportedEncodingException
Parameters:
_canonical - is true for a canonical output
os - Output stream

Methods

 o print
 public static void print(Document document,
                          boolean canonical,
                          XMLEncoding encoding,
                          OutputStream os)
Main function Prints the resulting document tree.

Parameters:
document - DOM Document
canonical - canonical output
encoding - XML encoding
os - Output stream
 o print
 public static void print(Document document,
                          XMLEncoding encoding,
                          OutputStream os)
Prints the resulting document tree.

Parameters:
document - DOM Document
encoding - XML encoding
os - Output stream
 o print
 public static void print(Document document,
                          OutputStream os)
Prints the resulting document tree.

Parameters:
document - DOM Document
os - Output stream
 o print
 public static void print(Document document,
                          XMLEncoding encoding)
Prints the resulting document tree.

Parameters:
document - DOM Document
encoding - XML encoding
 o print
 public static void print(String uri,
                          boolean canonical,
                          XMLEncoding encoding,
                          OutputStream os)
Prints the resulting document tree.

Parameters:
uri - URL of the source document
canonical - canonical output
encoding - XML encoding
os - Output stream
 o print
 public static void print(String uri,
                          boolean canonical,
                          XMLEncoding encoding)
Prints the resulting document tree.

Parameters:
uri - URL of the source document
canonical - canonical output
encoding - XML encoding
 o print
 public void print(Node node)
Prints the specified node, recursively node DOM Node

 o main
 public static void main(String argv[])
Main program entry point.


All Packages  Class Hierarchy  This Package  Previous  Next  Index