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
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
nextReceiverFields inherited from class net.sf.saxon.event.SequenceReceiver
pipelineConfiguration, previousAtomic, systemIdFields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSource[]Return list of stylesheets that matched, as an array of Source objectsbooleanDetermine whether the parse terminated because the first start element tag was foundvoidprocessingInstruction(String target, CharSequence data, int locationId, int properties) Handle xml-stylesheet PIvoidsetBaseURI(String uri) Set the base URIvoidsetCriteria(String media, String title) voidsetFactory(Configuration config) voidsetURIResolver(URIResolver resolver) Set the URI resolver to be used for the href attributevoidstartElement(NodeName namecode, SchemaType typecode, int locationId, int properties) Abort the parse when the first start element tag is foundMethods inherited from class net.sf.saxon.event.ProxyReceiver
append, attribute, characters, close, comment, endDocument, endElement, getNamePool, getUnderlyingReceiver, namespace, open, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, startDocument, usesTypeAnnotationsMethods inherited from class net.sf.saxon.event.SequenceReceiver
append, getConfiguration, getPipelineConfiguration, getSystemId
-
Constructor Details
-
PIGrabber
-
-
Method Details
-
setFactory
-
setCriteria
-
setBaseURI
Set the base URI- Parameters:
uri- the base URI
-
setURIResolver
Set the URI resolver to be used for the href attribute- Parameters:
resolver- the URI resolver
-
startElement
public void startElement(NodeName namecode, SchemaType typecode, int locationId, int properties) throws XPathException Abort 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- if an error occurs
-
isTerminated
public boolean isTerminated()Determine whether the parse terminated because the first start element tag was found- Returns:
- true if the parse was terminated when the document element was encountered (as distinct from being terminated because of some exception condition, for example a parse error)
-
processingInstruction
public void processingInstruction(String target, CharSequence data, int locationId, int properties) throws XPathException Handle 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.- Throws:
XPathException- if an error occurs
-
getAssociatedStylesheets
Return 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 resolvedTransformerException
-