blob: 32182963f69e0ed69f1a945b656b94f865d85341 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_14) on Mon Apr 26 10:16:14 PDT 2010 -->
<TITLE>
XmlTool (VelocityTools 2.0 Documentation)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.velocity.tools.generic.XmlTool class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="XmlTool (VelocityTools 2.0 Documentation)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.NodeIterator.html" title="class in org.apache.velocity.tools.generic"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/velocity/tools/generic/XmlTool.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="XmlTool.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.velocity.tools.generic</FONT>
<BR>
Class XmlTool</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">org.apache.velocity.tools.generic.SafeConfig</A>
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.velocity.tools.generic.XmlTool</B>
</PRE>
<HR>
<DL>
<DT><PRE><FONT SIZE="-1"><A HREF="../../../../../org/apache/velocity/tools/config/DefaultKey.html" title="annotation in org.apache.velocity.tools.config">@DefaultKey</A>(<A HREF="../../../../../org/apache/velocity/tools/config/DefaultKey.html#value()">value</A>="xml")
</FONT>public class <B>XmlTool</B><DT>extends <A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</A></DL>
</PRE>
<P>
<p>Tool for reading/navigating XML files. This uses dom4j under the
covers to provide complete XPath support for traversing XML files.</p>
<p>Here's a short example:<pre>
XML file:
&lt;foo&gt;&lt;bar&gt;woogie&lt;/bar&gt;&lt;a name="test"/&gt;&lt;/foo&gt;
Template:
$foo.bar.text
$foo.find('a')
$foo.a.name
Output:
woogie
&lt;a name="test"/&gt;
test
Configuration:
&lt;tools&gt;
&lt;toolbox scope="application"&gt;
&lt;tool class="org.apache.velocity.tools.generic.XmlTool"
key="foo" file="doc.xml"/&gt;
&lt;/toolbox&gt;
&lt;/tools&gt;
</pre></p>
<p>Note that this tool is included in the default GenericTools configuration
under the key "xml", but unless you set safeMode="false" for it, you will
only be able to parse XML strings. Safe mode is on by default and blocks
access to the <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#read(java.lang.Object)"><CODE>read(Object)</CODE></A> method.</p>
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>VelocityTools 2.0</DD>
<DT><B>Version:</B></DT>
<DD>$Revision: 749731 $ $Date: 2006-11-27 10:49:37 -0800 (Mon, 27 Nov 2006) $</DD>
<DT><B>Author:</B></DT>
<DD>Nathan Bubna</DD>
</DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.NodeIterator.html" title="class in org.apache.velocity.tools.generic">XmlTool.NodeIterator</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Iterator implementation that wraps a Node list iterator
to return new XmlTool instances for each item in the wrapped
iterator.s</TD>
</TR>
</TABLE>
&nbsp;<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#FILE_KEY">FILE_KEY</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;org.apache.velocity.runtime.log.Log</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#LOG">LOG</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;java.util.List&lt;org.dom4j.Node&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#nodes">nodes</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_org.apache.velocity.tools.generic.SafeConfig"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class org.apache.velocity.tools.generic.<A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#LOCK_CONFIG_KEY">LOCK_CONFIG_KEY</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#OLD_LOCK_CONFIG_KEY">OLD_LOCK_CONFIG_KEY</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#SAFE_MODE_KEY">SAFE_MODE_KEY</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#XmlTool()">XmlTool</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#XmlTool(java.util.List)">XmlTool</A></B>(java.util.List&lt;org.dom4j.Node&gt;&nbsp;nodes)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#XmlTool(org.dom4j.Node)">XmlTool</A></B>(org.dom4j.Node&nbsp;node)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#attr(java.lang.Object)">attr</A></B>(java.lang.Object&nbsp;o)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the value of the specified attribute for the first/sole
<CODE>Node</CODE> in the internal Node list for this instance, if that
Node is an <CODE>Element</CODE>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Map&lt;java.lang.String,java.lang.String&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#attributes()">attributes</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <CODE>Map</CODE> of all attributes for the first/sole
<CODE>Node</CODE> held internally by this instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#children()">children</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> instance that wraps all the
child <CODE>Element</CODE>s of all the current internally held nodes
that are <CODE>Element</CODE>s themselves.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#configure(org.apache.velocity.tools.generic.ValueParser)">configure</A></B>(<A HREF="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic">ValueParser</A>&nbsp;parser)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Looks for the "file" parameter and automatically uses
<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#read(java.lang.String)"><CODE>read(String)</CODE></A> to parse the file and set the
resulting <CODE>Document</CODE> as the root node for this
instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#find(java.lang.Object)">find</A></B>(java.lang.Object&nbsp;o)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts the specified object to a String and calls
<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#find(java.lang.String)"><CODE>find(String)</CODE></A> with that.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#find(java.lang.String)">find</A></B>(java.lang.String&nbsp;xpath)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Performs an XPath selection on the current set of
<CODE>Node</CODE>s held by this instance and returns a new
<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> instance that wraps those results.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#get(java.lang.Number)">get</A></B>(java.lang.Number&nbsp;n)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> that wraps the specified
<CODE>Node</CODE> from this instance's internal Node list.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#get(java.lang.Object)">get</A></B>(java.lang.Object&nbsp;o)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This will first attempt to find an attribute with the
specified name and return its value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getFirst()">getFirst</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> that wraps only the
first <CODE>Node</CODE> from this instance's internal Node list.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getLast()">getLast</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> that wraps only the
last <CODE>Node</CODE> from this instance's internal Node list.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getName()">getName</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Asks <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#get(java.lang.Object)"><CODE>get(Object)</CODE></A> for a "name" result.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getNodeName()">getNodeName</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the name of the root node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getParent()">getParent</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> instance that wraps
the parent <CODE>Element</CODE> of the first/sole <CODE>Node</CODE>
being wrapped by this instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getPath()">getPath</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the XPath that identifies the first/sole <CODE>Node</CODE>
represented by this instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getText()">getText</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the concatenated text content of all the internally held
nodes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#isEmpty()">isEmpty</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if there are no <CODE>Node</CODE>s internally held
by this instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Iterator&lt;<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#iterator()">iterator</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.NodeIterator.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool.NodeIterator</CODE></A> that returns new <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A>
instances for each <CODE>Node</CODE> held internally by this instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#log(java.lang.Object, java.lang.Throwable)">log</A></B>(java.lang.Object&nbsp;o,
java.lang.Throwable&nbsp;t)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;org.dom4j.Node</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#node()">node</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the first/sole <CODE>Node</CODE> from this
instance's internal Node list, if any.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#parents()">parents</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a new <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> instance that wraps
the parent <CODE>Element</CODE>s of each of the <CODE>Node</CODE>s
being wrapped by this instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#parse(java.lang.Object)">parse</A></B>(java.lang.Object&nbsp;o)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This accepts XML in form.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#parse(java.lang.String)">parse</A></B>(java.lang.String&nbsp;xml)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parses the given XML string and uses the resulting <CODE>Document</CODE>
as the root <CODE>Node</CODE>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#read(java.lang.Object)">read</A></B>(java.lang.Object&nbsp;o)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If safe mode is explicitly turned off for this tool, then
this will accept either a <CODE>URL</CODE> or the string representation
thereof.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#read(java.lang.String)">read</A></B>(java.lang.String&nbsp;file)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a <CODE>URL</CODE> from the string and passes it to <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#read(java.net.URL)"><CODE>read(URL)</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#read(java.net.URL)">read</A></B>(java.net.URL&nbsp;url)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads, parses and creates a <CODE>Document</CODE> from the
given <CODE>URL</CODE> and uses it as the root <CODE>Node</CODE> for this instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#setRoot(org.dom4j.Node)">setRoot</A></B>(org.dom4j.Node&nbsp;node)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets a singular root <CODE>Node</CODE> for this instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#size()">size</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of <CODE>Node</CODE>s internally held by this instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#toString()">toString</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If this instance has no XML <CODE>Node</CODE>s, then this
returns the result of <code>super.toString()</code>.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.velocity.tools.generic.SafeConfig"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.velocity.tools.generic.<A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#configure(java.util.Map)">configure</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#isConfigLocked()">isConfigLocked</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#isSafeMode()">isSafeMode</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#setLockConfig(boolean)">setLockConfig</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#setSafeMode(boolean)">setSafeMode</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="FILE_KEY"><!-- --></A><H3>
FILE_KEY</H3>
<PRE>
public static final java.lang.String <B>FILE_KEY</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.velocity.tools.generic.XmlTool.FILE_KEY">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="LOG"><!-- --></A><H3>
LOG</H3>
<PRE>
protected org.apache.velocity.runtime.log.Log <B>LOG</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="nodes"><!-- --></A><H3>
nodes</H3>
<PRE>
private java.util.List&lt;org.dom4j.Node&gt; <B>nodes</B></PRE>
<DL>
<DL>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="XmlTool()"><!-- --></A><H3>
XmlTool</H3>
<PRE>
public <B>XmlTool</B>()</PRE>
<DL>
</DL>
<HR>
<A NAME="XmlTool(org.dom4j.Node)"><!-- --></A><H3>
XmlTool</H3>
<PRE>
public <B>XmlTool</B>(org.dom4j.Node&nbsp;node)</PRE>
<DL>
</DL>
<HR>
<A NAME="XmlTool(java.util.List)"><!-- --></A><H3>
XmlTool</H3>
<PRE>
public <B>XmlTool</B>(java.util.List&lt;org.dom4j.Node&gt;&nbsp;nodes)</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="configure(org.apache.velocity.tools.generic.ValueParser)"><!-- --></A><H3>
configure</H3>
<PRE>
protected void <B>configure</B>(<A HREF="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic">ValueParser</A>&nbsp;parser)</PRE>
<DL>
<DD>Looks for the "file" parameter and automatically uses
<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#read(java.lang.String)"><CODE>read(String)</CODE></A> to parse the file and set the
resulting <CODE>Document</CODE> as the root node for this
instance.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#configure(org.apache.velocity.tools.generic.ValueParser)">configure</A></CODE> in class <CODE><A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setRoot(org.dom4j.Node)"><!-- --></A><H3>
setRoot</H3>
<PRE>
protected void <B>setRoot</B>(org.dom4j.Node&nbsp;node)</PRE>
<DL>
<DD>Sets a singular root <CODE>Node</CODE> for this instance.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="log(java.lang.Object, java.lang.Throwable)"><!-- --></A><H3>
log</H3>
<PRE>
private void <B>log</B>(java.lang.Object&nbsp;o,
java.lang.Throwable&nbsp;t)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="read(java.lang.String)"><!-- --></A><H3>
read</H3>
<PRE>
protected void <B>read</B>(java.lang.String&nbsp;file)
throws java.lang.Exception</PRE>
<DL>
<DD>Creates a <CODE>URL</CODE> from the string and passes it to <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#read(java.net.URL)"><CODE>read(URL)</CODE></A>.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.lang.Exception</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="read(java.net.URL)"><!-- --></A><H3>
read</H3>
<PRE>
protected void <B>read</B>(java.net.URL&nbsp;url)
throws java.lang.Exception</PRE>
<DL>
<DD>Reads, parses and creates a <CODE>Document</CODE> from the
given <CODE>URL</CODE> and uses it as the root <CODE>Node</CODE> for this instance.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.lang.Exception</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="parse(java.lang.String)"><!-- --></A><H3>
parse</H3>
<PRE>
protected void <B>parse</B>(java.lang.String&nbsp;xml)
throws java.lang.Exception</PRE>
<DL>
<DD>Parses the given XML string and uses the resulting <CODE>Document</CODE>
as the root <CODE>Node</CODE>.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.lang.Exception</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="read(java.lang.Object)"><!-- --></A><H3>
read</H3>
<PRE>
public <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A> <B>read</B>(java.lang.Object&nbsp;o)</PRE>
<DL>
<DD>If safe mode is explicitly turned off for this tool, then
this will accept either a <CODE>URL</CODE> or the string representation
thereof. If valid, it will return a new <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> instance
with that document as the root <CODE>Node</CODE>. If reading the URL
or parsing its content fails or if safe mode is on (the default),
this will return <code>null</code>.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="parse(java.lang.Object)"><!-- --></A><H3>
parse</H3>
<PRE>
public <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A> <B>parse</B>(java.lang.Object&nbsp;o)</PRE>
<DL>
<DD>This accepts XML in form. If the XML is valid, it will return a
new <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> instance with the resulting XML document
as the root <CODE>Node</CODE>. If parsing the content fails,
this will return <code>null</code>.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="get(java.lang.Object)"><!-- --></A><H3>
get</H3>
<PRE>
public java.lang.Object <B>get</B>(java.lang.Object&nbsp;o)</PRE>
<DL>
<DD>This will first attempt to find an attribute with the
specified name and return its value. If no such attribute
exists or its value is <code>null</code>, this will attempt to convert
the given value to a <CODE>Number</CODE> and get the result of
<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#get(java.lang.Number)"><CODE>get(Number)</CODE></A>. If the number conversion fails,
then this will convert the object to a string. If that string
does not contain a '/', it appends the result of <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getPath()"><CODE>getPath()</CODE></A>
and a '/' to the front of it. Finally, it delegates the string to the
<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#find(java.lang.String)"><CODE>find(String)</CODE></A> method and returns the result of that.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getName()"><!-- --></A><H3>
getName</H3>
<PRE>
public java.lang.Object <B>getName</B>()</PRE>
<DL>
<DD>Asks <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#get(java.lang.Object)"><CODE>get(Object)</CODE></A> for a "name" result.
If none, this will return the result of <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#getNodeName()"><CODE>getNodeName()</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getNodeName()"><!-- --></A><H3>
getNodeName</H3>
<PRE>
public java.lang.String <B>getNodeName</B>()</PRE>
<DL>
<DD>Returns the name of the root node. If the internal <CODE>Node</CODE>
list has more than one <CODE>Node</CODE>, it will only return the name
of the first node in the list.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getPath()"><!-- --></A><H3>
getPath</H3>
<PRE>
public java.lang.String <B>getPath</B>()</PRE>
<DL>
<DD>Returns the XPath that identifies the first/sole <CODE>Node</CODE>
represented by this instance.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="attr(java.lang.Object)"><!-- --></A><H3>
attr</H3>
<PRE>
public java.lang.String <B>attr</B>(java.lang.Object&nbsp;o)</PRE>
<DL>
<DD>Returns the value of the specified attribute for the first/sole
<CODE>Node</CODE> in the internal Node list for this instance, if that
Node is an <CODE>Element</CODE>. If it is a non-Element node type or
there is no value for that attribute in this element, then this
will return <code>null</code>.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="attributes()"><!-- --></A><H3>
attributes</H3>
<PRE>
public java.util.Map&lt;java.lang.String,java.lang.String&gt; <B>attributes</B>()</PRE>
<DL>
<DD>Returns a <CODE>Map</CODE> of all attributes for the first/sole
<CODE>Node</CODE> held internally by this instance. If that Node is
not an <CODE>Element</CODE>, this will return null.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="isEmpty()"><!-- --></A><H3>
isEmpty</H3>
<PRE>
public boolean <B>isEmpty</B>()</PRE>
<DL>
<DD>Returns <code>true</code> if there are no <CODE>Node</CODE>s internally held
by this instance.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="size()"><!-- --></A><H3>
size</H3>
<PRE>
public int <B>size</B>()</PRE>
<DL>
<DD>Returns the number of <CODE>Node</CODE>s internally held by this instance.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="iterator()"><!-- --></A><H3>
iterator</H3>
<PRE>
public java.util.Iterator&lt;<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A>&gt; <B>iterator</B>()</PRE>
<DL>
<DD>Returns an <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.NodeIterator.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool.NodeIterator</CODE></A> that returns new <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A>
instances for each <CODE>Node</CODE> held internally by this instance.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getFirst()"><!-- --></A><H3>
getFirst</H3>
<PRE>
public <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A> <B>getFirst</B>()</PRE>
<DL>
<DD>Returns an <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> that wraps only the
first <CODE>Node</CODE> from this instance's internal Node list.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getLast()"><!-- --></A><H3>
getLast</H3>
<PRE>
public <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A> <B>getLast</B>()</PRE>
<DL>
<DD>Returns an <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> that wraps only the
last <CODE>Node</CODE> from this instance's internal Node list.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="get(java.lang.Number)"><!-- --></A><H3>
get</H3>
<PRE>
public <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A> <B>get</B>(java.lang.Number&nbsp;n)</PRE>
<DL>
<DD>Returns an <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> that wraps the specified
<CODE>Node</CODE> from this instance's internal Node list.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="node()"><!-- --></A><H3>
node</H3>
<PRE>
public org.dom4j.Node <B>node</B>()</PRE>
<DL>
<DD>Returns the first/sole <CODE>Node</CODE> from this
instance's internal Node list, if any.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="find(java.lang.Object)"><!-- --></A><H3>
find</H3>
<PRE>
public <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A> <B>find</B>(java.lang.Object&nbsp;o)</PRE>
<DL>
<DD>Converts the specified object to a String and calls
<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html#find(java.lang.String)"><CODE>find(String)</CODE></A> with that.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="find(java.lang.String)"><!-- --></A><H3>
find</H3>
<PRE>
public <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A> <B>find</B>(java.lang.String&nbsp;xpath)</PRE>
<DL>
<DD>Performs an XPath selection on the current set of
<CODE>Node</CODE>s held by this instance and returns a new
<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> instance that wraps those results.
If the specified value is null or this instance does
not currently hold any nodes, then this will return
<code>null</code>. If the specified value, when converted
to a string, does not contain a '/' character, then
it has "//" prepended to it. This means that a call to
<code>$xml.find("a")</code> is equivalent to calling
<code>$xml.find("//a")</code>. The full range of XPath
selectors is supported here.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getParent()"><!-- --></A><H3>
getParent</H3>
<PRE>
public <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A> <B>getParent</B>()</PRE>
<DL>
<DD>Returns a new <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> instance that wraps
the parent <CODE>Element</CODE> of the first/sole <CODE>Node</CODE>
being wrapped by this instance.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="parents()"><!-- --></A><H3>
parents</H3>
<PRE>
public <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A> <B>parents</B>()</PRE>
<DL>
<DD>Returns a new <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> instance that wraps
the parent <CODE>Element</CODE>s of each of the <CODE>Node</CODE>s
being wrapped by this instance. This does not return
all ancestors, just the immediate parents.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="children()"><!-- --></A><H3>
children</H3>
<PRE>
public <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic">XmlTool</A> <B>children</B>()</PRE>
<DL>
<DD>Returns a new <A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.html" title="class in org.apache.velocity.tools.generic"><CODE>XmlTool</CODE></A> instance that wraps all the
child <CODE>Element</CODE>s of all the current internally held nodes
that are <CODE>Element</CODE>s themselves.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getText()"><!-- --></A><H3>
getText</H3>
<PRE>
public java.lang.String <B>getText</B>()</PRE>
<DL>
<DD>Returns the concatenated text content of all the internally held
nodes. Obviously, this is most useful when only one node is held.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public java.lang.String <B>toString</B>()</PRE>
<DL>
<DD>If this instance has no XML <CODE>Node</CODE>s, then this
returns the result of <code>super.toString()</code>. Otherwise, it
returns the XML (as a string) of all the internally held nodes
that are not <CODE>Attribute</CODE>s. For attributes, only the value
is used.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/XmlTool.NodeIterator.html" title="class in org.apache.velocity.tools.generic"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/velocity/tools/generic/XmlTool.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="XmlTool.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright (c) 2003-2007 Apache Software Foundation
</BODY>
</HTML>