net.logAnalyzer.utils
Class XMLUtils

java.lang.Object
  extended bynet.logAnalyzer.utils.XMLUtils

public class XMLUtils
extends java.lang.Object

This class provides utilities methods manipulating XML documents.

Version:
1.0
Author:
Karim REFEYTON

Method Summary
static org.w3c.dom.Attr addAttribute(org.w3c.dom.Document document, org.w3c.dom.Element node, java.lang.String name, java.lang.String value)
          Adds an attribute to the specified node.
static org.w3c.dom.Element addElement(org.w3c.dom.Document document, org.w3c.dom.Element parent, java.lang.String name)
          Adds an element to the specified parent node.
static org.w3c.dom.Element addElement(org.w3c.dom.Document document, org.w3c.dom.Element parent, java.lang.String name, java.lang.String value, boolean inCDATA)
          Adds an element to the specified parent node.
static org.w3c.dom.Element addElement(org.w3c.dom.Document document, java.lang.String name)
          Adds an element to the root node.
static org.w3c.dom.Element addElement(org.w3c.dom.Document document, java.lang.String name, java.lang.String value, boolean inCDATA)
          Adds an element to the root node.
static java.lang.String toString(org.w3c.dom.Document document)
          Returns a string description of an XML document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addElement

public static org.w3c.dom.Element addElement(org.w3c.dom.Document document,
                                             java.lang.String name)
Adds an element to the root node.

Parameters:
name - Element name.
Returns:
New element.

addElement

public static org.w3c.dom.Element addElement(org.w3c.dom.Document document,
                                             org.w3c.dom.Element parent,
                                             java.lang.String name)
Adds an element to the specified parent node.

Parameters:
parent - Parent element.
name - Element name.
Returns:
New element.

addElement

public static org.w3c.dom.Element addElement(org.w3c.dom.Document document,
                                             java.lang.String name,
                                             java.lang.String value,
                                             boolean inCDATA)
Adds an element to the root node.

Parameters:
name - Element name.
value - Element value.
inCDATA - If true, the key is embraced in a CDATA.
Returns:
New element.

addElement

public static org.w3c.dom.Element addElement(org.w3c.dom.Document document,
                                             org.w3c.dom.Element parent,
                                             java.lang.String name,
                                             java.lang.String value,
                                             boolean inCDATA)
Adds an element to the specified parent node.

Parameters:
parent - Parent element.
name - Element name.
value - Element value.
inCDATA - If true, the key is embraced in a CDATA.
Returns:
New element.

addAttribute

public static org.w3c.dom.Attr addAttribute(org.w3c.dom.Document document,
                                            org.w3c.dom.Element node,
                                            java.lang.String name,
                                            java.lang.String value)
Adds an attribute to the specified node.

Parameters:
node - Node element.
name - Attribute name.
value - Attribute value.
Returns:
New attribute.

toString

public static java.lang.String toString(org.w3c.dom.Document document)
                                 throws java.io.IOException
Returns a string description of an XML document.

Parameters:
document - XML document to serialize in a string.
Returns:
XML Document in string format.
Throws:
java.io.IOException - If parser configuration is invalid.


Copyright © 2006 null. All Rights Reserved.