xrel.xml
Class XmlDoc

java.lang.Object
  |
  +--xrel.xml.XmlDoc
All Implemented Interfaces:
XRelParserTreeConstants

public class XmlDoc
extends java.lang.Object
implements XRelParserTreeConstants

Traverses an XML document with DOM and translates it in an internal format tree.

Author:
Fabrizio Bisi

Field Summary
protected static java.lang.String DEFAULT_PARSER_NAME
          Default parser name (Xerces).
protected static org.w3c.dom.Document document
          The imported document.
protected static ParserWrapper.DocumentInfo fDocumentInfo
          Document information.
 
Fields inherited from interface xrel.parser.XRelParserTreeConstants
JJTAS, JJTCASE, JJTCOMMA, JJTEMPTY, JJTEXPORTTP, JJTIDENTIFIER, JJTIMPORTST, jjtNodeName, JJTOPERATOR, JJTPAR, JJTPROGRAM, JJTSTATEMENTLIST, JJTSTRING, JJTSTRINGLITERAL, JJTSWITCHCASE, JJTTAG, JJTTYPEDECL, JJTVOID
 
Constructor Summary
XmlDoc()
           
 
Method Summary
static SimpleNode convert()
          Converts the XML document imported from file with loadFrom() in an internal format.
static boolean loadFrom(java.lang.String filename)
          Loads the specified file and parses it with DOM.
protected static SimpleNode xmlSubtree(org.w3c.dom.Node node)
          Traverses the specified node recursively and produces an equivalent internal subtree. This function phisically does the translation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fDocumentInfo

protected static ParserWrapper.DocumentInfo fDocumentInfo
Document information.

DEFAULT_PARSER_NAME

protected static final java.lang.String DEFAULT_PARSER_NAME
Default parser name (Xerces).

document

protected static org.w3c.dom.Document document
The imported document.
Constructor Detail

XmlDoc

public XmlDoc()
Method Detail

loadFrom

public static boolean loadFrom(java.lang.String filename)

Loads the specified file and parses it with DOM.

Parameters:
filename - the name to load and parse
Returns:
true if successfully loaded

convert

public static SimpleNode convert()

Converts the XML document imported from file with loadFrom() in an internal format.

Returns:
the internal tree that represents the XML document

xmlSubtree

protected static SimpleNode xmlSubtree(org.w3c.dom.Node node)

Traverses the specified node recursively and produces an equivalent internal subtree.

This function phisically does the translation.

Parameters:
node - the DOM node to parse
Returns:
the root SimpleNode