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
public class PIGrabber extends DefaultHandler
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
-
-
Constructor Summary
Constructors Constructor Description PIGrabber()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SAXSource[]
getAssociatedStylesheets()
Return list of stylesheets that matched, as an array of Source objectsString[]
getStylesheetURIs()
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 found-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Method Detail
-
setBaseURI
public void setBaseURI(String uri)
Set the base URI
-
setURIResolver
public void setURIResolver(URIResolver resolver)
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
public void processingInstruction(String target, String data) throws SAXException
Handle xml-stylesheet PI- Specified by:
processingInstruction
in interfaceContentHandler
- Overrides:
processingInstruction
in classDefaultHandler
- Throws:
SAXException
-
getAssociatedStylesheets
public SAXSource[] getAssociatedStylesheets() throws TransformerException
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
public String[] getStylesheetURIs() throws SAXException
Get the stylesheet URIs as an array of Strings- Throws:
SAXException
-
-