Diamond Control Suite 3.0

diamondedge.util
Class XmlDom

java.lang.Object
  extended by diamondedge.util.XmlDom

public class XmlDom
extends Object


Nested Class Summary
static class XmlDom.ParseError
           
 
Constructor Summary
XmlDom()
           
 
Method Summary
 Document getDocument()
           
 XmlDom.ParseError getParseError()
           
static String getText(Node node)
          returns the text associated with the node.
 String getUrl()
          get the URL for the loaded XML document
 boolean isPreservingWhiteSpace()
          returns whether should remove whitespace Text nodes when parsing
 boolean isValidating()
          validate XML when parsing
 boolean load(File file)
          load document from the specified XML file
 boolean load(String fileName)
          load document from the specified XML file name
 boolean loadXML(String xmlData)
          load the XML document from a string
static void removeWhiteSpaceNodes(Node node)
           
 void save(String desination)
          save the document to a specified desination
 void setPreservingWhiteSpace(boolean preserveWhiteSpace)
          set option whether should remove whitespace Text nodes when parsing
static void setText(Node node, String text)
          set the text associated with the node.
 void setValidating(boolean validateOnParse)
          validate XML when parsing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlDom

public XmlDom()
Method Detail

getDocument

public Document getDocument()
                     throws Exception
Throws:
Exception

getUrl

public String getUrl()
get the URL for the loaded XML document


isPreservingWhiteSpace

public boolean isPreservingWhiteSpace()
returns whether should remove whitespace Text nodes when parsing


setPreservingWhiteSpace

public void setPreservingWhiteSpace(boolean preserveWhiteSpace)
set option whether should remove whitespace Text nodes when parsing


isValidating

public boolean isValidating()
validate XML when parsing


setValidating

public void setValidating(boolean validateOnParse)
validate XML when parsing


load

public boolean load(String fileName)
             throws Exception
load document from the specified XML file name

Throws:
Exception

load

public boolean load(File file)
load document from the specified XML file


loadXML

public boolean loadXML(String xmlData)
load the XML document from a string


getParseError

public XmlDom.ParseError getParseError()

save

public void save(String desination)
          throws Exception
save the document to a specified desination

Throws:
Exception

getText

public static String getText(Node node)
returns the text associated with the node. If node is an Element the text will inside the beginning and ending tag. This is actually the NodeValue of the child Text node of the given node.


setText

public static void setText(Node node,
                           String text)
set the text associated with the node. If node is an Element the text will inside the beginning and ending tag. This is actually the NodeValue of the child Text node of the given node.


removeWhiteSpaceNodes

public static void removeWhiteSpaceNodes(Node node)

Diamond Control Suite 3.0

Diamond Edge and Diamond Control Suite are trademarks or registered trademarks of Diamond Edge, Inc. Copyright 1999-2005 Diamond Edge, Inc. All Rights Reserved.