blob: 60d911c39d0c8aa0ad6b3ac85c397460893acac6 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_281) on Sun Jan 15 15:58:35 CET 2023 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>NodeListModel (FreeMarker 2.3.32 API)</title>
<meta name="date" content="2023-01-15">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="NodeListModel (FreeMarker 2.3.32 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":42,"i1":42,"i2":42,"i3":42,"i4":42,"i5":42,"i6":42,"i7":42,"i8":42,"i9":42,"i10":42,"i11":42};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/NodeListModel.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?freemarker/ext/xml/NodeListModel.html" target="_top">Frames</a></li>
<li><a href="NodeListModel.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">freemarker.ext.xml</div>
<h2 title="Class NodeListModel" class="title">Class NodeListModel</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>freemarker.ext.xml.NodeListModel</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../freemarker/template/TemplateHashModel.html" title="interface in freemarker.template">TemplateHashModel</a>, <a href="../../../freemarker/template/TemplateMethodModel.html" title="interface in freemarker.template">TemplateMethodModel</a>, <a href="../../../freemarker/template/TemplateModel.html" title="interface in freemarker.template">TemplateModel</a>, <a href="../../../freemarker/template/TemplateNodeModel.html" title="interface in freemarker.template">TemplateNodeModel</a>, <a href="../../../freemarker/template/TemplateScalarModel.html" title="interface in freemarker.template">TemplateScalarModel</a>, <a href="../../../freemarker/template/TemplateSequenceModel.html" title="interface in freemarker.template">TemplateSequenceModel</a></dd>
</dl>
<hr>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">Use <a href="../../../freemarker/ext/dom/NodeModel.html" title="class in freemarker.ext.dom"><code>NodeModel</code></a> instead.</span></div>
</div>
<br>
<pre>@Deprecated
public class <span class="typeNameLabel">NodeListModel</span>
extends java.lang.Object
implements <a href="../../../freemarker/template/TemplateHashModel.html" title="interface in freemarker.template">TemplateHashModel</a>, <a href="../../../freemarker/template/TemplateMethodModel.html" title="interface in freemarker.template">TemplateMethodModel</a>, <a href="../../../freemarker/template/TemplateScalarModel.html" title="interface in freemarker.template">TemplateScalarModel</a>, <a href="../../../freemarker/template/TemplateSequenceModel.html" title="interface in freemarker.template">TemplateSequenceModel</a>, <a href="../../../freemarker/template/TemplateNodeModel.html" title="interface in freemarker.template">TemplateNodeModel</a></pre>
<div class="block"><p>A data model adapter for three widespread XML document object model
representations: W3C DOM, dom4j, and JDOM. The adapter automatically
recognizes the used XML object model and provides a unified interface for it
toward the template. The model provides access to all XML InfoSet features
of the XML document and includes XPath support if it has access to the XPath-
evaluator library Jaxen. The model's philosophy (which closely follows that
of XML InfoSet and XPath) is as follows: it always wraps a list of XML nodes
(the "nodelist"). The list can be empty, can have a single element, or can
have multiple elements. Every operation applied to the model is applied to
all nodes in its nodelist. You usually start with a single- element nodelist,
usually the root element node or the document node of the XML tree.
Additionally, the nodes can contain String objects as a result of certain
evaluations (getting the names of elements, values of attributes, etc.)</p>
<p><strong>Implementation note:</strong> If you are using W3C DOM documents
built by the Crimson XML parser (or you are using the built-in JDK 1.4 XML
parser, which is essentially Crimson), make sure you call
<tt>setNamespaceAware(true)</tt> on the
<tt>javax.xml.parsers.DocumentBuilderFactory</tt> instance used for document
building even when your documents don't use XML namespaces. Failing to do so,
you will experience incorrect behavior when using the documents wrapped with
this model.</p></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.freemarker.template.TemplateScalarModel">
<!-- -->
</a>
<h3>Fields inherited from interface&nbsp;freemarker.template.<a href="../../../freemarker/template/TemplateScalarModel.html" title="interface in freemarker.template">TemplateScalarModel</a></h3>
<code><a href="../../../freemarker/template/TemplateScalarModel.html#EMPTY_STRING">EMPTY_STRING</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.freemarker.template.TemplateModel">
<!-- -->
</a>
<h3>Fields inherited from interface&nbsp;freemarker.template.<a href="../../../freemarker/template/TemplateModel.html" title="interface in freemarker.template">TemplateModel</a></h3>
<code><a href="../../../freemarker/template/TemplateModel.html#NOTHING">NOTHING</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../freemarker/ext/xml/NodeListModel.html#NodeListModel-java.lang.Object-">NodeListModel</a></span>(java.lang.Object&nbsp;nodes)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Creates a new NodeListModel, wrapping the passed nodes.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/xml/NodeListModel.html#exec-java.util.List-">exec</a></span>(java.util.List&nbsp;arguments)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Evaluates an XPath expression on XML nodes in this model.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../freemarker/template/TemplateModel.html" title="interface in freemarker.template">TemplateModel</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/xml/NodeListModel.html#get-int-">get</a></span>(int&nbsp;index)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Selects a single node from this model's nodelist by its list index and
returns a new NodeListModel containing that single node.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../freemarker/template/TemplateModel.html" title="interface in freemarker.template">TemplateModel</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/xml/NodeListModel.html#get-java.lang.String-">get</a></span>(java.lang.String&nbsp;key)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Returns a new NodeListModel containing the nodes that result from applying
an operator to this model's nodes.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/xml/NodeListModel.html#getAsString--">getAsString</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Returns the string representation of the wrapped nodes.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../freemarker/template/TemplateSequenceModel.html" title="interface in freemarker.template">TemplateSequenceModel</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/xml/NodeListModel.html#getChildNodes--">getChildNodes</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/xml/NodeListModel.html#getNodeName--">getNodeName</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/xml/NodeListModel.html#getNodeNamespace--">getNodeNamespace</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/xml/NodeListModel.html#getNodeType--">getNodeType</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
&nbsp;</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../../../freemarker/template/TemplateNodeModel.html" title="interface in freemarker.template">TemplateNodeModel</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/xml/NodeListModel.html#getParentNode--">getParentNode</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
&nbsp;</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/xml/NodeListModel.html#isEmpty--">isEmpty</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Returns true if this NodeListModel contains no nodes.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/xml/NodeListModel.html#registerNamespace-java.lang.String-java.lang.String-">registerNamespace</a></span>(java.lang.String&nbsp;prefix,
java.lang.String&nbsp;uri)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Registers a namespace prefix-URI pair for subsequent use in <a href="../../../freemarker/ext/xml/NodeListModel.html#get-java.lang.String-"><code>get(String)</code></a> as well as for use in XPath expressions.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../freemarker/ext/xml/NodeListModel.html#size--">size</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Returns the number of nodes in this model's nodelist.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="NodeListModel-java.lang.Object-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>NodeListModel</h4>
<pre>public&nbsp;NodeListModel(java.lang.Object&nbsp;nodes)</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Creates a new NodeListModel, wrapping the passed nodes.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>nodes</code> - you can pass it a single XML node from any supported
document model, or a Java collection containing any number of nodes.
Passing null is prohibited. To create an empty model, pass it an empty
collection. If a collection is passed, all passed nodes must belong to
the same XML object model, i.e. you can't mix JDOM and dom4j in a single
instance of NodeListModel. The model itself doesn't check for this condition,
as it can be time consuming, but will throw spurious
<code>ClassCastException</code>s when it encounters mixed objects.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if you pass null</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="size--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>size</h4>
<pre>public&nbsp;int&nbsp;size()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Returns the number of nodes in this model's nodelist.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateSequenceModel.html#size--">size</a></code>&nbsp;in interface&nbsp;<code><a href="../../../freemarker/template/TemplateSequenceModel.html" title="interface in freemarker.template">TemplateSequenceModel</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of items in the list.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../freemarker/template/TemplateSequenceModel.html#size--"><code>TemplateSequenceModel.size()</code></a></dd>
</dl>
</li>
</ul>
<a name="exec-java.util.List-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exec</h4>
<pre>public&nbsp;java.lang.Object&nbsp;exec(java.util.List&nbsp;arguments)
throws <a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Evaluates an XPath expression on XML nodes in this model.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateMethodModel.html#exec-java.util.List-">exec</a></code>&nbsp;in interface&nbsp;<code><a href="../../../freemarker/template/TemplateMethodModel.html" title="interface in freemarker.template">TemplateMethodModel</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>arguments</code> - the arguments to the method invocation. Expectes exactly
one argument - the XPath expression.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new NodeListModel with nodes selected by applying the XPath
expression to this model's nodelist.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../freemarker/template/TemplateMethodModel.html#exec-java.util.List-"><code>TemplateMethodModel.exec(List)</code></a></dd>
</dl>
</li>
</ul>
<a name="getAsString--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAsString</h4>
<pre>public&nbsp;java.lang.String&nbsp;getAsString()
throws <a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Returns the string representation of the wrapped nodes. String objects in
the nodelist are rendered as-is (with no XML escaping applied). All other
nodes are rendered in the default XML serialization format ("plain XML").
This makes the model quite suited for use as an XML-transformation tool.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateScalarModel.html#getAsString--">getAsString</a></code>&nbsp;in interface&nbsp;<code><a href="../../../freemarker/template/TemplateScalarModel.html" title="interface in freemarker.template">TemplateScalarModel</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the string representation of the wrapped nodes. String objects
in the nodelist are rendered as-is (with no XML escaping applied). All
other nodes are rendered in the default XML serialization format ("plain
XML").</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../freemarker/template/TemplateScalarModel.html#getAsString--"><code>TemplateScalarModel.getAsString()</code></a></dd>
</dl>
</li>
</ul>
<a name="get-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre>public&nbsp;<a href="../../../freemarker/template/TemplateModel.html" title="interface in freemarker.template">TemplateModel</a>&nbsp;get(int&nbsp;index)</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Selects a single node from this model's nodelist by its list index and
returns a new NodeListModel containing that single node.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateSequenceModel.html#get-int-">get</a></code>&nbsp;in interface&nbsp;<code><a href="../../../freemarker/template/TemplateSequenceModel.html" title="interface in freemarker.template">TemplateSequenceModel</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - the ordinal number of the selected node</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the item at the specified index, or <code>null</code> if the index is out of bounds. Note that a
<code>null</code> value is interpreted by FreeMarker as "variable does not exist", and accessing a
missing variables is usually considered as an error in the FreeMarker Template Language, so the usage of
a bad index will not remain hidden, unless the default value for that case was also specified in the
template.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../freemarker/template/TemplateSequenceModel.html#get-int-"><code>TemplateSequenceModel.get(int)</code></a></dd>
</dl>
</li>
</ul>
<a name="get-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre>public&nbsp;<a href="../../../freemarker/template/TemplateModel.html" title="interface in freemarker.template">TemplateModel</a>&nbsp;get(java.lang.String&nbsp;key)
throws <a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Returns a new NodeListModel containing the nodes that result from applying
an operator to this model's nodes.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateHashModel.html#get-java.lang.String-">get</a></code>&nbsp;in interface&nbsp;<code><a href="../../../freemarker/template/TemplateHashModel.html" title="interface in freemarker.template">TemplateHashModel</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - the operator to apply to nodes. Available operators are:
<table style="width: auto; border-collapse: collapse" border="1" summary="XML node hash keys">
<thead>
<tr>
<th align="left">Key name</th>
<th align="left">Evaluates to</th>
</tr>
</thead>
<tbody>
<tr>
<td><tt>*</tt> or <tt>_children</tt></td>
<td>all direct element children of current nodes (non-recursive).
Applicable to element and document nodes.</td>
</tr>
<tr>
<td><tt>@*</tt> or <tt>_attributes</tt></td>
<td>all attributes of current nodes. Applicable to elements only.
</td>
</tr>
<tr>
<td><tt>@<i>attributeName</i></tt></td>
<td>named attributes of current nodes. Applicable to elements,
doctypes and processing instructions. On doctypes it supports
attributes <tt>publicId</tt>, <tt>systemId</tt> and
<tt>elementName</tt>. On processing instructions, it supports
attributes <tt>target</tt> and <tt>data</tt>, as well as any
other attribute name specified in data as
<tt>name=&quot;value&quot;</tt> pair on dom4j or JDOM models.
The attribute nodes for doctype and processing instruction are
synthetic, and as such have no parent. Note, however that
<tt>@*</tt> does NOT operate on doctypes or processing
instructions.</td>
</tr>
<tr>
<td><tt>_ancestor</tt></td>
<td>all ancestors up to root element (recursive) of current nodes.
Applicable to same node types as <tt>_parent</tt>.</td>
</tr>
<tr>
<td><tt>_ancestorOrSelf</tt></td>
<td>all ancestors of current nodes plus current nodes. Applicable
to same node types as <tt>_parent</tt>.</td>
</tr>
<tr>
<td><tt>_content</tt></td>
<td>the complete content of current nodes, including children
elements, text, entity references, and processing instructions
(non-recursive). Applicable to elements and documents.</td>
</tr>
<tr>
<td><tt>_descendant</tt></td>
<td>all recursive descendant element children of current nodes.
Applicable to document and element nodes.</td>
</tr>
<tr>
<td><tt>_descendantOrSelf</tt></td>
<td>all recursive descendant element children of current nodes
plus current nodes. Applicable to document and element nodes.
</td>
</tr>
<tr>
<td><tt>_document</tt></td>
<td>all documents the current nodes belong to. Applicable to all
nodes except text.</td>
</tr>
<tr>
<td><tt>_doctype</tt></td>
<td>doctypes of the current nodes. Applicable to document nodes
only.</td>
</tr>
<tr>
<td><tt>_filterType</tt></td>
<td>is a filter-by-type template method model. When called, it
will yield a node list that contains only those current nodes
whose type matches one of types passed as argument. You can pass
as many string arguments as you want, each representing one of
the types to select: &quot;attribute&quot;, &quot;cdata&quot;,
&quot;comment&quot;, &quot;document&quot;,
&quot;documentType&quot;, &quot;element&quot;,
&quot;entity&quot;, &quot;entityReference&quot;,
&quot;namespace&quot;, &quot;processingInstruction&quot;, or
&quot;text&quot;.</td>
</tr>
<tr>
<td><tt>_name</tt></td>
<td>the names of current nodes, one string per node
(non-recursive). Applicable to elements and attributes
(returns their local names), entity references, processing
instructions (returns its target), doctypes (returns its public
ID)</td>
</tr>
<tr>
<td><tt>_nsprefix</tt></td>
<td>the namespace prefixes of current nodes, one string per node
(non-recursive). Applicable to elements and attributes</td>
</tr>
<tr>
<td><tt>_nsuri</tt></td>
<td>the namespace URIs of current nodes, one string per node
(non-recursive). Applicable to elements and attributes</td>
</tr>
<tr>
<td><tt>_parent</tt></td>
<td>parent elements of current nodes. Applicable to element,
attribute, comment, entity, processing instruction.</td>
</tr>
<tr>
<td><tt>_qname</tt></td>
<td>the qualified names of current nodes in
<tt>[namespacePrefix:]localName</tt> form, one string per node
(non-recursive). Applicable to elements and attributes</td>
</tr>
<tr>
<td><tt>_registerNamespace(prefix, uri)</tt></td>
<td>register a XML namespace with the specified prefix and URI for
the current node list and all node lists that are derived from
the current node list. After registering, you can use the
<tt>nodelist[&quot;prefix:localname&quot;]</tt>, or
<tt>nodelist[&quot;@prefix:localname&quot;]</tt> syntax
(or <tt>nodelist.prefix\:localname</tt>, or <tt>nodelist.@prefix\:localname</tt>)
to reach elements, and attributes whose names are namespace-scoped.
Note that the namespace prefix need not match the actual prefix
used by the XML document itself since namespaces are compared
solely by their URI. Also note that if you do <code>doc.elem1._registerNamespace(...)</code>,
and then later you use <code>doc.elem1</code> again, it will not have the prefix registered,
because each time you use <code>doc.elem1</code>, it gives a completely new object. In this
example, you certainly should have used <code>doc._registerNamespace(...)</code>.
</tr>
<tr>
<td><tt>_text</tt></td>
<td>the text of current nodes, one string per node
(non-recursive). Applicable to elements, attributes, comments,
processing instructions (returns its data) and CDATA sections.
The reserved XML characters ('&lt;' and '&amp;') are NOT
escaped.</td>
</tr>
<tr>
<td><tt>_type</tt></td>
<td>Returns a string describing the type of nodes, one
string per node. The returned values are &quot;attribute&quot;,
&quot;cdata&quot;, &quot;comment&quot;, &quot;document&quot;,
&quot;documentType&quot;, &quot;element&quot;,
&quot;entity&quot;, &quot;entityReference&quot;,
&quot;namespace&quot;, &quot;processingInstruction&quot;,
&quot;text&quot;, or &quot;unknown&quot;.</td>
</tr>
<tr>
<td><tt>_unique</tt></td>
<td>a copy of the current nodes that keeps only the first
occurrence of every node, eliminating duplicates. Duplicates can
occur in the node list by applying uptree-traversals
<tt>_parent</tt>, <tt>_ancestor</tt>, <tt>_ancestorOrSelf</tt>,
and <tt>_document</tt> on a node list with multiple elements.
I.e. <tt>foo._children._parent</tt> will return a node list that
has duplicates of nodes in foo - each node will have the number
of occurrences equal to the number of its children. In these
cases, use <tt>foo._children._parent._unique</tt> to eliminate
duplicates. Applicable to all node types.</td>
</tr>
<tr>
<td>any other key</td>
<td>element children of current nodes with name matching the key.
This allows for convenience child traversal in
<tt>book.chapter.title</tt> style syntax. Applicable to document
and element nodes.</td>
</tr>
</tbody>
</table></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new NodeListModel containing the nodes that result from applying
the operator to this model's nodes.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../freemarker/template/TemplateHashModel.html#get-java.lang.String-"><code>TemplateHashModel.get(String)</code></a></dd>
</dl>
</li>
</ul>
<a name="isEmpty--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEmpty</h4>
<pre>public&nbsp;boolean&nbsp;isEmpty()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Returns true if this NodeListModel contains no nodes.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateHashModel.html#isEmpty--">isEmpty</a></code>&nbsp;in interface&nbsp;<code><a href="../../../freemarker/template/TemplateHashModel.html" title="interface in freemarker.template">TemplateHashModel</a></code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../freemarker/template/TemplateHashModel.html#isEmpty--"><code>TemplateHashModel.isEmpty()</code></a></dd>
</dl>
</li>
</ul>
<a name="registerNamespace-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>registerNamespace</h4>
<pre>public&nbsp;void&nbsp;registerNamespace(java.lang.String&nbsp;prefix,
java.lang.String&nbsp;uri)</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Registers a namespace prefix-URI pair for subsequent use in <a href="../../../freemarker/ext/xml/NodeListModel.html#get-java.lang.String-"><code>get(String)</code></a> as well as for use in XPath expressions.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>prefix</code> - the namespace prefix to use for the namespace</dd>
<dd><code>uri</code> - the namespace URI that identifies the namespace.</dd>
</dl>
</li>
</ul>
<a name="getChildNodes--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getChildNodes</h4>
<pre>public&nbsp;<a href="../../../freemarker/template/TemplateSequenceModel.html" title="interface in freemarker.template">TemplateSequenceModel</a>&nbsp;getChildNodes()
throws <a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateNodeModel.html#getChildNodes--">getChildNodes</a></code>&nbsp;in interface&nbsp;<code><a href="../../../freemarker/template/TemplateNodeModel.html" title="interface in freemarker.template">TemplateNodeModel</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a sequence containing this node's children.
If the returned value is null or empty, this is essentially
a leaf node.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></code></dd>
</dl>
</li>
</ul>
<a name="getNodeName--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNodeName</h4>
<pre>public&nbsp;java.lang.String&nbsp;getNodeName()
throws <a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateNodeModel.html#getNodeName--">getNodeName</a></code>&nbsp;in interface&nbsp;<code><a href="../../../freemarker/template/TemplateNodeModel.html" title="interface in freemarker.template">TemplateNodeModel</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a String that is used to determine the processing
routine to use. In the XML implementation, if the node
is an element, it returns the element's tag name. If it
is an attribute, it returns the attribute's name. It
returns "@text" for text nodes, "@pi" for processing instructions,
and so on.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></code></dd>
</dl>
</li>
</ul>
<a name="getNodeNamespace--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNodeNamespace</h4>
<pre>public&nbsp;java.lang.String&nbsp;getNodeNamespace()
throws <a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateNodeModel.html#getNodeNamespace--">getNodeNamespace</a></code>&nbsp;in interface&nbsp;<code><a href="../../../freemarker/template/TemplateNodeModel.html" title="interface in freemarker.template">TemplateNodeModel</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the XML namespace URI with which this node is
associated. If this TemplateNodeModel implementation is
not XML-related, it will almost certainly be null. Even
for XML nodes, this will often be null.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></code></dd>
</dl>
</li>
</ul>
<a name="getNodeType--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNodeType</h4>
<pre>public&nbsp;java.lang.String&nbsp;getNodeType()
throws <a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateNodeModel.html#getNodeType--">getNodeType</a></code>&nbsp;in interface&nbsp;<code><a href="../../../freemarker/template/TemplateNodeModel.html" title="interface in freemarker.template">TemplateNodeModel</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a String describing the <em>type</em> of node this is.
In the W3C DOM, this should be "element", "text", "attribute", etc.
A TemplateNodeModel implementation that models other kinds of
trees could return whatever it appropriate for that application. It
can be null, if you don't want to use node-types.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></code></dd>
</dl>
</li>
</ul>
<a name="getParentNode--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getParentNode</h4>
<pre>public&nbsp;<a href="../../../freemarker/template/TemplateNodeModel.html" title="interface in freemarker.template">TemplateNodeModel</a>&nbsp;getParentNode()
throws <a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateNodeModel.html#getParentNode--">getParentNode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../freemarker/template/TemplateNodeModel.html" title="interface in freemarker.template">TemplateNodeModel</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the parent of this node or null, in which case
this node is the root of the tree.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../freemarker/template/TemplateModelException.html" title="class in freemarker.template">TemplateModelException</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/NodeListModel.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?freemarker/ext/xml/NodeListModel.html" target="_top">Frames</a></li>
<li><a href="NodeListModel.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>