public class PIGrabber extends ProxyReceiver
ProxyReceiver
that looks for xml-stylesheet
processing
instructions and tests whether they match specified criteria; for those that do, it creates
a Source
object referring to the relevant stylesheetnextReceiver
pipelineConfiguration, previousAtomic, systemId
Modifier and Type | Method and Description |
---|---|
javax.xml.transform.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 |
processingInstruction(java.lang.String target,
UnicodeString data,
Location locationId,
int properties)
Handle xml-stylesheet PI
|
void |
setBaseURI(java.lang.String uri)
Set the base URI
|
void |
setCriteria(java.lang.String media,
java.lang.String title)
Define the matching criteria
|
void |
setFactory(Configuration config) |
void |
setResourceResolver(ResourceResolver resolver)
Set the URI resolver to be used for the href attribute
|
void |
startElement(NodeName elemName,
SchemaType type,
AttributeMap attributes,
NamespaceMap namespaces,
Location location,
int properties)
Abort the parse when the first start element tag is found
|
append, characters, close, comment, endDocument, endElement, getNamePool, getNextReceiver, open, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startDocument, usesTypeAnnotations
append, decompose, flatten, getConfiguration, getErrorCodeForDecomposingFunctionItems, getPipelineConfiguration, getSystemId, handlesAppend
public PIGrabber(Receiver next)
public void setFactory(Configuration config)
public void setCriteria(java.lang.String media, java.lang.String title)
media
- the required media. Note that Saxon does not implement the complex CSS3-based syntax for
media queries. By default, the media value is simply ignored. An algorithm for
comparing the requested media with the declared media can be defined using
the method Configuration.setMediaQueryEvaluator(Comparator)
.title
- the required titlepublic void setBaseURI(java.lang.String uri)
uri
- the base URIpublic void setResourceResolver(ResourceResolver resolver)
resolver
- the URI resolverpublic void startElement(NodeName elemName, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties) throws XPathException
startElement
in interface Receiver
startElement
in class ProxyReceiver
elemName
- the name of the element.type
- the type annotation of the element.attributes
- the attributes of this elementnamespaces
- the in-scope namespaces of this element: generally this is all the in-scope
namespaces, without relying on inheriting namespaces from parent elementslocation
- an object providing information about the module, line, and column where the node originatedproperties
- bit-significant properties of the element node. If there are no relevant
properties, zero is supplied. The definitions of the bits are in class ReceiverOption
XPathException
- if an error occurspublic boolean isTerminated()
public void processingInstruction(java.lang.String target, UnicodeString data, Location locationId, int properties) throws XPathException
processingInstruction
in interface Receiver
processingInstruction
in class ProxyReceiver
target
- The PI name. This must be a legal name (it will not be checked).data
- The data portion of the processing instructionlocationId
- provides information such as line number and system ID.properties
- Additional information about the PI.XPathException
- if an error occurspublic javax.xml.transform.Source[] getAssociatedStylesheets() throws javax.xml.transform.TransformerException
XPathException
- if a URI cannot be resolvedjavax.xml.transform.TransformerException
Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.