|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xalan.processor.StylesheetHandler
**For advanced use only** Initializes and processes a stylesheet via SAX events. This class acts as essentially a state machine, maintaining a ContentHandler stack, and pushing appropriate content handlers as parse events occur.
Constructor Summary | |
StylesheetHandler(StylesheetProcessor processor)
**For advanced use only** Create a StylesheetHandler object, creating a root stylesheet as the target. |
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
**For advanced use only** Receive notification of character data inside an element. |
XPath |
createXPath(java.lang.String str)
**For advanced use only** Process an expression string into an XPath. |
void |
endDocument()
**For advanced use only** Receive notification of the end of the document. |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName)
**For advanced use only** Receive notification of the end of an element. |
void |
endPrefixMapping(java.lang.String prefix)
**For advanced use only** Receive notification of the end of a Namespace mapping. |
void |
error(SAXParseException e)
**For advanced use only** Receive notification of a recoverable parser error. |
void |
fatalError(SAXParseException e)
**For advanced use only** Report a fatal XML parsing error. |
java.lang.String |
getBaseIdentifier()
**For advanced use only** Return the base identifier. |
Locator |
getLocator()
**For advanced use only** Get the current stylesheet Locator object. |
java.lang.String |
getNamespaceForPrefix(java.lang.String prefix)
**For advanced use only** Given a namespace, get the corrisponding prefix. |
java.lang.String |
getNamespaceForPrefix(java.lang.String prefix,
Node context)
**For advanced use only** Given a namespace, get the corrisponding prefix. |
Node |
getOriginatingNode()
**For advanced use only** Set the node that is originating the SAX event. |
StylesheetRoot |
getStylesheetRoot()
**For advanced use only** Return the stylesheet that this handler is constructing. |
Templates |
getTemplates()
**For advanced use only** When this object is used as a ContentHandler or ContentHandler, it will create a Templates object, which the caller can get once the SAX events have been completed. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
**For advanced use only** Receive notification of ignorable whitespace in element content. |
void |
notationDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
**For advanced use only** Receive notification of a notation declaration. |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
**For advanced use only** Receive notification of a processing instruction. |
InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
**For advanced use only** Resolve an external entity. |
void |
setBaseID(java.lang.String baseID)
**For advanced use only** Set the base ID (URL or system ID) for the stylesheet created by this builder. |
void |
setDocumentLocator(Locator locator)
**For advanced use only** Receive a Locator object for document events. |
void |
setOriginatingNode(Node n)
**For advanced use only** Set the node that is originating the SAX event. |
void |
skippedEntity(java.lang.String name)
**For advanced use only** Receive notification of a skipped entity. |
void |
startDocument()
**For advanced use only** Receive notification of the beginning of the document. |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName,
Attributes attributes)
**For advanced use only** Receive notification of the start of an element. |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
**For advanced use only** Receive notification of the start of a Namespace mapping. |
void |
unparsedEntityDecl(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId,
java.lang.String notationName)
**For advanced use only** Receive notification of an unparsed entity declaration. |
void |
warn(int msg,
java.lang.Object[] args)
**For internal use only** Warn the user of an problem. |
void |
warning(SAXParseException e)
**For advanced use only** Receive notification of a parser warning. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public StylesheetHandler(StylesheetProcessor processor) throws ProcessorException
Method Detail |
public XPath createXPath(java.lang.String str) throws SAXException
public java.lang.String getNamespaceForPrefix(java.lang.String prefix)
public java.lang.String getNamespaceForPrefix(java.lang.String prefix, Node context)
public java.lang.String getBaseIdentifier()
public Templates getTemplates() throws TransformException
public void setBaseID(java.lang.String baseID)
baseID
- Base URL for this stylesheet.public InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId) throws SAXException
Always return null, so that the parser will use the system identifier provided in the XML document. This method implements the SAX default behaviour: application writers can override it in a subclass to do special translations such as catalog lookups or URI redirection.
publicId
- The public identifer, or null if none is
available.systemId
- The system identifier provided in the XML
document.EntityResolver.resolveEntity(java.lang.String, java.lang.String)
public void notationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
By default, do nothing. Application writers may override this method in a subclass if they wish to keep track of the notations declared in a document.
name
- The notation name.publicId
- The notation public identifier, or null if not
available.systemId
- The notation system identifier.DTDHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String)
public void unparsedEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName)
name
- The entity name.publicId
- The entity public identifier, or null if not
available.systemId
- The entity system identifier.notationName
- The name of the associated notation.DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void setDocumentLocator(Locator locator)
locator
- A locator for all SAX document events.ContentHandler.setDocumentLocator(org.xml.sax.Locator)
,
Locator
public void startDocument() throws SAXException
ContentHandler.startDocument()
public void endDocument() throws SAXException
ContentHandler.endDocument()
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws SAXException
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).
prefix
- The Namespace prefix being declared.uri
- The Namespace URI mapped to the prefix.ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)
public void endPrefixMapping(java.lang.String prefix) throws SAXException
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).
prefix
- The Namespace prefix being declared.ContentHandler.endPrefixMapping(java.lang.String)
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName, Attributes attributes) throws SAXException
name
- The element type name.attributes
- The specified or defaulted attributes.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName) throws SAXException
name
- The element type name.attributes
- The specified or defaulted attributes.ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
public void characters(char[] ch, int start, int length) throws SAXException
ch
- The characters.start
- The start position in the character array.length
- The number of characters to use from the
character array.ContentHandler.characters(char[], int, int)
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ch
- The whitespace characters.start
- The start position in the character array.length
- The number of characters to use from the
character array.ContentHandler.ignorableWhitespace(char[], int, int)
public void processingInstruction(java.lang.String target, java.lang.String data) throws SAXException
By default, do nothing. Application writers may override this method in a subclass to take specific actions for each processing instruction, such as setting status variables or invoking other methods.
target
- The processing instruction target.data
- The processing instruction data, or null if
none is supplied.ContentHandler.processingInstruction(java.lang.String, java.lang.String)
public void skippedEntity(java.lang.String name) throws SAXException
By default, do nothing. Application writers may override this method in a subclass to take specific actions for each processing instruction, such as setting status variables or invoking other methods.
name
- The name of the skipped entity.ContentHandler.processingInstruction(java.lang.String, java.lang.String)
public void warn(int msg, java.lang.Object[] args) throws SAXException
public void warning(SAXParseException e) throws SAXException
e
- The warning information encoded as an exception.ErrorHandler.warning(org.xml.sax.SAXParseException)
,
SAXParseException
public void error(SAXParseException e) throws SAXException
e
- The warning information encoded as an exception.ErrorHandler.warning(org.xml.sax.SAXParseException)
,
SAXParseException
public void fatalError(SAXParseException e) throws SAXException
The default implementation throws a SAXParseException. Application writers may override this method in a subclass if they need to take specific actions for each fatal error (such as collecting all of the errors into a single report): in any case, the application must stop all regular processing when this method is invoked, since the document is no longer reliable, and the parser may no longer report parsing events.
e
- The error information encoded as an exception.ErrorHandler.fatalError(org.xml.sax.SAXParseException)
,
SAXParseException
public StylesheetRoot getStylesheetRoot()
public Locator getLocator()
public void setOriginatingNode(Node n)
public Node getOriginatingNode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |