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

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
void
processingInstruction(String target, String data)
Handle xml-stylesheet PI
void
setBaseURI(String uri)
Set the base URI
void
setCriteria(String media, String title, String charset)
void
setURIResolver(URIResolver resolver)
Set the URI resolver to be used for the href attribute
void
startElement(String uri, String localName, String qName, Attributes attributes)
Abort the parse when the first start element tag is found

Method Details

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.

getStylesheetURIs

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

processingInstruction

public void processingInstruction(String target,
                                  String data)
            throws SAXException
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)
            throws SAXException
Abort the parse when the first start element tag is found