Wiki source for FunctionStAXnextEvent

Show raw source

=====Function nextEvent=====

This function is part of the [[FunctionsStAX StAX]] support.

**nextEvent** returns the next event from an ""XMLEventReader""

nextEvent( $reader )


nextEvent returns the next event from an ""XMLEventReader"" created with the [[FunctionStAXnewEventReader newEventReader]].

The object returned is a native Java object (see: [[JavaObjects Java Objects]]) of type [[ XMLEvent]].

The only supported use of this object is by using the [[FunctionsStAX StAX Functions]]

||[[FunctionStAXgetAttribute getAttribute]]||Gets an attribute value from a ""StAX"" START_ELEMENT Event||
||[[FunctionStAXgetData getData]]||Gets the Data of a ""StAX"" Event||
||[[FunctionStAXgetEventType getEventType]]||Gets event type of a ""StAX"" Event||
||[[FunctionStAXgetName getName]]||Gets name of a ""StAX"" Event as a QName||
||[[FunctionStAXgetNamespace getNamespace]]||Gets namespace URI of a ""StAX"" Event as a String||

To use the ""StAX"" functions you need to [[CommandImport 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 ) ;


stax:closeReader $reader


[[FunctionsStAX StAX Functions]]
[[FunctionStAXnewEventReader newEventReader]]
[[FunctionStAXhasNext hasNext]]
[[JavaObjects Java Objects]]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki