Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.cantaloop.cgimlet
Class XMLUtils  view XMLUtils download XMLUtils.java

java.lang.Object
  extended byorg.cantaloop.cgimlet.XMLUtils

public final class XMLUtils
extends java.lang.Object

This class provides some useful methods that helps you with common XML tasks.

Version:
@version@ ($Revision: 1.3 $)

Constructor Summary
XMLUtils()
           
 
Method Summary
static org.dom4j.QName getQName(java.lang.String name, org.dom4j.Element reference)
          Get the QName of a raw name.
static java.util.List namespacedElements(org.dom4j.Element parent, org.dom4j.Namespace ns)
          Get a list with the direct children of parent that are in namespace ns.
static org.dom4j.Document parse(java.io.File f)
          Parse the file f and return the xml document.
static org.dom4j.Document parse(java.io.InputStream is)
          Parse the input stream and return the xml document.
 
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

parse

public static final org.dom4j.Document parse(java.io.File f)
Parse the file f and return the xml document.


parse

public static final org.dom4j.Document parse(java.io.InputStream is)
Parse the input stream and return the xml document.


namespacedElements

public static java.util.List namespacedElements(org.dom4j.Element parent,
                                                org.dom4j.Namespace ns)
Get a list with the direct children of parent that are in namespace ns.


getQName

public static final org.dom4j.QName getQName(java.lang.String name,
                                             org.dom4j.Element reference)
Get the QName of a raw name. For example:
xsd:string -> new QName("string", ns)
where ns is the namespace of the prefix xsd. To determine this namespace, the element reference is used.