com.lotus.xsl
Interface XMLParserLiaison

All Known Implementing Classes:
XMLParserLiaisonDefault

public abstract interface XMLParserLiaison

An implementation of this interface acts as a liaison between the XSL processor and the XML parser. It is needed in order to support features like included files, and to cover for deficiencies in the DOM. An implementation of this interface is a requirement for the XSL processor.


Method Summary
 com.lotus.xsl.Document createDocument()
          Create an empty DOM Document.
 com.lotus.xsl.Element getElementByID(java.lang.String id, com.lotus.xsl.Document doc)
          Given an ID, return the element.
 java.lang.String getExpandedAttributeName(com.lotus.xsl.Attr attr)
          Returns the attribute name with the namespace expanded.
 java.lang.String getExpandedElementName(com.lotus.xsl.Element elem)
          Return the expanded element name.
 int getIndent()
          Get the amount to indent when indent-result="yes".
 java.lang.String getLocalNameOfNode(com.lotus.xsl.Node n)
          Returns the local name of the given node.
 java.lang.String getNamespaceForPrefix(java.lang.String prefix, com.lotus.xsl.Element namespaceContext)
          Given a prefix and a namespace context, return the expanded namespace.
 java.lang.String getNamespaceOfNode(com.lotus.xsl.Node n)
          Returns the namespace of the given node.
 com.lotus.xsl.Node getParentOfNode(com.lotus.xsl.Node node)
          This function has to be implemented, because the DOM WG decided that attributes don't have parents.
 java.lang.String getParserDescription()
          Return a string suitible for telling the user what parser is being used.
 boolean getShouldExpandEntityRefs()
          Get whether or not to expand all entity references in the source and style trees.
 java.lang.String getSpecialCharacters()
          Get special characters for attributes that will be escaped.
 boolean getUseValidation()
          Get whether or not validation will be performed.
 boolean isIgnorableWhitespace(com.lotus.xsl.Text node)
          Tell if the node is ignorable whitespace.
 com.lotus.xsl.Document parseXMLStream(java.io.Reader reader)
          Parse the text pointed at by the reader as XML, and return a DOM Document interface.
 com.lotus.xsl.Document parseXMLStream(java.io.Reader reader, java.lang.String identifier)
          Parse the text pointed at by the reader as XML, and return a DOM Document interface.
 com.lotus.xsl.Document parseXMLStream(java.net.URL url)
          Parse the text pointed at by the URL as XML, and return a DOM Document interface.
 void setIndent(int i)
          Set the amount to indent when indent-result="yes".
 void setProcessorOwner(XSLProcessor processor)
          Set which processor this instance is associated with.
 void SetShouldExpandEntityRefs(boolean b)
          Set whether or not to expand all entity references in the source and style trees.
 void setSpecialCharacters(java.lang.String str)
          Set special characters for attributes that will be escaped.
 void setUseValidation(boolean b)
          If set to true, validation will be performed.
 

Method Detail

setProcessorOwner

public void setProcessorOwner(XSLProcessor processor)
Set which processor this instance is associated with. This must be set, but should normally by called by the XSLProcessor class.

parseXMLStream

public com.lotus.xsl.Document parseXMLStream(java.io.Reader reader)
                                      throws java.io.IOException,
                                             XSLProcessorException
Parse the text pointed at by the reader as XML, and return a DOM Document interface. May return null if not supported.
Parameters:
reader - A stream that should hold valid XML.
Throws:
java.io.IOException - thrown if unable to open the XML stream.
XSLProcessorException - thrown for all other error conditions.

parseXMLStream

public com.lotus.xsl.Document parseXMLStream(java.io.Reader reader,
                                             java.lang.String identifier)
                                      throws java.io.IOException,
                                             XSLProcessorException
Parse the text pointed at by the reader as XML, and return a DOM Document interface. May return null if not supported. It is recommended that you pass in some sort of recognizable name, such as the filename or URI, with which the reader can be recognized if the parse fails.
Parameters:
reader - A stream that should hold valid XML.
identifier - Used for diagnostic purposes only, some sort of identification for error reporting, may be null or empty string.
Throws:
java.io.IOException - thrown if unable to open the XML stream.
XSLProcessorException - thrown for all other error conditions.

parseXMLStream

public com.lotus.xsl.Document parseXMLStream(java.net.URL url)
                                      throws java.io.IOException,
                                             XSLProcessorException
Parse the text pointed at by the URL as XML, and return a DOM Document interface. May return null if not supported.
Parameters:
url - A URI to a valid XML document.
Throws:
java.io.IOException - thrown if unable to open the XML stream.
XSLProcessorException - thrown for all other error conditions.

createDocument

public com.lotus.xsl.Document createDocument()
Create an empty DOM Document. Mainly used for creating an output document.

getExpandedElementName

public java.lang.String getExpandedElementName(com.lotus.xsl.Element elem)
Return the expanded element name.

getExpandedAttributeName

public java.lang.String getExpandedAttributeName(com.lotus.xsl.Attr attr)
Returns the attribute name with the namespace expanded.

getNamespaceForPrefix

public java.lang.String getNamespaceForPrefix(java.lang.String prefix,
                                              com.lotus.xsl.Element namespaceContext)
Given a prefix and a namespace context, return the expanded namespace.

getNamespaceOfNode

public java.lang.String getNamespaceOfNode(com.lotus.xsl.Node n)
Returns the namespace of the given node.

getLocalNameOfNode

public java.lang.String getLocalNameOfNode(com.lotus.xsl.Node n)
Returns the local name of the given node.

isIgnorableWhitespace

public boolean isIgnorableWhitespace(com.lotus.xsl.Text node)
Tell if the node is ignorable whitespace. This should be in the DOM. Return false if the parser doesn't handle this.

getParentOfNode

public com.lotus.xsl.Node getParentOfNode(com.lotus.xsl.Node node)
This function has to be implemented, because the DOM WG decided that attributes don't have parents. If LotusXSL is used with a DOM implementation that reuses attribute nodes, this will not work correctly.

getElementByID

public com.lotus.xsl.Element getElementByID(java.lang.String id,
                                            com.lotus.xsl.Document doc)
Given an ID, return the element.

setSpecialCharacters

public void setSpecialCharacters(java.lang.String str)
Set special characters for attributes that will be escaped.

getSpecialCharacters

public java.lang.String getSpecialCharacters()
Get special characters for attributes that will be escaped.

getIndent

public int getIndent()
Get the amount to indent when indent-result="yes".

setIndent

public void setIndent(int i)
Set the amount to indent when indent-result="yes".

getShouldExpandEntityRefs

public boolean getShouldExpandEntityRefs()
Get whether or not to expand all entity references in the source and style trees.

SetShouldExpandEntityRefs

public void SetShouldExpandEntityRefs(boolean b)
Set whether or not to expand all entity references in the source and style trees.

getUseValidation

public boolean getUseValidation()
Get whether or not validation will be performed. Validation is off by default.

setUseValidation

public void setUseValidation(boolean b)
If set to true, validation will be performed. Validation is off by default.

getParserDescription

public java.lang.String getParserDescription()
Return a string suitible for telling the user what parser is being used.