net.sf.saxon.evpull

Class EventToStaxBridge

public class EventToStaxBridge extends Object implements XMLStreamReader

This class bridges EventIterator events to XMLStreamReader (Stax) events. That is, it acts as an XMLStreamReader, fetching the underlying data from an EventIterator.

An EventIterator may provide access to any XDM sequence, whereas an XMLStreamReader always reads a document. The conversion of a sequence to a document follows the rules for "normalizing" a sequence in the Serialization specification: for example, atomic values are converted into text nodes, with adjacent atomic values being space-separated.

Nested Class Summary
static classEventToStaxBridge.DummyLocation
Constructor Summary
EventToStaxBridge(EventIterator provider, PipelineConfiguration pipe)
Create a EventToStaxBridge instance, which wraps a Saxon EventIterator as a Stax XMLStreamReader
Method Summary
voidclose()
intgetAttributeCount()
StringgetAttributeLocalName(int i)
QNamegetAttributeName(int i)
StringgetAttributeNamespace(int i)
StringgetAttributePrefix(int i)
StringgetAttributeType(int i)
StringgetAttributeValue(int i)
StringgetAttributeValue(String uri, String local)
StringgetCharacterEncodingScheme()
StringgetElementText()
StringgetEncoding()
intgetEventType()
StringgetLocalName()
LocationgetLocation()
QNamegetName()
NamePoolgetNamePool()
Get the NamePool used by this bridge to translate integer name codes to QNames
NamespaceContextgetNamespaceContext()
intgetNamespaceCount()
StringgetNamespacePrefix(int i)
StringgetNamespaceURI()
StringgetNamespaceURI(int i)
StringgetNamespaceURI(String prefix)
StringgetPIData()
StringgetPITarget()
StringgetPrefix()
ObjectgetProperty(String s)
EventIteratorgetProvider()
Get the underlying event stream
StringgetText()
char[]getTextCharacters()
intgetTextCharacters(int sourceStart, char[] target, int targetStart, int length)
intgetTextLength()
intgetTextStart()
StringgetVersion()
booleanhasName()
booleanhasNext()
booleanhasText()
booleanisAttributeSpecified(int i)
booleanisCharacters()
booleanisEndElement()
booleanisStandalone()
booleanisStartElement()
booleanisWhiteSpace()
intnext()
intnextTag()
voidrequire(int event, String uri, String local)
booleanstandaloneSet()

Constructor Detail

EventToStaxBridge

public EventToStaxBridge(EventIterator provider, PipelineConfiguration pipe)
Create a EventToStaxBridge instance, which wraps a Saxon EventIterator as a Stax XMLStreamReader

Parameters: provider the Saxon EventIterator from which the events will be read. This must return a fully decomposed event stream, that is, document and element nodes must be presented as separate events for the start, content, and end. pipe the PipelineConfiguration

Method Detail

close

public void close()

getAttributeCount

public int getAttributeCount()

getAttributeLocalName

public String getAttributeLocalName(int i)

getAttributeName

public QName getAttributeName(int i)

getAttributeNamespace

public String getAttributeNamespace(int i)

getAttributePrefix

public String getAttributePrefix(int i)

getAttributeType

public String getAttributeType(int i)

getAttributeValue

public String getAttributeValue(int i)

getAttributeValue

public String getAttributeValue(String uri, String local)

getCharacterEncodingScheme

public String getCharacterEncodingScheme()

getElementText

public String getElementText()

getEncoding

public String getEncoding()

getEventType

public int getEventType()

getLocalName

public String getLocalName()

getLocation

public Location getLocation()

getName

public QName getName()

getNamePool

public NamePool getNamePool()
Get the NamePool used by this bridge to translate integer name codes to QNames

Returns: the name pool in use

getNamespaceContext

public NamespaceContext getNamespaceContext()

getNamespaceCount

public int getNamespaceCount()

getNamespacePrefix

public String getNamespacePrefix(int i)

getNamespaceURI

public String getNamespaceURI()

getNamespaceURI

public String getNamespaceURI(int i)

getNamespaceURI

public String getNamespaceURI(String prefix)

getPIData

public String getPIData()

getPITarget

public String getPITarget()

getPrefix

public String getPrefix()

getProperty

public Object getProperty(String s)

getProvider

public EventIterator getProvider()
Get the underlying event stream

getText

public String getText()

getTextCharacters

public char[] getTextCharacters()

getTextCharacters

public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length)

getTextLength

public int getTextLength()

getTextStart

public int getTextStart()

getVersion

public String getVersion()

hasName

public boolean hasName()

hasNext

public boolean hasNext()

hasText

public boolean hasText()

isAttributeSpecified

public boolean isAttributeSpecified(int i)

isCharacters

public boolean isCharacters()

isEndElement

public boolean isEndElement()

isStandalone

public boolean isStandalone()

isStartElement

public boolean isStartElement()

isWhiteSpace

public boolean isWhiteSpace()

next

public int next()

nextTag

public int nextTag()

require

public void require(int event, String uri, String local)

standaloneSet

public boolean standaloneSet()