tom.library.xml
Class XMLToTNode

java.lang.Object
  extended by tom.library.xml.XMLToTNode

public class XMLToTNode
extends Object


Constructor Summary
XMLToTNode()
           
XMLToTNode(InputStream is)
           
XMLToTNode(String filename)
           
 
Method Summary
 void convert(InputStream is)
          Set up nodeTerm by providing an InputStream
 void convert(Node node)
          Set up nodeTerm by providing a Node
 void convert(String filename)
          Set up nodeTerm by providing a filename
 Node convertToNode(InputStream is)
          Returns a Node by providing an input stream
 Node convertToNode(String filename)
          Returns an XML file to a Node representation
protected  Collection<Element> getNodes(TNode key)
           
 TNode getTNode()
          Get the nodeTerm attribute
 TNodeList namedNodeMapToAterm(NamedNodeMap list)
          Returns an ATerm representation of a NamedNodeMap
 TNodeList nodeListToAterm(NodeList list)
          Returns an ATerm representation of a NodeList
 void setDeletingWhiteSpaceNodes(boolean b_d)
           
 TNodeList sortAttributeList(TNodeList attrList)
           
 TNode xmlToTNode(Node node)
          Returns a TNode by providing a Node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLToTNode

public XMLToTNode()

XMLToTNode

public XMLToTNode(InputStream is)

XMLToTNode

public XMLToTNode(String filename)
Method Detail

getNodes

protected Collection<Element> getNodes(TNode key)

setDeletingWhiteSpaceNodes

public void setDeletingWhiteSpaceNodes(boolean b_d)

getTNode

public TNode getTNode()
Get the nodeTerm attribute

Returns:
nodeTerm

convert

public void convert(String filename)
Set up nodeTerm by providing a filename

Parameters:
filename - the filename

convert

public void convert(InputStream is)
Set up nodeTerm by providing an InputStream

Parameters:
is - the InputStream

convert

public void convert(Node node)
Set up nodeTerm by providing a Node

Parameters:
node - the Node

convertToNode

public Node convertToNode(String filename)
Returns an XML file to a Node representation

Parameters:
filename - the file to convert
Returns:
a Node representation of the XML file

convertToNode

public Node convertToNode(InputStream is)
Returns a Node by providing an input stream

Parameters:
is - the input stream
Returns:
a Node

nodeListToAterm

public TNodeList nodeListToAterm(NodeList list)
Returns an ATerm representation of a NodeList

Parameters:
list - the NodeList
Returns:
an ATerm representation of the NodeList

namedNodeMapToAterm

public TNodeList namedNodeMapToAterm(NamedNodeMap list)
Returns an ATerm representation of a NamedNodeMap

Parameters:
list - the NamedNodeMap
Returns:
an ATerm representation of the NamedNodeMap

xmlToTNode

public TNode xmlToTNode(Node node)
Returns a TNode by providing a Node

Parameters:
node - the Node to normalize and convert
Returns:
a TNode obtained from the Node

sortAttributeList

public TNodeList sortAttributeList(TNodeList attrList)