Revision [1626]

This is an old revision of FunctionStAXnextEvent made by DavidLee on 2010-12-06 11:42:38.

 

Function nextEvent


This function is part of the 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 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

getAttributeGets an attribute value from a StAX START_ELEMENT Event
getDataGets the Data of a StAX Event
getEventTypeGets event type of a StAX Event
getNameGets name of a StAX Event as a QName
getNamespaceGets 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_EVENT element ) ] ; do
	event=stax:nextEvent( $reader ) ;
	
done

stax:closeReader $reader 




Commands
StAX Functions
newEventReader
hasNext
Java Objects
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki