com.icl.saxon

Class PIGrabber

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

Author: Michael H. Kay

Method Summary
SAXSource[]getAssociatedStylesheets()
Return list of stylesheets that matched, as an array of Source objects
String[]getStylesheetURIs()
Get the stylesheet URIs as an array of Strings
voidprocessingInstruction(String target, String data)
Handle xml-stylesheet PI
voidsetBaseURI(String uri)
Set the base URI
voidsetCriteria(String media, String title, String charset)
voidsetURIResolver(URIResolver resolver)
Set the URI resolver to be used for the href attribute
voidstartElement(String uri, String localName, String qName, Attributes attributes)
Abort the parse when the first start element tag is found

Method Detail

getAssociatedStylesheets

public SAXSource[] 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

public String[] getStylesheetURIs()
Get the stylesheet URIs as an array of Strings

processingInstruction

public void processingInstruction(String target, String data)
Handle xml-stylesheet PI

setBaseURI

public void setBaseURI(String uri)
Set the base URI

setCriteria

public void setCriteria(String media, String title, String charset)

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)
Abort the parse when the first start element tag is found