Function nextEvent
This function is part of the StAX support.
Name
nextEvent returns the next event from an XMLEventReaderSynopsis
nextEvent( $reader )Description
nextEvent returns the next event from an XMLEventReader created with the newEventReader.
The object returned is a native Java object (see: Java Objects) of type XMLEvent.
The only supported use of this object is by using the StAX Functions
getAttribute | Gets an attribute value from a StAX START_ELEMENT Event |
getData | Gets the Data of a StAX Event |
getEventType | Gets event type of a StAX Event |
getName | Gets name of a StAX Event as a QName |
getNamespace | Gets namespace URI of a StAX Event as a String |
To use the StAX functions you need to import them into either the global namespace or a local namespace.
Its recommended that you use a local namespace so that there is less chance of name collisions.
Example: process every START_EVENT for element named "element"
import commands stax=stax reader=stax:newEventReader( file.xml ) while [ stax:hasNext( $reader START_ELEMENT element ) ] ; do event=stax:nextEvent( $reader ) ; done stax:closeReader $reader
Commands
StAX Functions
newEventReader
hasNext
Java Objects