com.caucho.xsl
Class TransformerHandlerImpl

java.lang.Object
  |
  +--com.caucho.xml.DOMBuilder
        |
        +--com.caucho.xsl.TransformerHandlerImpl
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.ext.LexicalHandler, TransformerHandler, XMLWriter

public class TransformerHandlerImpl
extends DOMBuilder
implements TransformerHandler


Field Summary
protected static L10N L
           
 
Method Summary
 void endCDATA()
          Report the end of a CDATA section.
 void endDocument()
          Receive notification of the end of a document.
 void endDTD()
          Report the end of DTD declarations.
 void endEntity(java.lang.String name)
          Report the end of an entity.
 java.lang.String getSystemId()
          Returns the base URL for the transformation.
 Transformer getTransformer()
          Returns the stylesheet instance.
 void notationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
          Receive notification of a notation declaration event.
 void setResult(Result result)
          Sets the result descriptor.
 void startCDATA()
          Report the start of a CDATA section.
 void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
          Report the start of DTD declarations, if any.
 void startEntity(java.lang.String name)
          Report the beginning of some internal and external XML entities.
 void unparsedEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName)
          Receive notification of an unparsed entity declaration event.
 
Methods inherited from class com.caucho.xml.DOMBuilder
attribute, cdata, cdata, characters, comment, comment, dtd, endElement, endPrefixMapping, entityReference, getEscapeText, getNode, ignorableWhitespace, init, processingInstruction, setCoalescing, setDocumentLocator, setEscapeText, setFilename, setLocation, setSkipWhitespace, setStrictXML, setSystemId, skippedEntity, startDocument, startElement, startElement, startElement, startPrefixMapping, text, text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.xml.transform.sax.TransformerHandler
setSystemId
 
Methods inherited from interface org.xml.sax.ContentHandler
characters, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
 
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment
 

Field Detail

L

protected static L10N L
Method Detail

getSystemId

public java.lang.String getSystemId()
Description copied from interface: TransformerHandler
Returns the base URL for the transformation.
Specified by:
getSystemId in interface TransformerHandler
Overrides:
getSystemId in class DOMBuilder

getTransformer

public Transformer getTransformer()
Description copied from interface: TransformerHandler
Returns the stylesheet instance.
Specified by:
getTransformer in interface TransformerHandler

setResult

public void setResult(Result result)
Description copied from interface: TransformerHandler
Sets the result descriptor.
Specified by:
setResult in interface TransformerHandler

endDocument

public void endDocument()
Description copied from interface: org.xml.sax.ContentHandler
Receive notification of the end of a document.

The SAX parser will invoke this method only once, and it will be the last method invoked during the parse. The parser shall not invoke this method until it has either abandoned parsing (because of an unrecoverable error) or reached the end of input.

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class DOMBuilder
Following copied from interface: org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
ContentHandler.startDocument()

notationDecl

public void notationDecl(java.lang.String name,
                         java.lang.String publicId,
                         java.lang.String systemId)
Description copied from interface: org.xml.sax.DTDHandler
Receive notification of a notation declaration event.

It is up to the application to record the notation for later reference, if necessary.

At least one of publicId and systemId must be non-null. If a system identifier is present, and it is a URL, the SAX parser must resolve it fully before passing it to the application through this event.

There is no guarantee that the notation declaration will be reported before any unparsed entities that use it.

Specified by:
notationDecl in interface org.xml.sax.DTDHandler
Following copied from interface: org.xml.sax.DTDHandler
Parameters:
name - The notation name.
publicId - The notation's public identifier, or null if none was given.
systemId - The notation's system identifier, or null if none was given.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String), AttributeList

unparsedEntityDecl

public void unparsedEntityDecl(java.lang.String name,
                               java.lang.String publicId,
                               java.lang.String systemId,
                               java.lang.String notationName)
Description copied from interface: org.xml.sax.DTDHandler
Receive notification of an unparsed entity declaration event.

Note that the notation name corresponds to a notation reported by the notationDecl event. It is up to the application to record the entity for later reference, if necessary.

If the system identifier is a URL, the parser must resolve it fully before passing it to the application.

Specified by:
unparsedEntityDecl in interface org.xml.sax.DTDHandler
Following copied from interface: org.xml.sax.DTDHandler
Parameters:
name - The unparsed entity's name.
publicId - The entity's public identifier, or null if none was given.
systemId - The entity's system identifier.
notation - name The name of the associated notation.
Throws:
org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
See Also:
DTDHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String), AttributeList

startDTD

public void startDTD(java.lang.String name,
                     java.lang.String publicId,
                     java.lang.String systemId)
              throws org.xml.sax.SAXException
Description copied from interface: org.xml.sax.ext.LexicalHandler
Report the start of DTD declarations, if any.

This method is intended to report the beginning of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked.

All declarations reported through DTDHandler or DeclHandler events must appear between the startDTD and endDTD events. Declarations are assumed to belong to the internal DTD subset unless they appear between startEntity and endEntity events. Comments and processing instructions from the DTD should also be reported between the startDTD and endDTD events, in their original order of (logical) occurrence; they are not required to appear in their correct locations relative to DTDHandler or DeclHandler events, however.

Note that the start/endDTD events will appear within the start/endDocument events from ContentHandler and before the first startElement event.

Specified by:
startDTD in interface org.xml.sax.ext.LexicalHandler
Following copied from interface: org.xml.sax.ext.LexicalHandler
Parameters:
name - The document type name.
publicId - The declared public identifier for the external DTD subset, or null if none was declared.
systemId - The declared system identifier for the external DTD subset, or null if none was declared.
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
LexicalHandler.endDTD(), LexicalHandler.startEntity(java.lang.String)

endDTD

public void endDTD()
            throws org.xml.sax.SAXException
Description copied from interface: org.xml.sax.ext.LexicalHandler
Report the end of DTD declarations.

This method is intended to report the end of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked.

Specified by:
endDTD in interface org.xml.sax.ext.LexicalHandler
Following copied from interface: org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
LexicalHandler.startDTD(java.lang.String, java.lang.String, java.lang.String)

startEntity

public void startEntity(java.lang.String name)
                 throws org.xml.sax.SAXException
Description copied from interface: org.xml.sax.ext.LexicalHandler
Report the beginning of some internal and external XML entities.

The reporting of parameter entities (including the external DTD subset) is optional, and SAX2 drivers that support LexicalHandler may not support it; you can use the http://xml.org/sax/features/lexical-handler/parameter-entities feature to query or control the reporting of parameter entities.

General entities are reported with their regular names, parameter entities have '%' prepended to their names, and the external DTD subset has the pseudo-entity name "[dtd]".

When a SAX2 driver is providing these events, all other events must be properly nested within start/end entity events. There is no additional requirement that events from DeclHandler or DTDHandler be properly ordered.

Note that skipped entities will be reported through the skippedEntity event, which is part of the ContentHandler interface.

Because of the streaming event model that SAX uses, some entity boundaries cannot be reported under any circumstances:

These will be silently expanded, with no indication of where the original entity boundaries were.

Note also that the boundaries of character references (which are not really entities anyway) are not reported.

All start/endEntity events must be properly nested.

Specified by:
startEntity in interface org.xml.sax.ext.LexicalHandler
Following copied from interface: org.xml.sax.ext.LexicalHandler
Parameters:
name - The name of the entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be "[dtd]".
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
LexicalHandler.endEntity(java.lang.String), org.xml.sax.ext.DeclHandler#internalEntityDecl, org.xml.sax.ext.DeclHandler#externalEntityDecl

endEntity

public void endEntity(java.lang.String name)
               throws org.xml.sax.SAXException
Description copied from interface: org.xml.sax.ext.LexicalHandler
Report the end of an entity.
Specified by:
endEntity in interface org.xml.sax.ext.LexicalHandler
Following copied from interface: org.xml.sax.ext.LexicalHandler
Parameters:
name - The name of the entity that is ending.
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
LexicalHandler.startEntity(java.lang.String)

startCDATA

public void startCDATA()
                throws org.xml.sax.SAXException
Description copied from interface: org.xml.sax.ext.LexicalHandler
Report the start of a CDATA section.

The contents of the CDATA section will be reported through the regular characters event; this event is intended only to report the boundary.

Specified by:
startCDATA in interface org.xml.sax.ext.LexicalHandler
Following copied from interface: org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
LexicalHandler.endCDATA()

endCDATA

public void endCDATA()
              throws org.xml.sax.SAXException
Description copied from interface: org.xml.sax.ext.LexicalHandler
Report the end of a CDATA section.
Specified by:
endCDATA in interface org.xml.sax.ext.LexicalHandler
Following copied from interface: org.xml.sax.ext.LexicalHandler
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
LexicalHandler.startCDATA()