Package com.icl.saxon
Class PIGrabber
java.lang.Object
org.xml.sax.helpers.DefaultHandler
com.icl.saxon.PIGrabber
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
The PIGrabber class is a SAX ContentHandler 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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn list of stylesheets that matched, as an array of Source objectsString[]
Get the stylesheet URIs as an array of Stringsvoid
processingInstruction
(String target, String data) Handle xml-stylesheet PIvoid
setBaseURI
(String uri) Set the base URIvoid
setCriteria
(String media, String title, String charset) void
setURIResolver
(URIResolver resolver) Set the URI resolver to be used for the href attributevoid
startElement
(String uri, String localName, String qName, Attributes attributes) Abort the parse when the first start element tag is foundMethods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
PIGrabber
public PIGrabber()
-
-
Method Details
-
setCriteria
-
setBaseURI
Set the base URI -
setURIResolver
Set the URI resolver to be used for the href attribute -
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException Abort the parse when the first start element tag is found- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
processingInstruction
Handle xml-stylesheet PI- Specified by:
processingInstruction
in interfaceContentHandler
- Overrides:
processingInstruction
in classDefaultHandler
- Throws:
SAXException
-
getAssociatedStylesheets
Return list of stylesheets that matched, as an array of Source objects- Returns:
- null if there were no matching stylesheets.
- Throws:
TransformerException
- if a URI cannot be resolved
-
getStylesheetURIs
Get the stylesheet URIs as an array of Strings- Throws:
SAXException
-