net.sf.saxon.event

Class PIGrabber

Implemented Interfaces:
Receiver, Result

public class PIGrabber
extends ProxyReceiver

The PIGrabber class is a Receiver that looks for xml-stylesheet processing instructions and tests whether they match specified criteria; for those that do, it creates an InputSource object referring to the relevant stylesheet
Author:
Michael H. Kay

Field Summary

Fields inherited from class net.sf.saxon.event.ProxyReceiver

nextReceiver

Fields inherited from class net.sf.saxon.event.SequenceReceiver

pipelineConfiguration, previousAtomic, systemId

Method Summary

Source[]
getAssociatedStylesheets()
Return list of stylesheets that matched, as an array of Source objects
boolean
isTerminated()
Determine whether the parse terminated because the first start element tag was found
void
open()
Start of event stream
void
processingInstruction(String target, CharSequence data, int locationId, int properties)
Handle xml-stylesheet PI
void
setBaseURI(String uri)
Set the base URI
void
setCriteria(String media, String title, String charset)
void
setFactory(Configuration config)
void
setURIResolver(URIResolver resolver)
Set the URI resolver to be used for the href attribute
void
startElement(int namecode, int typecode, int locationId, int properties)
Abort the parse when the first start element tag is found

Methods inherited from class net.sf.saxon.event.ProxyReceiver

append, attribute, characters, close, comment, endDocument, endElement, getConfiguration, getDocumentLocator, getNamePool, getUnderlyingReceiver, namespace, open, processingInstruction, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, startDocument, startElement

Methods inherited from class net.sf.saxon.event.SequenceReceiver

append, getConfiguration, getNamePool, getPipelineConfiguration, getSystemId, open, setPipelineConfiguration, setSystemId, setUnparsedEntity

Method Details

getAssociatedStylesheets

public Source[] getAssociatedStylesheets()
            throws TransformerException
Return list of stylesheets that matched, as an array of Source objects
Returns:
null if there were no matching stylesheets.

isTerminated

public boolean isTerminated()
Determine whether the parse terminated because the first start element tag was found

open

public void open()
Start of event stream
Specified by:
open in interface Receiver
Overrides:
open in interface ProxyReceiver

processingInstruction

public void processingInstruction(String target,
                                  CharSequence data,
                                  int locationId,
                                  int properties)
            throws XPathException
Handle xml-stylesheet PI
Specified by:
processingInstruction in interface Receiver
Overrides:
processingInstruction in interface ProxyReceiver

setBaseURI

public void setBaseURI(String uri)
Set the base URI

setCriteria

public void setCriteria(String media,
                        String title,
                        String charset)

setFactory

public void setFactory(Configuration config)

setURIResolver

public void setURIResolver(URIResolver resolver)
Set the URI resolver to be used for the href attribute

startElement

public void startElement(int namecode,
                         int typecode,
                         int locationId,
                         int properties)
            throws XPathException
Abort the parse when the first start element tag is found
Specified by:
startElement in interface Receiver
Overrides:
startElement in interface ProxyReceiver