ptolemy.data.expr
Class XMLParser

java.lang.Object
  extended byptolemy.data.expr.XMLParser

public class XMLParser
extends java.lang.Object

This class parses a XML string token to a DOM document.

Since:
Ptolemy II 4.0
Version:
$Id: XMLParser.java,v 1.9 2004/04/13 05:12:11 cxh Exp $
Author:
Yang Zhao
Accepted Rating:
Yellow (yuhong)
Proposed Rating:
Yellow (nsmyth)

Constructor Summary
XMLParser()
           
 
Method Summary
 org.w3c.dom.Document parser(java.io.InputStream is)
          Generate the document tree for the specified input stream.
 org.w3c.dom.Document parser(java.lang.String str)
          Generate the document tree for the specified XML string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLParser

public XMLParser()
          throws java.lang.Exception
Method Detail

parser

public org.w3c.dom.Document parser(java.lang.String str)
                            throws java.lang.Exception
Generate the document tree for the specified XML string. The Document (the root of the document tree) is returned. An exception will be thrown if the parse fails.

Parameters:
str - The XML string to be parsed.
Returns:
The document for the parse tree.
Throws:
java.lang.Exception - If the parse fails.

parser

public org.w3c.dom.Document parser(java.io.InputStream is)
                            throws java.lang.Exception
Generate the document tree for the specified input stream. The Document (the root of the document tree) is returned. An exception will be thrown if the parse fails.

Parameters:
is - The input steam to be parsed.
Returns:
The document for the parse tree.
Throws:
java.lang.Exception - If the parse fails.