Package net.sf.saxon.event
Class PIGrabber
- java.lang.Object
-
- net.sf.saxon.event.SequenceReceiver
-
- net.sf.saxon.event.ProxyReceiver
-
- net.sf.saxon.event.PIGrabber
-
- All Implemented Interfaces:
javax.xml.transform.Result,Receiver
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
-
-
Constructor Summary
Constructors Constructor Description PIGrabber()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.xml.transform.Source[]getAssociatedStylesheets()Return list of stylesheets that matched, as an array of Source objectsbooleanisTerminated()Determine whether the parse terminated because the first start element tag was foundvoidopen()Start of event streamvoidprocessingInstruction(java.lang.String target, java.lang.CharSequence data, int locationId, int properties)Handle xml-stylesheet PIvoidsetBaseURI(java.lang.String uri)Set the base URIvoidsetCriteria(java.lang.String media, java.lang.String title, java.lang.String charset)voidsetFactory(Configuration config)voidsetURIResolver(javax.xml.transform.URIResolver resolver)Set the URI resolver to be used for the href attributevoidstartElement(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
attribute, characters, close, comment, endDocument, endElement, getConfiguration, getDocumentLocator, getNamePool, getUnderlyingReceiver, namespace, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, startDocument
-
Methods inherited from class net.sf.saxon.event.SequenceReceiver
append, getPipelineConfiguration, getSystemId
-
-
-
-
Method Detail
-
setFactory
public void setFactory(Configuration config)
-
setCriteria
public void setCriteria(java.lang.String media, java.lang.String title, java.lang.String charset)
-
setBaseURI
public void setBaseURI(java.lang.String uri)
Set the base URI
-
setURIResolver
public void setURIResolver(javax.xml.transform.URIResolver resolver)
Set the URI resolver to be used for the href attribute
-
open
public void open()
Description copied from class:ProxyReceiverStart of event stream- Specified by:
openin interfaceReceiver- Overrides:
openin classProxyReceiver
-
startElement
public void startElement(int namecode, int typecode, int locationId, int properties) throws XPathExceptionAbort the parse when the first start element tag is found- Specified by:
startElementin interfaceReceiver- Overrides:
startElementin classProxyReceiver- Parameters:
namecode- integer code identifying the name of the element within the name pool.typecode- integer code identifying the element's type within the name pool.locationId- an integer which can be interpreted using aLocationProviderto return information such as line number and system ID. If no location information is available, the value zero is supplied.properties- properties of the element node- Throws:
XPathException
-
isTerminated
public boolean isTerminated()
Determine whether the parse terminated because the first start element tag was found
-
processingInstruction
public void processingInstruction(java.lang.String target, java.lang.CharSequence data, int locationId, int properties) throws XPathExceptionHandle xml-stylesheet PI- Specified by:
processingInstructionin interfaceReceiver- Overrides:
processingInstructionin classProxyReceiver- Parameters:
target- The PI name. This must be a legal name (it will not be checked).data- The data portion of the processing instructionlocationId- an integer which can be interpreted using aLocationProviderto return information such as line number and system ID. If no location information is available, the value zero is supplied.properties- Additional information about the PI. The following bits are defined:- CHECKED
- Data is known to be legal (e.g. doesn't contain "?>")
- Throws:
XPathException
-
getAssociatedStylesheets
public javax.xml.transform.Source[] getAssociatedStylesheets() throws javax.xml.transform.TransformerExceptionReturn list of stylesheets that matched, as an array of Source objects- Returns:
- null if there were no matching stylesheets.
- Throws:
XPathException- if a URI cannot be resolvedjavax.xml.transform.TransformerException
-
-