|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xalan.stree.SourceTreeHandler
This class handles SAX2 parse events to create a source tree for transformation.
Constructor Summary | |
SourceTreeHandler()
Create a SourceTreeHandler. |
|
SourceTreeHandler(TransformerImpl transformer)
Create a SourceTreeHandler that will start a transformation as soon as a startDocument occurs. |
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
Implement the characters event. |
void |
charactersRaw(char[] ch,
int start,
int length)
Implement the characters event. |
void |
comment(char[] ch,
int start,
int length)
Report an XML comment anywhere in the document. |
void |
endCDATA()
Report the end of a CDATA section. |
void |
endDocument()
Implement the endDocument event. |
void |
endDTD()
Report the end of DTD declarations. |
void |
endElement(java.lang.String ns,
java.lang.String localName,
java.lang.String name)
Implement the endElement event. |
void |
endEntity(java.lang.String name)
Report the end of an entity. |
void |
endPrefixMapping(java.lang.String prefix)
End the scope of a prefix-URI mapping. |
InputSource |
getInputSource()
|
Node |
getRoot()
Get the root document of tree that is being or will be created. |
TransformerImpl |
getTransformer()
|
boolean |
getUseMultiThreading()
Tell whether or not the tree being built should handle transformation while the parse is still going on. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Implement the ignorableWhitespace event. |
void |
processingInstruction(java.lang.String target,
java.lang.String data)
Implement the processingInstruction event. |
void |
setDocumentLocator(Locator locator)
Implement the setDocumentLocator event. |
void |
setInputSource(InputSource source)
|
void |
setRoot(Document root)
Set the root document of tree will be created. |
void |
setUseMultiThreading(boolean b)
Set whether or not the tree being built should handle transformation while the parse is still going on. |
void |
skippedEntity(java.lang.String name)
Receive notification of a skipped entity. |
void |
startCDATA()
Report the start of a CDATA section. |
void |
startDocument()
Implement the startDocument event. |
void |
startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
Report the start of DTD declarations, if any. |
void |
startElement(java.lang.String ns,
java.lang.String localName,
java.lang.String name,
Attributes atts)
Implement the startElement event. |
void |
startEntity(java.lang.String name)
Report the beginning of an entity. |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
Begin the scope of a prefix-URI Namespace mapping. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public SourceTreeHandler(TransformerImpl transformer)
public SourceTreeHandler()
Method Detail |
public TransformerImpl getTransformer()
public Node getRoot()
public void setRoot(Document root)
public void setInputSource(InputSource source)
public InputSource getInputSource()
public void setDocumentLocator(Locator locator)
public void setUseMultiThreading(boolean b)
public boolean getUseMultiThreading()
public void startDocument() throws SAXException
public void endDocument() throws SAXException
public void startElement(java.lang.String ns, java.lang.String localName, java.lang.String name, Attributes atts) throws SAXException
public void endElement(java.lang.String ns, java.lang.String localName, java.lang.String name) throws SAXException
public void startCDATA() throws SAXException
The contents of the CDATA section will be reported through the regular characters event.
endCDATA()
public void endCDATA() throws SAXException
startCDATA()
public void characters(char[] ch, int start, int length) throws SAXException
public void charactersRaw(char[] ch, int start, int length) throws SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
public void processingInstruction(java.lang.String target, java.lang.String data) throws SAXException
public void comment(char[] ch, int start, int length) throws SAXException
This callback will be used for comments inside or outside the document element, including comments in the external DTD subset (if read).
ch
- An array holding the characters in the comment.start
- The starting position in the array.length
- The number of characters to use from the array.public void startEntity(java.lang.String name) throws SAXException
The start and end of the document entity are not reported. The start and end of the external DTD subset are reported using the pseudo-name "[dtd]". All other events must be properly nested within start/end entity events.
Note that skipped entities will be reported through the skippedEntity event, which is part of the ContentHandler interface.
name
- The name of the entity. If it is a parameter
entity, the name will begin with '%'.endEntity(java.lang.String)
,
DeclHandler.internalEntityDecl(java.lang.String, java.lang.String)
,
DeclHandler.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)
public void endEntity(java.lang.String name) throws SAXException
name
- The name of the entity that is ending.startEntity(java.lang.String)
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws SAXException
Any declarations are assumed to be in the internal subset unless otherwise indicated by a startEntity event.
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.endDTD()
,
startEntity(java.lang.String)
public void endDTD() throws SAXException
startDTD(java.lang.String, java.lang.String, java.lang.String)
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws SAXException
The information from this event is not necessary for normal Namespace processing: the SAX XML reader will automatically replace prefixes for element and attribute names when the http://xml.org/sax/features/namespaces feature is true (the default).
There are cases, however, when applications need to use prefixes in character data or in attribute values, where they cannot safely be expanded automatically; the start/endPrefixMapping event supplies the information to the application to expand prefixes in those contexts itself, if necessary.
Note that start/endPrefixMapping events are not guaranteed to be properly nested relative to each-other: all startPrefixMapping events will occur before the corresponding startElement event, and all endPrefixMapping events will occur after the corresponding endElement event, but their order is not guaranteed.
prefix
- The Namespace prefix being declared.uri
- The Namespace URI the prefix is mapped to.endPrefixMapping(java.lang.String)
,
startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void endPrefixMapping(java.lang.String prefix) throws SAXException
See startPrefixMapping for details. This event will always occur after the corresponding endElement event, but the order of endPrefixMapping events is not otherwise guaranteed.
prefix
- The prefix that was being mapping.startPrefixMapping(java.lang.String, java.lang.String)
,
endElement(java.lang.String, java.lang.String, java.lang.String)
public void skippedEntity(java.lang.String name) throws SAXException
The Parser will invoke this method once for each entity skipped. Non-validating processors may skip entities if they have not seen the declarations (because, for example, the entity was declared in an external DTD subset). All processors may skip external entities, depending on the values of the http://xml.org/sax/features/external-general-entities and the http://xml.org/sax/features/external-parameter-entities properties.
name
- The name of the skipped entity. If it is a
parameter entity, the name will begin with '%'.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |