Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  XML::COMPILE::ITERATOR (3)

.ds Aq ’


XML::Compile::Iterator - reduce view on a node tree




It would have been nice to be able to use XML::LibXML::Iterator, but on the moment of this writing, that module is not maintained. Besides, this implementation of the iterator is more specific for our purpose. The main user for this object currently is XML::Compile::Translate.



$obj-><B>descendB>( [$node, [$path, [$filter]]] ) The $node is a child of the node handled by the iterator where this method is called upon. Without explicit $node, the current node is used. Returned is a new XML::Compile::Iterator object. The new iterator will use the same $filter as the parent iterator by default. The internal administered path with be extended with the $path.
XML::Compile::Iterator-><B>newB>($node, $path, $filter,) The $node is a XML::LibXML::Node object, of which the direct children are inspected.

The $filter a CODE reference which is called for each child node. The only parameter is the parent $node, and then it must return either true or false. In case of true, the node is selected. The FILTERS is applied to all children of the $node once, when the first child is requested by the program.


$obj-><B>filterB>() Returns the CODE reference which is used to select the nodes.
$obj-><B>nodeB>() Returns the XML::LibXML::Node node of which the children are walked through.
$obj-><B>pathB>() The path represents the location where the node is, like a symbolic link, how you got there.


$obj-><B>childsB>() Returns the child nodes which fulfil the filter requirements. In LIST context as list, in SCALAR context as reference to an ARRAY.
$obj-><B>currentChildB>() Returns the current child node.
$obj-><B>firstChildB>() Returns the first child node. Does not change the current position.
$obj-><B>lastChildB>() Returns the last child node which fulfills the requirements. Does not change the current position.
$obj-><B>nextChildB>() Returns the next child when available, otherwise undef.
$obj-><B>nrChildrenB>() Returns the number of childnodes which fulfill the restriction.
$obj-><B>previousChildB>() Returns the previous child when available, otherwise undef.

    simplify XML node access

$obj-><B>currentContentB>() Returns the textContent of the currentChild() node, or undef.
$obj-><B>currentLocalB>() Returns the local name of the currentChild(), or the empty string.
$obj-><B>currentTypeB>() Returns the type of the currentChild(), or the empty string.
$obj-><B>nodeLocalB>() Returns the local name of the node(), or the empty string.
$obj-><B>nodeNilB>() Returns true if the current node has xsi:type="true".
$obj-><B>nodeTypeB>() Returns the type of the node(), or the empty string.
$obj-><B>textContentB>() Returns the textContent of the node(), or undef.


This module is part of XML-Compile distribution version 1.52, built on January 15, 2016. Website:

Other distributions in this suite: XML::Compile, XML::Compile::SOAP, XML::Compile::WSDL11, XML::Compile::SOAP12, XML::Compile::SOAP::Daemon, XML::Compile::SOAP::WSA, XML::Compile::C14N, XML::Compile::WSS, XML::Compile::WSS::Signature, XML::Compile::Tester, XML::Compile::Cache, XML::Compile::Dumper, XML::Compile::RPC, XML::Rewrite and XML::LibXML::Simple.

Please post questions or ideas to the mailinglist at . For live contact with other developers, visit the #xml-compile channel on


Copyrights 2006-2016 by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See

Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 XML::COMPILE::ITERATOR (3) 2016-01-15

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.