Qore XML Module  1.5
Qore::Xml::InputStreamSaxIterator Class Reference

The InputStreamSaxIterator class provides a SAX iterator for input streams based on libxml2 More...

Inheritance diagram for Qore::Xml::InputStreamSaxIterator:
Qore::Xml::SaxIterator

Public Member Methods

 constructor (Qore::InputStream is, string element_name, *string encoding)
 creates a new InputStreamSaxIterator object from the input stream and the element name passed More...
 
 constructor (Qore::InputStream is, string element_name, hash opts)
 creates a new InputStreamSaxIterator object from the input stream and the element name passed More...
 
 copy ()
 Throws an exception; objects of this class cannot be copied. More...
 
- Public Member Methods inherited from Qore::Xml::SaxIterator
 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...
 

Detailed Description

The InputStreamSaxIterator class provides a SAX iterator for input streams based on libxml2

Member Function Documentation

◆ constructor() [1/2]

Qore::Xml::InputStreamSaxIterator::constructor ( Qore::InputStream  is,
string  element_name,
*string  encoding 
)

creates a new InputStreamSaxIterator object from the input stream and the element name passed

Restrictions:
Qore::PO_NO_FILESYSTEM
Parameters
isthe input stream
element_namethe name of the element to iterate through
encodingan optional encoding of the input stream; if not given, then any encoding given in the file's XML preamble is used
Example:
InputStreamSaxIterator i(is, "DetailRecord");
map printf("record %d: %y\n", $#, $1), i;
Exceptions
XMLDOC-CONSTRUCTOR-ERRORerror parsing XML string

◆ constructor() [2/2]

Qore::Xml::InputStreamSaxIterator::constructor ( Qore::InputStream  is,
string  element_name,
hash  opts 
)

creates a new InputStreamSaxIterator object from the input stream and the element name passed

Restrictions:
Qore::PO_NO_FILESYSTEM
Parameters
isthe input stream
element_namethe name of the element to iterate through
optsthe following options are accepted:
Example:
InputStreamSaxIterator i(is, "DetailRecord");
map printf("record %d: %y\n", $#, $1), i;
Exceptions
INPUTSTREAMSAXITERATOR-OPTION-ERRORerror in option hash
XMLDOC-CONSTRUCTOR-ERRORerror parsing XML string
Since
xml 1.4

◆ copy()

Qore::Xml::InputStreamSaxIterator::copy ( )

Throws an exception; objects of this class cannot be copied.

Exceptions
INPUTSTREAMSAXITERATOR-COPY-ERRORobjects of this class cannot be copied

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