Wiki source for FunctionStAXnextEvent
=====Function nextEvent=====
This function is part of the [[FunctionsStAX StAX]] support.
====Name====
**nextEvent** returns the next event from an ""XMLEventReader""
====Synopsis====
nextEvent( $reader )
====Description====
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 [[http://download.oracle.com/javase/6/docs/api/javax/xml/stream/events/XMLEvent.html 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 ) ;
done
stax:closeReader $reader
%%
----
[[Commands]]
[[FunctionsStAX StAX Functions]]
[[FunctionStAXnewEventReader newEventReader]]
[[FunctionStAXhasNext hasNext]]
[[JavaObjects Java Objects]]
This function is part of the [[FunctionsStAX StAX]] support.
====Name====
**nextEvent** returns the next event from an ""XMLEventReader""
====Synopsis====
nextEvent( $reader )
====Description====
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 [[http://download.oracle.com/javase/6/docs/api/javax/xml/stream/events/XMLEvent.html 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 ) ;
done
stax:closeReader $reader
%%
----
[[Commands]]
[[FunctionsStAX StAX Functions]]
[[FunctionStAXnewEventReader newEventReader]]
[[FunctionStAXhasNext hasNext]]
[[JavaObjects Java Objects]]