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 StringsvoidprocessingInstruction(String target, String data)Handle xml-stylesheet PIvoidsetBaseURI(String uri)Set the base URIvoidsetCriteria(String media, String title, String charset)voidsetURIResolver(URIResolver resolver)Set the URI resolver to be used for the href attributevoidstartElement(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:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
processingInstruction
public void processingInstruction(String target, String data) throws SAXException
Handle xml-stylesheet PI- Specified by:
processingInstructionin interfaceContentHandler- Overrides:
processingInstructionin 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
-
-