Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.xml.utils
Class StylesheetPIHandler  view StylesheetPIHandler download StylesheetPIHandler.java

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.apache.xml.utils.StylesheetPIHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class StylesheetPIHandler
extends org.xml.sax.helpers.DefaultHandler

Search for the xml-stylesheet processing instructions in an XML document.


Field Summary
(package private)  java.lang.String m_baseID
          The baseID of the document being processed.
(package private)  java.lang.String m_charset
          The desired character set criteria.
(package private)  java.lang.String m_media
          The desired media criteria.
(package private)  java.util.Vector m_stylesheets
          A list of SAXSource objects that match the criteria.
(package private)  java.lang.String m_title
          The desired title criteria.
(package private)  javax.xml.transform.URIResolver m_uriResolver
          The object that implements the URIResolver interface, or null.
 
Constructor Summary
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.
 
Method Summary
 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.", so, at least for right now, I'm going to go ahead an throw a TransformerException in order to stop the parse.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_baseID

java.lang.String m_baseID
The baseID of the document being processed.


m_media

java.lang.String m_media
The desired media criteria.


m_title

java.lang.String m_title
The desired title criteria.


m_charset

java.lang.String m_charset
The desired character set criteria.


m_stylesheets

java.util.Vector m_stylesheets
A list of SAXSource objects that match the criteria.


m_uriResolver

javax.xml.transform.URIResolver m_uriResolver
The object that implements the URIResolver interface, or null.

Constructor Detail

StylesheetPIHandler

public 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.

Method Detail

setURIResolver

public void setURIResolver(javax.xml.transform.URIResolver resolver)
Get the object that will be used to resolve URIs in href in xml-stylesheet processing instruction.


getURIResolver

public javax.xml.transform.URIResolver getURIResolver()
Get the object that will be used to resolve URIs in href in xml-stylesheet processing instruction.


getAssociatedStylesheet

public javax.xml.transform.Source getAssociatedStylesheet()
Return the last stylesheet found that match the constraints.


processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Handle the xml-stylesheet processing instruction.


startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.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.


setBaseId

public void setBaseId(java.lang.String baseId)
Added additional getter and setter methods for the Base Id to fix bugzilla bug 24187


getBaseId

public java.lang.String getBaseId()