|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xml.utils.UnImplNode org.apache.xalan.templates.ElemTemplateElement
An instance of this class represents an element inside an xsl:template class. It has a single "execute" method which is expected to perform the given action on the result tree. This class acts like a Element node, and implements the Element interface, but is not a full implementation of that interface... it only implements enough for basic traversal of the tree.
Stylesheet
,
Serialized FormField Summary | |
private int |
m_columnNumber
the column number where the current document event ends. |
private Vector |
m_declaredPrefixes
The list of namespace declarations for this element only. |
private boolean |
m_defaultSpace
Tell if this element has the default space handling turned off or on according to the xml:space attribute. |
protected int |
m_docOrderNumber
The *relative* document order number of this element. |
private org.w3c.dom.Node |
m_DOMBackPointer
DOM backpointer that this element originated from. |
(package private) ElemTemplateElement |
m_firstChild
First child. |
private boolean |
m_hasTextLitOnly
Tell if this element only has one text child, for optimization purposes. |
protected boolean |
m_hasVariableDecl
Tell if this element only has one text child, for optimization purposes. |
private int |
m_lineNumber
line number where the current document event ends. |
(package private) ElemTemplateElement |
m_nextSibling
Next sibling. |
protected ElemTemplateElement |
m_parentNode
Parent node. |
(package private) Vector |
m_prefixTable
The table of XMLNSDecl s for this element
and all parent elements, screened for excluded prefixes. |
Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Constructor Summary | |
ElemTemplateElement()
Construct a template element instance. |
Method Summary | |
protected boolean |
accept(XSLTVisitor visitor)
Accept a visitor and call the appropriate method for this class. |
(package private) void |
addOrReplaceDecls(XMLNSDecl newDecl)
Add or replace this namespace declaration in list of namespaces in scope for this element. |
ElemTemplateElement |
appendChild(ElemTemplateElement elem)
Add a child to the child list. |
org.w3c.dom.Node |
appendChild(org.w3c.dom.Node newChild)
Add a child to the child list. |
protected void |
callChildVisitors(XSLTVisitor visitor)
Call the children visitors. |
protected void |
callChildVisitors(XSLTVisitor visitor,
boolean callAttributes)
Call the children visitors. |
void |
callVisitors(XSLTVisitor visitor)
This will traverse the heararchy, calling the visitor for each member. |
boolean |
canAcceptVariables()
Tell if this element can accept variable declarations. |
boolean |
canStripWhiteSpace()
Get information about whether or not whitespace can be stripped. |
int |
compareTo(Object o)
Compares this object with the specified object for precedence order. |
void |
compose(StylesheetRoot sroot)
This function is called after everything else has been recomposed, and allows the template to set remaining values that may be based on some other property that depends on recomposition. |
boolean |
containsExcludeResultPrefix(String prefix,
String uri)
Get whether or not the passed URL is contained flagged by the "extension-element-prefixes" property. |
void |
endCompose(StylesheetRoot sroot)
This after the template's children have been composed. |
void |
error(String msg)
Throw an error. |
void |
error(String msg,
Object[] args)
Throw a template element runtime error. |
private boolean |
excludeResultNSDecl(String prefix,
String uri)
Tell if the result namespace decl should be excluded. |
void |
execute(TransformerImpl transformer)
Execute the element's primary function. |
(package private) void |
executeNSDecls(TransformerImpl transformer)
Send startPrefixMapping events to the result tree handler for all declared prefix mappings in the stylesheet. |
(package private) void |
executeNSDecls(TransformerImpl transformer,
String ignorePrefix)
Send startPrefixMapping events to the result tree handler for all declared prefix mappings in the stylesheet. |
void |
exprAddChild(ExpressionNode n,
int i)
This method tells the node to add its argument to the node's list of children. |
ExpressionNode |
exprGetChild(int i)
This method returns a child node. |
int |
exprGetNumChildren()
Return the number of children the node has. |
ExpressionNode |
exprGetParent()
Get the ExpressionNode parent of this node. |
void |
exprSetParent(ExpressionNode n)
Set the parent of this node. |
String |
getBaseIdentifier()
Return the base identifier. |
org.w3c.dom.NodeList |
getChildNodes()
Return the nodelist (same reference). |
int |
getColumnNumber()
Return the column number where the current document event ends. |
Vector |
getDeclaredPrefixes()
Return a table that contains all prefixes available within this element context. |
org.w3c.dom.Node |
getDOMBackPointer()
If this stylesheet was created from a DOM, get the DOM backpointer that this element originated from. |
org.w3c.dom.Node |
getFirstChild()
Get the first child as a Node. |
ElemTemplateElement |
getFirstChildElem()
Get the first child as a ElemTemplateElement. |
org.w3c.dom.Node |
getLastChild()
Get the last child. |
ElemTemplateElement |
getLastChildElem()
Get the last child. |
int |
getLength()
NodeList method: Count the immediate children of this node |
int |
getLineNumber()
Return the line number where the current document event ends. |
String |
getLocalName()
For now, just return the result of getNodeName(), which the local name. |
String |
getNamespaceForPrefix(String prefix)
Given a namespace, get the corrisponding prefix. 9/15/00: This had been iteratively examining the m_declaredPrefixes field for this node and its parents. |
String |
getNamespaceForPrefix(String prefix,
org.w3c.dom.Node context)
Fullfill the PrefixResolver interface. |
org.w3c.dom.Node |
getNextSibling()
Get the next sibling (as a Node) or return null. |
ElemTemplateElement |
getNextSiblingElem()
Get the next sibling (as a ElemTemplateElement) or return null. |
String |
getNodeName()
Return the node name. |
short |
getNodeType()
Get the type of the node. |
org.w3c.dom.Document |
getOwnerDocument()
Get the stylesheet owner. |
ElemTemplate |
getOwnerXSLTemplate()
Get the owning xsl:template element. |
ElemTemplateElement |
getParentElem()
Get the parent as an ElemTemplateElement. |
org.w3c.dom.Node |
getParentNode()
Get the parent as a Node. |
ElemTemplateElement |
getParentNodeElem()
Get the parent element. |
Vector |
getPrefixes()
Return a table that contains all prefixes available within this element context. |
org.w3c.dom.Node |
getPreviousSibling()
Get the previous sibling (as a Node) or return null. |
ElemTemplateElement |
getPreviousSiblingElem()
Get the previous sibling (as a Node) or return null. |
String |
getPublicId()
Return the public identifier for the current document event. |
Stylesheet |
getStylesheet()
Get the owning stylesheet. |
StylesheetComposed |
getStylesheetComposed()
Get the owning "composed" stylesheet. |
StylesheetRoot |
getStylesheetRoot()
Get the owning root stylesheet. |
String |
getSystemId()
Return the system identifier for the current document event. |
String |
getTagName()
Return the element name. |
int |
getUid()
Get the UID (document order index). |
boolean |
getXmlSpace()
Get the "xml:space" attribute. |
int |
getXSLToken()
Get an integer representation of the element type. |
boolean |
handlesNullPrefixes()
|
boolean |
hasChildNodes()
Tell if there are child nodes. |
boolean |
hasTextLitOnly()
Tell if this element only has one text child, for optimization purposes. |
boolean |
hasVariableDecl()
|
org.w3c.dom.Node |
insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
Unimplemented. |
boolean |
isCompiledTemplate()
Tell if this template is a compiled template. |
protected boolean |
isValidNCName(String s)
Validate that the string is an NCName. |
org.w3c.dom.Node |
item(int index)
NodeList method: Return the Nth immediate child of this node, or null if the index is out of bounds. |
(package private) boolean |
needToCheckExclude()
Return whether we need to check namespace prefixes against and exclude result prefixes list. |
void |
recompose(StylesheetRoot root)
This function is called during recomposition to control how this element is composed. |
ElemTemplateElement |
removeChild(ElemTemplateElement childETE)
Remove a child. |
ElemTemplateElement |
replaceChild(ElemTemplateElement newChildElem,
ElemTemplateElement oldChildElem)
Replace the old child with a new child. |
org.w3c.dom.Node |
replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild)
Replace the old child with a new child. |
void |
resolvePrefixTables()
Combine the parent's namespaces with this namespace for fast processing, taking care to reference the parent's namespace if this namespace adds nothing new. |
void |
runtimeInit(TransformerImpl transformer)
This function will be called on top-level elements only, just before the transform begins. |
void |
setDOMBackPointer(org.w3c.dom.Node n)
If this stylesheet was created from a DOM, set the DOM backpointer that this element originated from. |
void |
setLocaterInfo(javax.xml.transform.SourceLocator locator)
Set the location information for this element. |
void |
setParentElem(ElemTemplateElement p)
Set the parent as an ElemTemplateElement. |
void |
setPrefixes(org.xml.sax.helpers.NamespaceSupport nsSupport)
From the SAX2 helper class, set the namespace table for this element. |
void |
setPrefixes(org.xml.sax.helpers.NamespaceSupport nsSupport,
boolean excludeXSLDecl)
Copy the namespace declarations from the NamespaceSupport object. |
void |
setUid(int i)
Set the UID (document order index). |
void |
setXmlSpace(int v)
Set the "xml:space" attribute. |
boolean |
shouldStripWhiteSpace(XPathContext support,
org.w3c.dom.Element targetElement)
Get information about whether or not an element should strip whitespace. |
(package private) void |
unexecuteNSDecls(TransformerImpl transformer)
Send endPrefixMapping events to the result tree handler for all declared prefix mappings in the stylesheet. |
(package private) void |
unexecuteNSDecls(TransformerImpl transformer,
String ignorePrefix)
Send endPrefixMapping events to the result tree handler for all declared prefix mappings in the stylesheet. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private int m_lineNumber
private int m_columnNumber
private boolean m_defaultSpace
private boolean m_hasTextLitOnly
protected boolean m_hasVariableDecl
private Vector m_declaredPrefixes
Vector m_prefixTable
XMLNSDecl
s for this element
and all parent elements, screened for excluded prefixes.
protected int m_docOrderNumber
protected ElemTemplateElement m_parentNode
ElemTemplateElement m_nextSibling
ElemTemplateElement m_firstChild
private transient org.w3c.dom.Node m_DOMBackPointer
Constructor Detail |
public ElemTemplateElement()
Method Detail |
public boolean isCompiledTemplate()
public int getXSLToken()
Constants
public String getNodeName()
getNodeName
in interface org.w3c.dom.Node
getNodeName
in class UnImplNode
public String getLocalName()
getLocalName
in interface org.w3c.dom.Node
getLocalName
in class UnImplNode
public void runtimeInit(TransformerImpl transformer) throws javax.xml.transform.TransformerException
transformer
- The XSLT TransformerFactory.
javax.xml.transform.TransformerException
public void execute(TransformerImpl transformer) throws javax.xml.transform.TransformerException
transformer
- The XSLT TransformerFactory.
javax.xml.transform.TransformerException
- if any checked exception occurs.public StylesheetComposed getStylesheetComposed()
public Stylesheet getStylesheet()
public StylesheetRoot getStylesheetRoot()
public void recompose(StylesheetRoot root) throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
public void compose(StylesheetRoot sroot) throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
public void endCompose(StylesheetRoot sroot) throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
protected boolean isValidNCName(String s)
s
- The name in question.
public void error(String msg, Object[] args)
error
in class UnImplNode
msg
- key of the error that occured.args
- Arguments to be used in the messagepublic void error(String msg)
UnImplNode
error
in class UnImplNode
msg
- Message Key for the errorpublic org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws org.w3c.dom.DOMException
appendChild
in interface org.w3c.dom.Node
appendChild
in class UnImplNode
newChild
- Child to be added to child list
org.w3c.dom.DOMException
public ElemTemplateElement appendChild(ElemTemplateElement elem)
public boolean hasChildNodes()
hasChildNodes
in interface org.w3c.dom.Node
hasChildNodes
in class UnImplNode
public short getNodeType()
getNodeType
in interface org.w3c.dom.Node
getNodeType
in class UnImplNode
public org.w3c.dom.NodeList getChildNodes()
getChildNodes
in interface org.w3c.dom.Node
getChildNodes
in class UnImplNode
public ElemTemplateElement removeChild(ElemTemplateElement childETE)
childETE
- The child to remove. This operation is a no-op
if oldChild is not a child of this node.
public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
replaceChild
in interface org.w3c.dom.Node
replaceChild
in class UnImplNode
newChild
- New child to replace witholdChild
- Old child to be replaced
org.w3c.dom.DOMException
public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild) throws org.w3c.dom.DOMException
insertBefore
in interface org.w3c.dom.Node
insertBefore
in class UnImplNode
newChild
- New child node to insertrefChild
- Insert in front of this child
org.w3c.dom.DOMException
public ElemTemplateElement replaceChild(ElemTemplateElement newChildElem, ElemTemplateElement oldChildElem)
org.w3c.dom.DOMException
public int getLength()
getLength
in interface org.w3c.dom.NodeList
getLength
in class UnImplNode
public org.w3c.dom.Node item(int index)
item
in interface org.w3c.dom.NodeList
item
in class UnImplNode
index
- Index of child to find
public org.w3c.dom.Document getOwnerDocument()
getOwnerDocument
in interface org.w3c.dom.Node
getOwnerDocument
in class UnImplNode
public ElemTemplate getOwnerXSLTemplate()
public String getTagName()
getTagName
in interface org.w3c.dom.Element
getTagName
in class UnImplNode
public boolean hasTextLitOnly()
public String getBaseIdentifier()
getBaseIdentifier
in interface PrefixResolver
public int getLineNumber()
getLineNumber
in interface javax.xml.transform.SourceLocator
getColumnNumber()
public int getColumnNumber()
getColumnNumber
in interface javax.xml.transform.SourceLocator
getLineNumber()
public String getPublicId()
This will be the public identifier
getPublicId
in interface javax.xml.transform.SourceLocator
getSystemId()
public String getSystemId()
If the system identifier is a URL, the parser must resolve it fully before passing it to the application.
getSystemId
in interface javax.xml.transform.SourceLocator
getPublicId()
public void setLocaterInfo(javax.xml.transform.SourceLocator locator)
locator
- Source Locator with location information for this elementpublic boolean hasVariableDecl()
public void setXmlSpace(int v)
v
- Enumerated value, either Constants.ATTRVAL_PRESERVE
or Constants.ATTRVAL_STRIP.public boolean getXmlSpace()
public Vector getDeclaredPrefixes()
public void setPrefixes(org.xml.sax.helpers.NamespaceSupport nsSupport) throws javax.xml.transform.TransformerException
nsSupport
- non-null reference to NamespaceSupport from
the ContentHandler.
javax.xml.transform.TransformerException
public void setPrefixes(org.xml.sax.helpers.NamespaceSupport nsSupport, boolean excludeXSLDecl) throws javax.xml.transform.TransformerException
nsSupport
- non-null reference to NamespaceSupport from
the ContentHandler.excludeXSLDecl
- true if XSLT namespaces should be ignored.
javax.xml.transform.TransformerException
public String getNamespaceForPrefix(String prefix, org.w3c.dom.Node context)
getNamespaceForPrefix
in interface PrefixResolver
prefix
- The prefix to look up, which may be an empty string ("")
for the default Namespace.context
- The node context from which to look up the URI.
public String getNamespaceForPrefix(String prefix)
getNamespaceForPrefix
in interface PrefixResolver
prefix
- non-null reference to prefix string, which should map
to a namespace URL.
public Vector getPrefixes()
XMLNSDecl
s, which may be null.public boolean containsExcludeResultPrefix(String prefix, String uri)
ElemLiteralResult.containsExcludeResultPrefix(java.lang.String, java.lang.String)
.
prefix
- non-null reference to prefix that might be excluded.
private boolean excludeResultNSDecl(String prefix, String uri) throws javax.xml.transform.TransformerException
prefix
- non-null reference to prefix.uri
- reference to namespace that prefix maps to, which is protected
for null, but should really never be passed as null.
javax.xml.transform.TransformerException
public void resolvePrefixTables() throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
void addOrReplaceDecls(XMLNSDecl newDecl)
newDecl
- namespace declaration to add to listboolean needToCheckExclude()
void executeNSDecls(TransformerImpl transformer) throws javax.xml.transform.TransformerException
transformer
- non-null reference to the the current transform-time state.
javax.xml.transform.TransformerException
void executeNSDecls(TransformerImpl transformer, String ignorePrefix) throws javax.xml.transform.TransformerException
transformer
- non-null reference to the the current transform-time state.ignorePrefix
- string prefix to not startPrefixMapping
javax.xml.transform.TransformerException
void unexecuteNSDecls(TransformerImpl transformer) throws javax.xml.transform.TransformerException
transformer
- non-null reference to the the current transform-time state.
javax.xml.transform.TransformerException
void unexecuteNSDecls(TransformerImpl transformer, String ignorePrefix) throws javax.xml.transform.TransformerException
transformer
- non-null reference to the the current transform-time state.ignorePrefix
- string prefix to not endPrefixMapping
javax.xml.transform.TransformerException
public void setUid(int i)
public int getUid()
public org.w3c.dom.Node getParentNode()
getParentNode
in interface org.w3c.dom.Node
getParentNode
in class UnImplNode
public ElemTemplateElement getParentElem()
public void setParentElem(ElemTemplateElement p)
public org.w3c.dom.Node getNextSibling()
getNextSibling
in interface org.w3c.dom.Node
getNextSibling
in class UnImplNode
public org.w3c.dom.Node getPreviousSibling()
getPreviousSibling
in interface org.w3c.dom.Node
getPreviousSibling
in class UnImplNode
public ElemTemplateElement getPreviousSiblingElem()
public ElemTemplateElement getNextSiblingElem()
public ElemTemplateElement getParentNodeElem()
public org.w3c.dom.Node getFirstChild()
getFirstChild
in interface org.w3c.dom.Node
getFirstChild
in class UnImplNode
public ElemTemplateElement getFirstChildElem()
public org.w3c.dom.Node getLastChild()
getLastChild
in interface org.w3c.dom.Node
getLastChild
in class UnImplNode
public ElemTemplateElement getLastChildElem()
public org.w3c.dom.Node getDOMBackPointer()
public void setDOMBackPointer(org.w3c.dom.Node n)
n
- DOM backpointer that this element originated from.public int compareTo(Object o) throws ClassCastException
o
- The object to be compared to this object
ClassCastException
- if the specified object's
type prevents it from being compared to this Object.public boolean shouldStripWhiteSpace(XPathContext support, org.w3c.dom.Element targetElement) throws javax.xml.transform.TransformerException
shouldStripWhiteSpace
in interface WhitespaceStrippingElementMatcher
support
- The XPath runtime state.targetElement
- Element to check
javax.xml.transform.TransformerException
public boolean canStripWhiteSpace()
canStripWhiteSpace
in interface WhitespaceStrippingElementMatcher
public boolean canAcceptVariables()
public void exprSetParent(ExpressionNode n)
exprSetParent
in interface ExpressionNode
n
- Must be a ElemTemplateElement.public ExpressionNode exprGetParent()
exprGetParent
in interface ExpressionNode
public void exprAddChild(ExpressionNode n, int i)
exprAddChild
in interface ExpressionNode
n
- Must be a ElemTemplateElement.public ExpressionNode exprGetChild(int i)
exprGetChild
in interface ExpressionNode
public int exprGetNumChildren()
exprGetNumChildren
in interface ExpressionNode
protected boolean accept(XSLTVisitor visitor)
visitor
- The visitor whose appropriate method will be called.
public void callVisitors(XSLTVisitor visitor)
XSLTVisitable
callVisitors
in interface XSLTVisitable
visitor
- The visitor whose appropriate method will be called.XSLTVisitable.callVisitors(XSLTVisitor)
protected void callChildVisitors(XSLTVisitor visitor, boolean callAttributes)
visitor
- The visitor whose appropriate method will be called.protected void callChildVisitors(XSLTVisitor visitor)
visitor
- The visitor whose appropriate method will be called.public boolean handlesNullPrefixes()
handlesNullPrefixes
in interface PrefixResolver
PrefixResolver.handlesNullPrefixes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |