Cantaloop CGimlet - API Documentation, Version: 0.2.0, Date: 2002-05-13 21:30 CEST

org.cantaloop.cgimlet
Class XMLUtils

java.lang.Object
  |
  +--org.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:
0.2.0 ($Revision: 1.3 $)
Author:
Stefan Heimann

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.
Parameters:
f - a File value
Returns:
a Document value

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.
Parameters:
parent - an Element value
ns - a Namespace value
Returns:
a List value

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.
Parameters:
name - a String value
reference - an Element value
Returns:
a QName value

Copyright 2001, 2002 Stefan Heimann, David Leuschner. All rights reserved.