public class StylesheetPIHandler
extends org.xml.sax.helpers.DefaultHandler
| Constructor and Description |
|---|
StylesheetPIHandler(java.lang.String baseID,
java.lang.String media,
java.lang.String title,
java.lang.String charset)
Construct a StylesheetPIHandler instance that will search
for xml-stylesheet PIs based on the given criteria.
|
| Modifier and Type | Method and Description |
|---|---|
javax.xml.transform.Source |
getAssociatedStylesheet()
Return the last stylesheet found that match the constraints.
|
java.lang.String |
getBaseId() |
javax.xml.transform.URIResolver |
getURIResolver()
Get the object that will be used to resolve URIs in href
in xml-stylesheet processing instruction.
|
void |
processingInstruction(java.lang.String target,
java.lang.String data)
Handle the xml-stylesheet processing instruction.
|
void |
setBaseId(java.lang.String baseId)
Added additional getter and setter methods for the Base Id
to fix bugzilla bug 24187
|
void |
setURIResolver(javax.xml.transform.URIResolver resolver)
Get the object that will be used to resolve URIs in href
in xml-stylesheet processing instruction.
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
The spec notes that "The xml-stylesheet processing instruction is allowed only in the prolog of an XML document
|
public StylesheetPIHandler(java.lang.String baseID,
java.lang.String media,
java.lang.String title,
java.lang.String charset)
baseID - The base ID of the XML document, needed to resolve
relative IDs.media - The desired media criteria.title - The desired title criteria.charset - The desired character set criteria.public void setURIResolver(javax.xml.transform.URIResolver resolver)
resolver - An object that implements the URIResolver interface,
or null.public javax.xml.transform.URIResolver getURIResolver()
public javax.xml.transform.Source getAssociatedStylesheet()
public void processingInstruction(java.lang.String target,
java.lang.String data)
throws org.xml.sax.SAXException
processingInstruction in interface org.xml.sax.ContentHandlerprocessingInstruction in class org.xml.sax.helpers.DefaultHandlertarget - The processing instruction target.data - The processing instruction data, or null if
none is supplied.org.xml.sax.SAXException - Any SAX exception, possibly
wrapping another exception.ContentHandler.processingInstruction(java.lang.String, java.lang.String),
Associating Style Sheets with XML documents, Version 1.0public void startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlernamespaceURI - The Namespace URI, or an empty string.localName - The local name (without prefix), or empty string if not namespace processing.qName - The qualified name (with prefix).atts - The specified or defaulted attributes.StopParseException - since there can be no valid xml-stylesheet processing
instructions past the first element.org.xml.sax.SAXExceptionpublic void setBaseId(java.lang.String baseId)
public java.lang.String getBaseId()
Copyright © 2023 Apache XML Project. All Rights Reserved.