Package net.sf.saxon.evpull
Class EventToStaxBridge
java.lang.Object
net.sf.saxon.evpull.EventToStaxBridge
- All Implemented Interfaces:
XMLStreamConstants
,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.
-
Field Summary
Fields inherited from interface javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
-
Constructor Summary
ConstructorsConstructorDescriptionEventToStaxBridge
(EventIterator provider, PipelineConfiguration pipe) Create a EventToStaxBridge instance, which wraps a Saxon EventIterator as a Stax XMLStreamReader -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
int
getAttributeLocalName
(int i) getAttributeName
(int i) getAttributeNamespace
(int i) getAttributePrefix
(int i) getAttributeType
(int i) getAttributeValue
(int i) getAttributeValue
(String uri, String local) int
getName()
Get the NamePool used by this bridge to translate integer name codes to QNamesint
getNamespacePrefix
(int i) getNamespaceURI
(int i) getNamespaceURI
(String prefix) Get the underlying event streamgetText()
char[]
int
getTextCharacters
(int sourceStart, char[] target, int targetStart, int length) int
int
boolean
hasName()
boolean
hasNext()
boolean
hasText()
boolean
isAttributeSpecified
(int i) boolean
boolean
boolean
boolean
boolean
int
next()
int
nextTag()
void
boolean
-
Constructor Details
-
EventToStaxBridge
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 Details
-
getNamePool
Get the NamePool used by this bridge to translate integer name codes to QNames- Returns:
- the name pool in use
-
getAttributeCount
public int getAttributeCount()- Specified by:
getAttributeCount
in interfaceXMLStreamReader
-
isAttributeSpecified
public boolean isAttributeSpecified(int i) - Specified by:
isAttributeSpecified
in interfaceXMLStreamReader
-
getAttributeName
- Specified by:
getAttributeName
in interfaceXMLStreamReader
-
getAttributeLocalName
- Specified by:
getAttributeLocalName
in interfaceXMLStreamReader
-
getAttributeNamespace
- Specified by:
getAttributeNamespace
in interfaceXMLStreamReader
-
getAttributePrefix
- Specified by:
getAttributePrefix
in interfaceXMLStreamReader
-
getAttributeType
- Specified by:
getAttributeType
in interfaceXMLStreamReader
-
getAttributeValue
- Specified by:
getAttributeValue
in interfaceXMLStreamReader
-
getAttributeValue
- Specified by:
getAttributeValue
in interfaceXMLStreamReader
-
getEventType
public int getEventType()- Specified by:
getEventType
in interfaceXMLStreamReader
-
getNamespaceCount
public int getNamespaceCount()- Specified by:
getNamespaceCount
in interfaceXMLStreamReader
-
getText
- Specified by:
getText
in interfaceXMLStreamReader
-
getTextLength
public int getTextLength()- Specified by:
getTextLength
in interfaceXMLStreamReader
-
getTextStart
public int getTextStart()- Specified by:
getTextStart
in interfaceXMLStreamReader
-
getTextCharacters
public char[] getTextCharacters()- Specified by:
getTextCharacters
in interfaceXMLStreamReader
-
getTextCharacters
public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException - Specified by:
getTextCharacters
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
next
- Specified by:
next
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
nextTag
- Specified by:
nextTag
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
close
- Specified by:
close
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
hasName
public boolean hasName()- Specified by:
hasName
in interfaceXMLStreamReader
-
hasNext
- Specified by:
hasNext
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
hasText
public boolean hasText()- Specified by:
hasText
in interfaceXMLStreamReader
-
isCharacters
public boolean isCharacters()- Specified by:
isCharacters
in interfaceXMLStreamReader
-
isEndElement
public boolean isEndElement()- Specified by:
isEndElement
in interfaceXMLStreamReader
-
isStandalone
public boolean isStandalone()- Specified by:
isStandalone
in interfaceXMLStreamReader
-
isStartElement
public boolean isStartElement()- Specified by:
isStartElement
in interfaceXMLStreamReader
-
isWhiteSpace
public boolean isWhiteSpace()- Specified by:
isWhiteSpace
in interfaceXMLStreamReader
-
standaloneSet
public boolean standaloneSet()- Specified by:
standaloneSet
in interfaceXMLStreamReader
-
getCharacterEncodingScheme
- Specified by:
getCharacterEncodingScheme
in interfaceXMLStreamReader
-
getElementText
- Specified by:
getElementText
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
getEncoding
- Specified by:
getEncoding
in interfaceXMLStreamReader
-
getLocalName
- Specified by:
getLocalName
in interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceXMLStreamReader
-
getPIData
- Specified by:
getPIData
in interfaceXMLStreamReader
-
getPITarget
- Specified by:
getPITarget
in interfaceXMLStreamReader
-
getPrefix
- Specified by:
getPrefix
in interfaceXMLStreamReader
-
getVersion
- Specified by:
getVersion
in interfaceXMLStreamReader
-
getNamespacePrefix
- Specified by:
getNamespacePrefix
in interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceXMLStreamReader
-
getNamespaceContext
- Specified by:
getNamespaceContext
in interfaceXMLStreamReader
-
getName
- Specified by:
getName
in interfaceXMLStreamReader
-
getLocation
- Specified by:
getLocation
in interfaceXMLStreamReader
-
getProperty
- Specified by:
getProperty
in interfaceXMLStreamReader
- Throws:
IllegalArgumentException
-
require
- Specified by:
require
in interfaceXMLStreamReader
- Throws:
XMLStreamException
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceXMLStreamReader
-
getProvider
Get the underlying event stream
-