org.ow2.petals.component.framework.util
Class XMLUtil

java.lang.Object
  extended by org.ow2.petals.component.framework.util.XMLUtil

public final class XMLUtil
extends java.lang.Object

Contains utilities methods for XML operations.

Since:
1.0
Author:
alouis - EBMWebsourcing, ddesjardins - EBMWebsourcing, gblondelle - EBMWebsourcing

Method Summary
static org.w3c.dom.Node findVariable(org.w3c.dom.NodeList list, java.lang.String variable)
          Recursively traverse node and find the text node with the value of the specified variable.
static java.lang.String getTextContent(org.w3c.dom.Node node)
          Return the text element of a node, even if it is contained in a CDATA section
static org.w3c.dom.Document loadDocument(java.io.InputStream inputStream)
          Load a document from an input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTextContent

public static java.lang.String getTextContent(org.w3c.dom.Node node)
Return the text element of a node, even if it is contained in a CDATA section

Parameters:
node -
Returns:

loadDocument

public static org.w3c.dom.Document loadDocument(java.io.InputStream inputStream)
                                         throws java.io.IOException,
                                                org.xml.sax.SAXException
Load a document from an input stream.

Parameters:
inputStream -
Returns:
Throws:
java.io.IOException
org.xml.sax.SAXException

findVariable

public static org.w3c.dom.Node findVariable(org.w3c.dom.NodeList list,
                                            java.lang.String variable)
Recursively traverse node and find the text node with the value of the specified variable.

Parameters:
list - The node list to traverse.
variable - The value of the text node to find.
(Exemple : ${content})
Returns:
The node found otherwise null.


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.