XML functions


Standard Syntax:
     <%@ taglib prefix="xml" uri="http://jsftools.logikdev.com/xml" %>

XML Syntax:
     <anyxmlelement xmlns:xml="http://jsftools.logikdev.com/xml" />

JSF Tools 0.3 XML functions library

Tag Library Information
Display NameXML functions
Version0.3
Short Namexml
URIhttp://jsftools.logikdev.com/xml
 

Function Summary
java.lang.Stringattr( org.dom4j.Node, java.lang.Object)Returns the value of the specified attribute for the given Node, if that Node is an Element. If it is a non-Element node type or there is no value for that attribute in this element, then this will return null.
java.util.Mapattributes( org.dom4j.Node)Returns a Map of all attributes for the given Node. If that Node is not an Element, this will return null.
org.dom4j.Nodechildren( org.dom4j.Node)Returns a new Node instance that wraps all the child Elements of the given Node.
org.dom4j.Nodefind( org.dom4j.Node, java.lang.String)Performs an XPath selection on the given Node and returns a new Node instance that wraps those results.

Other functions available:

org.dom4j.Node find(org.dom4j.Node, java.lang.Object)

Examples:
 ${xml:find(node, xpath)}
${xml:find(node, object)}
org.dom4j.Nodeget( org.dom4j.Node, java.lang.Number)Returns a Node that wraps the specified Node from the given Node.

Other functions available:

java.lang.Object get(org.dom4j.Node, java.lang.Object)

Examples:
 ${xml:get(node, number)}
${xml:get(node, object)}
org.dom4j.NodegetFirst( org.dom4j.Node)Returns a Node that wraps only the first Node from the given Node.
org.dom4j.NodegetLast( org.dom4j.Node)Returns a Node that wraps only the last Node from the given Node.
java.lang.ObjectgetName( org.dom4j.Node)Asks get(Object) for a "name" result. If none, this will return the result of getNodeName().
java.lang.StringgetNodeName( org.dom4j.Node)Returns the name of the root node. If the given Node has more than one Node, it will only return the name of the first node in the list.
org.dom4j.NodegetParent( org.dom4j.Node)Returns a new Node instance that wraps the parent Element of the given Node.
java.lang.StringgetPath( org.dom4j.Node)Returns the XPath that identifies the given Node.
java.lang.StringgetText( org.dom4j.Node)Returns the concatenated text content of the given Node.
org.dom4j.Nodeparents( org.dom4j.Node)Returns a new Node instance that wraps the parent Element of the given Node.
org.dom4j.Nodeparse( java.lang.Object)This accepts XML in form. If the XML is valid, it will return a new Node instance with the resulting XML document as the root Node. If parsing the content fails, this will return null.
org.dom4j.Noderead( java.lang.Object)If valid, it will return a new Node instance with that document as the root Node. If reading the URL or parsing its content fails, this will return null.
java.util.ListselectNodes( org.dom4j.Node, java.lang.String)Evaluates an XPath expression and returns the result as a List of Node instances or String instances depending on the XPath expression.
org.dom4j.NodeselectSingleNode( org.dom4j.Node, java.lang.String)Evaluates an XPath expression and returns the result as a single Node instance.
 


Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-3 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.