net.sf.saxon.pull

Class PullToStax

Implemented Interfaces:
XMLStreamReader

public class PullToStax
extends java.lang.Object
implements XMLStreamReader

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

A PullProvider 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

class
PullToStax.SourceStreamLocation
Bridge a SAX SourceLocator to a javax.xml.stream.Location

Constructor Summary

PullToStax(PullProvider provider)
Create a PullToStax instance, which wraps a Saxon PullProvider as a Stax XMLStreamReader

Method Summary

void
close()
int
getAttributeCount()
String
getAttributeLocalName(int i)
QName
getAttributeName(int i)
String
getAttributeNamespace(int i)
String
getAttributePrefix(int i)
String
getAttributeType(int i)
String
getAttributeValue(String uri, String local)
String
getAttributeValue(int i)
String
getCharacterEncodingScheme()
String
getElementText()
String
getEncoding()
int
getEventType()
String
getLocalName()
Location
getLocation()
QName
getName()
NamespaceContext
getNamespaceContext()
int
getNamespaceCount()
String
getNamespacePrefix(int i)
String
getNamespaceURI()
String
getNamespaceURI(String s)
String
getNamespaceURI(int i)
String
getPIData()
String
getPITarget()
String
getPrefix()
Object
getProperty(String s)
String
getText()
char[]
getTextCharacters()
int
getTextCharacters(int sourceStart, char[] target, int targetStart, int length)
int
getTextLength()
int
getTextStart()
String
getVersion()
boolean
hasName()
boolean
hasNext()
boolean
hasText()
boolean
isAttributeSpecified(int i)
boolean
isCharacters()
boolean
isEndElement()
boolean
isStandalone()
boolean
isStartElement()
boolean
isWhiteSpace()
int
next()
int
nextTag()
void
require(int event, String uri, String local)
boolean
standaloneSet()

Constructor Details

PullToStax

public PullToStax(PullProvider provider)
Create a PullToStax instance, which wraps a Saxon PullProvider as a Stax XMLStreamReader
Parameters:
provider - the Saxon PullProvider from which the events will be read

Method Details

close

public void close()
            throws XMLStreamException

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(String uri,
                                String local)

getAttributeValue

public String getAttributeValue(int i)

getCharacterEncodingScheme

public String getCharacterEncodingScheme()

getElementText

public String getElementText()
            throws XMLStreamException

getEncoding

public String getEncoding()

getEventType

public int getEventType()

getLocalName

public String getLocalName()

getLocation

public Location getLocation()

getName

public QName getName()

getNamespaceContext

public NamespaceContext getNamespaceContext()

getNamespaceCount

public int getNamespaceCount()

getNamespacePrefix

public String getNamespacePrefix(int i)

getNamespaceURI

public String getNamespaceURI()

getNamespaceURI

public String getNamespaceURI(String s)

getNamespaceURI

public String getNamespaceURI(int i)

getPIData

public String getPIData()

getPITarget

public String getPITarget()

getPrefix

public String getPrefix()

getProperty

public Object getProperty(String s)
            throws IllegalArgumentException

getText

public String getText()

getTextCharacters

public char[] getTextCharacters()

getTextCharacters

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

getTextLength

public int getTextLength()

getTextStart

public int getTextStart()

getVersion

public String getVersion()

hasName

public boolean hasName()

hasNext

public boolean hasNext()
            throws XMLStreamException

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()
            throws XMLStreamException

nextTag

public int nextTag()
            throws XMLStreamException

require

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

standaloneSet

public boolean standaloneSet()