The FileSaxIterator class provides a SAX iterator for file-based XML data based on libxml2
More...
|
| constructor (string path, string element_name, *string encoding) |
| creates a new FileSaxIterator object from the file name and the element name passed More...
|
|
| constructor (string path, string element_name, hash opts) |
| 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...
|
|
| constructor (string xml, string element_name, *hash opts) |
| 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...
|
|
auto | 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...
|
|
The FileSaxIterator class provides a SAX iterator for file-based XML data based on libxml2
◆ constructor() [1/2]
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
-
path | the path to a file containing the XML data to iterate |
element_name | the name of the element to iterate through |
encoding | an optional encoding for the file; if not given, then any encoding given in the file's XML preamble is used |
- Example:
FileSaxIterator i(path, "DetailRecord");
map printf("record %d: %y\n", $#, $1), i;
- Exceptions
-
XMLDOC-CONSTRUCTOR-ERROR | error parsing XML string |
◆ constructor() [2/2]
Qore::Xml::FileSaxIterator::constructor |
( |
string |
path, |
|
|
string |
element_name, |
|
|
hash |
opts |
|
) |
| |
creates a new FileSaxIterator object from the file name and the element name passed
- Restrictions:
- Qore::PO_NO_FILESYSTEM
- Parameters
-
path | the path to a file containing the XML data to iterate |
element_name | the name of the element to iterate through |
opts | the following options are accepted:
|
- Example:
FileSaxIterator i(path, "DetailRecord");
map printf("record %d: %y\n", $#, $1), i;
- Exceptions
-
XML-READER-ERROR | error opening file |
FILESAXITERATOR-OPTION-ERROR | error in option hash |
- Since
- xml 1.4
◆ copy()
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:
FileSaxIterator
copy = i.copy();
The documentation for this class was generated from the following file:
- /tmp/module-xml/src/QC_FileSaxIterator.dox.h