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 TypeMethodDescriptionvoidclose()intgetAttributeLocalName(int i) getAttributeName(int i) getAttributeNamespace(int i) getAttributePrefix(int i) getAttributeType(int i) getAttributeValue(int i) getAttributeValue(String uri, String local) intgetName()Get the NamePool used by this bridge to translate integer name codes to QNamesintgetNamespacePrefix(int i) getNamespaceURI(int i) getNamespaceURI(String prefix) Get the underlying event streamgetText()char[]intgetTextCharacters(int sourceStart, char[] target, int targetStart, int length) intintbooleanhasName()booleanhasNext()booleanhasText()booleanisAttributeSpecified(int i) booleanbooleanbooleanbooleanbooleanintnext()intnextTag()voidboolean
-
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:
getAttributeCountin interfaceXMLStreamReader
-
isAttributeSpecified
public boolean isAttributeSpecified(int i) - Specified by:
isAttributeSpecifiedin interfaceXMLStreamReader
-
getAttributeName
- Specified by:
getAttributeNamein interfaceXMLStreamReader
-
getAttributeLocalName
- Specified by:
getAttributeLocalNamein interfaceXMLStreamReader
-
getAttributeNamespace
- Specified by:
getAttributeNamespacein interfaceXMLStreamReader
-
getAttributePrefix
- Specified by:
getAttributePrefixin interfaceXMLStreamReader
-
getAttributeType
- Specified by:
getAttributeTypein interfaceXMLStreamReader
-
getAttributeValue
- Specified by:
getAttributeValuein interfaceXMLStreamReader
-
getAttributeValue
- Specified by:
getAttributeValuein interfaceXMLStreamReader
-
getEventType
public int getEventType()- Specified by:
getEventTypein interfaceXMLStreamReader
-
getNamespaceCount
public int getNamespaceCount()- Specified by:
getNamespaceCountin interfaceXMLStreamReader
-
getText
- Specified by:
getTextin interfaceXMLStreamReader
-
getTextLength
public int getTextLength()- Specified by:
getTextLengthin interfaceXMLStreamReader
-
getTextStart
public int getTextStart()- Specified by:
getTextStartin interfaceXMLStreamReader
-
getTextCharacters
public char[] getTextCharacters()- Specified by:
getTextCharactersin interfaceXMLStreamReader
-
getTextCharacters
public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException - Specified by:
getTextCharactersin interfaceXMLStreamReader- Throws:
XMLStreamException
-
next
- Specified by:
nextin interfaceXMLStreamReader- Throws:
XMLStreamException
-
nextTag
- Specified by:
nextTagin interfaceXMLStreamReader- Throws:
XMLStreamException
-
close
- Specified by:
closein interfaceXMLStreamReader- Throws:
XMLStreamException
-
hasName
public boolean hasName()- Specified by:
hasNamein interfaceXMLStreamReader
-
hasNext
- Specified by:
hasNextin interfaceXMLStreamReader- Throws:
XMLStreamException
-
hasText
public boolean hasText()- Specified by:
hasTextin interfaceXMLStreamReader
-
isCharacters
public boolean isCharacters()- Specified by:
isCharactersin interfaceXMLStreamReader
-
isEndElement
public boolean isEndElement()- Specified by:
isEndElementin interfaceXMLStreamReader
-
isStandalone
public boolean isStandalone()- Specified by:
isStandalonein interfaceXMLStreamReader
-
isStartElement
public boolean isStartElement()- Specified by:
isStartElementin interfaceXMLStreamReader
-
isWhiteSpace
public boolean isWhiteSpace()- Specified by:
isWhiteSpacein interfaceXMLStreamReader
-
standaloneSet
public boolean standaloneSet()- Specified by:
standaloneSetin interfaceXMLStreamReader
-
getCharacterEncodingScheme
- Specified by:
getCharacterEncodingSchemein interfaceXMLStreamReader
-
getElementText
- Specified by:
getElementTextin interfaceXMLStreamReader- Throws:
XMLStreamException
-
getEncoding
- Specified by:
getEncodingin interfaceXMLStreamReader
-
getLocalName
- Specified by:
getLocalNamein interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceXMLStreamReader
-
getPIData
- Specified by:
getPIDatain interfaceXMLStreamReader
-
getPITarget
- Specified by:
getPITargetin interfaceXMLStreamReader
-
getPrefix
- Specified by:
getPrefixin interfaceXMLStreamReader
-
getVersion
- Specified by:
getVersionin interfaceXMLStreamReader
-
getNamespacePrefix
- Specified by:
getNamespacePrefixin interfaceXMLStreamReader
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceXMLStreamReader
-
getNamespaceContext
- Specified by:
getNamespaceContextin interfaceXMLStreamReader
-
getName
- Specified by:
getNamein interfaceXMLStreamReader
-
getLocation
- Specified by:
getLocationin interfaceXMLStreamReader
-
getProperty
- Specified by:
getPropertyin interfaceXMLStreamReader- Throws:
IllegalArgumentException
-
require
- Specified by:
requirein interfaceXMLStreamReader- Throws:
XMLStreamException
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceXMLStreamReader
-
getProvider
Get the underlying event stream
-