public class EventToStaxBridge extends Object implements XMLStreamReader
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.
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Constructor and Description |
---|
EventToStaxBridge(EventIterator provider,
PipelineConfiguration pipe)
Create a EventToStaxBridge instance, which wraps a Saxon EventIterator as a Stax XMLStreamReader
|
public EventToStaxBridge(EventIterator provider, PipelineConfiguration pipe)
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 PipelineConfigurationpublic int getAttributeCount()
getAttributeCount
in interface XMLStreamReader
public boolean isAttributeSpecified(int i)
isAttributeSpecified
in interface XMLStreamReader
public QName getAttributeName(int i)
getAttributeName
in interface XMLStreamReader
public String getAttributeLocalName(int i)
getAttributeLocalName
in interface XMLStreamReader
public String getAttributeNamespace(int i)
getAttributeNamespace
in interface XMLStreamReader
public String getAttributePrefix(int i)
getAttributePrefix
in interface XMLStreamReader
public String getAttributeType(int i)
getAttributeType
in interface XMLStreamReader
public String getAttributeValue(int i)
getAttributeValue
in interface XMLStreamReader
public String getAttributeValue(String uri, String local)
getAttributeValue
in interface XMLStreamReader
public int getEventType()
getEventType
in interface XMLStreamReader
public int getNamespaceCount()
getNamespaceCount
in interface XMLStreamReader
public String getText()
getText
in interface XMLStreamReader
public int getTextLength()
getTextLength
in interface XMLStreamReader
public int getTextStart()
getTextStart
in interface XMLStreamReader
public char[] getTextCharacters()
getTextCharacters
in interface XMLStreamReader
public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException
getTextCharacters
in interface XMLStreamReader
XMLStreamException
public int next() throws XMLStreamException
next
in interface XMLStreamReader
XMLStreamException
public int nextTag() throws XMLStreamException
nextTag
in interface XMLStreamReader
XMLStreamException
public void close() throws XMLStreamException
close
in interface XMLStreamReader
XMLStreamException
public boolean hasName()
hasName
in interface XMLStreamReader
public boolean hasNext() throws XMLStreamException
hasNext
in interface XMLStreamReader
XMLStreamException
public boolean hasText()
hasText
in interface XMLStreamReader
public boolean isCharacters()
isCharacters
in interface XMLStreamReader
public boolean isEndElement()
isEndElement
in interface XMLStreamReader
public boolean isStandalone()
isStandalone
in interface XMLStreamReader
public boolean isStartElement()
isStartElement
in interface XMLStreamReader
public boolean isWhiteSpace()
isWhiteSpace
in interface XMLStreamReader
public boolean standaloneSet()
standaloneSet
in interface XMLStreamReader
public String getCharacterEncodingScheme()
getCharacterEncodingScheme
in interface XMLStreamReader
public String getElementText() throws XMLStreamException
getElementText
in interface XMLStreamReader
XMLStreamException
public String getEncoding()
getEncoding
in interface XMLStreamReader
public String getLocalName()
getLocalName
in interface XMLStreamReader
public String getNamespaceURI()
getNamespaceURI
in interface XMLStreamReader
public String getPIData()
getPIData
in interface XMLStreamReader
public String getPITarget()
getPITarget
in interface XMLStreamReader
public String getPrefix()
getPrefix
in interface XMLStreamReader
public String getVersion()
getVersion
in interface XMLStreamReader
public String getNamespacePrefix(int i)
getNamespacePrefix
in interface XMLStreamReader
public String getNamespaceURI(int i)
getNamespaceURI
in interface XMLStreamReader
public NamespaceContext getNamespaceContext()
getNamespaceContext
in interface XMLStreamReader
public QName getName()
getName
in interface XMLStreamReader
public Location getLocation()
getLocation
in interface XMLStreamReader
public Object getProperty(String s) throws IllegalArgumentException
getProperty
in interface XMLStreamReader
IllegalArgumentException
public void require(int event, String uri, String local) throws XMLStreamException
require
in interface XMLStreamReader
XMLStreamException
public String getNamespaceURI(String prefix)
getNamespaceURI
in interface XMLStreamReader
public EventIterator getProvider()
Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.