Qore XML Module  1.3
 All Classes Namespaces Functions Variables Groups Pages
Qore::Xml::FileSaxIterator Class Reference

The FileSaxIterator class provides a SAX iterator for file-based XML data based on libxml2 More...

Inheritance diagram for Qore::Xml::FileSaxIterator:
Qore::Xml::SaxIterator

Public Member Functions

 constructor (string path, string element_name, *string encoding)
 creates a new FileSaxIterator object from the file name and the element name passed More...
 
 copy ()
 Returns a copy of the current object (the copy will be reset to the beginning of the XML string) More...
 
- Public Member Functions inherited from Qore::Xml::SaxIterator
 constructor (string xml, string element_name)
 creates a new SaxIterator object from the XML string and element name passed More...
 
 copy ()
 Returns a copy of the current object (the copy will be reset to the beginning of the XML string) More...
 
any getValue ()
 returns the current value or throws an INVALID-ITERATOR exception if the iterator is invalid More...
 
bool next ()
 Moves the current position to the next element in the XML string; returns False if there are no more elements; if the iterator is not pointing at a valid element before this call, the iterator will be positioned on the first element in the XML if the XML string contains the required element. More...
 
 reset ()
 Reset the iterator instance to its initial state. More...
 
bool valid ()
 returns True if the iterator is currently pointing at a valid element, False if not More...
 

Detailed Description

The FileSaxIterator class provides a SAX iterator for file-based XML data based on libxml2

Member Function Documentation

Qore::Xml::FileSaxIterator::constructor ( string  path,
string  element_name,
*string  encoding 
)

creates a new FileSaxIterator object from the file name and the element name passed

Restrictions:
Qore::PO_NO_FILESYSTEM
Parameters
paththe path to a file containing the XML data to iterate
element_namethe name of the element to iterate through
encodingan optional encoding for the file; if not given, then any encoding given in the file's XML preamble is used
Example:
my FileSaxIterator $i($path, "DetailRecord");
map printf("record %d: %y\n", $#, $1), $i;
Exceptions
XMLDOC-CONSTRUCTOR-ERRORerror parsing XML string
Qore::Xml::FileSaxIterator::copy ( )

Returns a copy of the current object (the copy will be reset to the beginning of the XML string)

Returns
a copy of the current object (the copy will be reset to the beginning of the XML string)
Example:
my FileSaxIterator $copy = $i.copy();

The documentation for this class was generated from the following file: