com.boylesoftware.cb2.util
Class XMLUtils

java.lang.Object
  extended bycom.boylesoftware.cb2.util.XMLUtils

public final class XMLUtils
extends java.lang.Object

A collection of utility functions that help to work with XML.

Version:
$Id: XMLUtils.java,v 1.3 2003/08/29 13:08:53 levahim Exp $
Author:
Lev Himmelfarb

Constructor Summary
XMLUtils()
           
 
Method Summary
static java.lang.String getXMLNodeText(org.w3c.dom.Node node)
          Retrieves text body of an XML node.
static java.lang.String getXMLSubelementText(org.w3c.dom.Element element, java.lang.String subelementName)
          Retrieves text body of an XML element's subnode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLUtils

public XMLUtils()
Method Detail

getXMLNodeText

public static java.lang.String getXMLNodeText(org.w3c.dom.Node node)
Retrieves text body of an XML node.

Parameters:
node - the XML node to fetch text content from.
Returns:
text contained in the specified node or null if there is no text content in the node.

getXMLSubelementText

public static java.lang.String getXMLSubelementText(org.w3c.dom.Element element,
                                                    java.lang.String subelementName)
Retrieves text body of an XML element's subnode.

Parameters:
element - the XML element to look for the subnode in.
subelementName - name of the nested node.
Returns:
text contained in the specified subnode or null if there is no such a subnode or there is no text content in it.


Copyright © 2002,2003,2004 - Boyle Software, Inc.