org.apache.xml.utils
Class StylesheetPIHandler
- ContentHandler, DTDHandler, EntityResolver, ErrorHandler
public class StylesheetPIHandler
Search for the xml-stylesheet processing instructions in an XML document.
Associating Style Sheets with XML documents, Version 1.0
StylesheetPIHandler(String baseID, String media, String title, String charset) - Construct a StylesheetPIHandler instance that will search
for xml-stylesheet PIs based on the given criteria.
|
Source | getAssociatedStylesheet() - Return the last stylesheet found that match the constraints.
|
String | getBaseId()
|
URIResolver | getURIResolver() - Get the object that will be used to resolve URIs in href
in xml-stylesheet processing instruction.
|
void | processingInstruction(String target, String data) - Handle the xml-stylesheet processing instruction.
|
void | setBaseId(String baseId) - Added additional getter and setter methods for the Base Id
to fix bugzilla bug 24187
|
void | setURIResolver(URIResolver resolver) - Get the object that will be used to resolve URIs in href
in xml-stylesheet processing instruction.
|
void | startElement(String namespaceURI, String localName, String qName, Attributes atts) - The spec notes that "The xml-stylesheet processing instruction is allowed only in the prolog of an XML document.",
so, at least for right now, I'm going to go ahead an throw a TransformerException
in order to stop the parse.
|
characters , endDocument , endElement , endPrefixMapping , error , fatalError , ignorableWhitespace , notationDecl , processingInstruction , resolveEntity , setDocumentLocator , skippedEntity , startDocument , startElement , startPrefixMapping , unparsedEntityDecl , warning |
StylesheetPIHandler
public StylesheetPIHandler(String baseID,
String media,
String title,
String charset)
Construct a StylesheetPIHandler instance that will search
for xml-stylesheet PIs based on the given criteria.
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.
getAssociatedStylesheet
public Source getAssociatedStylesheet()
Return the last stylesheet found that match the constraints.
- Source object that references the last stylesheet reference
that matches the constraints.
getBaseId
public String getBaseId()
getURIResolver
public URIResolver getURIResolver()
Get the object that will be used to resolve URIs in href
in xml-stylesheet processing instruction.
- The URIResolver that was set with setURIResolver.
setBaseId
public void setBaseId(String baseId)
Added additional getter and setter methods for the Base Id
to fix bugzilla bug 24187
setURIResolver
public void setURIResolver(URIResolver resolver)
Get the object that will be used to resolve URIs in href
in xml-stylesheet processing instruction.
resolver
- An object that implements the URIResolver interface,
or null.
startElement
public void startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
throws SAXException
The spec notes that "The xml-stylesheet processing instruction is allowed only in the prolog of an XML document.",
so, at least for right now, I'm going to go ahead an throw a TransformerException
in order to stop the parse.
- startElement in interface ContentHandler
- startElement in interface DefaultHandler
localName
- The local name (without prefix), or empty string if not namespace processing.
Copyright B) 2004 Apache XML Project. All Rights Reserved.