com.opencms.template
Interface I_CmsXmlParser

All Known Implementing Classes:
CmsXmlXercesParser

public interface I_CmsXmlParser

Common interface for OpenCms XML parsers. Classes and interfaces for each customized parser type have to be implemtented.

Version:
$Revision: 1.13 $ $Date: 2003/01/31 17:03:10 $
Author:
Alexander Kandzior, Alexander Lucas

Field Summary
static int C_XML_LINE_WIDTH
          Line width used for XML documents
 
Method Summary
 Document createEmptyDocument(String docNod)
          Creates an empty DOM XML document.
 String getOriginalEncoding(Document doc)
           
 void getXmlText(Document doc, OutputStream out, String encoding)
          Calls a XML printer for converting a XML DOM document to a String.
 void getXmlText(Document doc, Writer out)
          Calls a XML printer for converting a XML DOM document to a String.
 void getXmlText(Document doc, Writer out, String encoding)
          Calls a XML printer for converting a XML DOM document to a String.
 Node importNode(Document doc, Node node)
          Used to import a node from a foreign document.
 Document parse(InputStream in)
           
 Document parse(Reader in)
          Parses the given text.
 String toString()
          Gets a description of the parser.
 

Field Detail

C_XML_LINE_WIDTH

public static final int C_XML_LINE_WIDTH
Line width used for XML documents

See Also:
Constant Field Values
Method Detail

createEmptyDocument

public Document createEmptyDocument(String docNod)
                             throws Exception
Creates an empty DOM XML document.

Returns:
Empty document.
Exception

getXmlText

public void getXmlText(Document doc,
                       OutputStream out,
                       String encoding)
Calls a XML printer for converting a XML DOM document to a String.

Parameters:
doc - Document to be printed.
out - OutputStream to print to.
encoding - the character encoding to be used while serializing document, if null - original or default encoding will be used

getXmlText

public void getXmlText(Document doc,
                       Writer out,
                       String encoding)
Calls a XML printer for converting a XML DOM document to a String.

Parameters:
doc - Document to be printed.
out - Writer to print to.
encoding - the character encoding to be used while serializing

getXmlText

public void getXmlText(Document doc,
                       Writer out)
Calls a XML printer for converting a XML DOM document to a String.

Parameters:
doc - Document to be printed.
out - Writer to print to.

importNode

public Node importNode(Document doc,
                       Node node)
Used to import a node from a foreign document.

Parameters:
doc - Destination document that should import the node.
node - Node to be imported.
Returns:
New node that belongs to the document doc

parse

public Document parse(Reader in)
               throws Exception
Parses the given text.

Parameters:
in - Reader with the input text.
Returns:
Parsed text as DOM document.
Throws:
Exception

parse

public Document parse(InputStream in)
               throws Exception
Exception

getOriginalEncoding

public String getOriginalEncoding(Document doc)

toString

public String toString()
Gets a description of the parser.

Overrides:
toString in class Object
Returns:
Parser description.