Package org.apache.xalan.templates
Class ElemLiteralResult
java.lang.Object
org.apache.xml.utils.UnImplNode
org.apache.xalan.templates.ElemTemplateElement
org.apache.xalan.templates.ElemUse
org.apache.xalan.templates.ElemLiteralResult
- All Implemented Interfaces:
Serializable,SourceLocator,XSLTVisitable,PrefixResolver,ExpressionNode,WhitespaceStrippingElementMatcher,Document,Element,Node,NodeList
- Direct Known Subclasses:
ElemExtensionCall,ElemUnknown
public class ElemLiteralResult extends ElemUse
Implement a Literal Result Element.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classElemLiteralResult.AttributeclassElemLiteralResult.LiteralElementAttributes -
Field Summary
Fields inherited from class org.apache.xalan.templates.ElemTemplateElement
m_docOrderNumber, m_hasVariableDecl, m_parentNodeFields inherited from class org.apache.xml.utils.UnImplNode
actualEncoding, fDocumentURIFields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE -
Constructor Summary
Constructors Constructor Description ElemLiteralResult() -
Method Summary
Modifier and Type Method Description protected booleanaccept(XSLTVisitor visitor)Accept a visitor and call the appropriate method for this class.voidaddLiteralResultAttribute(String att)Set a literal result attribute (used for xsl attributes).voidaddLiteralResultAttribute(AVT avt)Set a literal result attribute (AVTs only).protected voidcallChildVisitors(XSLTVisitor visitor, boolean callAttrs)Call the children visitors.voidcompose(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.booleancontainsExcludeResultPrefix(String prefix, String uri)Get whether or not the passed URL is flagged by the "extension-element-prefixes" or "exclude-result-prefixes" properties.booleancontainsExtensionElementURI(String uri)Find out if the given "extension-element-prefix" property is defined.IteratorenumerateLiteralResultAttributes()Compiling templates requires that we be able to list the AVTs ADDED 9/5/2000 to support compilation experimentvoidexecute(TransformerImpl transformer)Copy a Literal Result Element into the Result tree, copy the non-excluded namespace attributes, copy the attributes not of the XSLT namespace, and execute the children of the LRE.StringgetAttribute(String rawName)Return the raw value of the attribute.StringgetAttributeNS(String namespaceURI, String localName)Return the raw value of the attribute.NamedNodeMapgetAttributes()Unimplemented.StringgetExtensionElementPrefix(int i)Get an "extension-element-prefix" property.intgetExtensionElementPrefixCount()Get the number of "extension-element-prefixes" Strings.booleangetIsLiteralResultAsStylesheet()Return whether this element represents a root element that is also the stylesheet element.AVTgetLiteralResultAttribute(String name)Get a literal result attribute by name.AVTgetLiteralResultAttributeNS(String namespaceURI, String localName)Get a literal result attribute by name.StringgetLocalName()Get the local name of the Literal Result Element.StringgetNamespace()Get the original namespace of the Literal Result Element.StringgetNodeName()Return the node name.StringgetPrefix()Get the prefix part of the raw name of the Literal Result Element.StringgetRawName()Get the raw name of the Literal Result Element.StringgetVersion()Get the "version" property.intgetXSLToken()Get an int constant identifying the type of element.voidresolvePrefixTables()Augment resolvePrefixTables, resolving the namespace aliases once the superclass has resolved the tables.voidsetExcludeResultPrefixes(StringVector v)Set the "exclude-result-prefixes" property.voidsetExtensionElementPrefixes(StringVector v)Set the "extension-element-prefixes" property.voidsetIsLiteralResultAsStylesheet(boolean b)Set whether this element represents a root element that is also the stylesheet element.voidsetLocalName(String localName)Set the local name of the LRE.voidsetNamespace(String ns)Set the namespace URI of the result element to be created.voidsetRawName(String rawName)Set the raw name of the LRE.voidsetVersion(String v)Set the "version" property.voidsetXmlSpace(AVT avt)Set the "xml:space" attribute.voidthrowDOMException(short code, String msg)Throw a DOMExceptionMethods inherited from class org.apache.xalan.templates.ElemUse
applyAttrSets, getUseAttributeSets, setUseAttributeSets, setUseAttributeSetsMethods inherited from class org.apache.xalan.templates.ElemTemplateElement
appendChild, appendChild, callChildVisitors, callVisitors, canAcceptVariables, canStripWhiteSpace, compareTo, endCompose, error, error, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, getBaseIdentifier, getChildNodes, getColumnNumber, getDeclaredPrefixes, getDOMBackPointer, getEndColumnNumber, getEndLineNumber, getFirstChild, getFirstChildElem, getLastChild, getLastChildElem, getLength, getLineNumber, getNamespaceForPrefix, getNamespaceForPrefix, getNextSibling, getNextSiblingElem, getNodeType, getOwnerDocument, getOwnerXSLTemplate, getParentElem, getParentNode, getParentNodeElem, getPreviousSibling, getPreviousSiblingElem, getPublicId, getStylesheet, getStylesheetComposed, getStylesheetRoot, getSystemId, getTagName, getUid, getXmlSpace, handlesNullPrefixes, hasChildNodes, hasTextLitOnly, hasVariableDecl, insertBefore, isCompiledTemplate, item, recompose, removeChild, replaceChild, replaceChild, runtimeInit, setDOMBackPointer, setEndLocaterInfo, setLocaterInfo, setParentElem, setPrefixes, setPrefixes, setUid, setXmlSpace, shouldStripWhiteSpaceMethods inherited from class org.apache.xml.utils.UnImplNode
adoptNode, appendData, cloneNode, compareDocumentPosition, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, getActualEncoding, getAttributeNode, getAttributeNodeNS, getBaseURI, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getFeature, getImplementation, getInputEncoding, getNamespaceURI, getNodeValue, getOwnerElement, getSchemaTypeInfo, getSpecified, getStrictErrorChecking, getTextContent, getUserData, getWholeText, getXmlEncoding, getXmlStandalone, getXmlVersion, hasAttribute, hasAttributeNS, hasAttributes, importNode, insertData, isDefaultNamespace, isEqualNode, isId, isSameNode, isSupported, isWhitespaceInElementContent, lookupNamespaceURI, lookupPrefix, normalize, normalizeDocument, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, renameNode, replaceData, replaceWholeText, setActualEncoding, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setDocumentURI, setIdAttribute, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setInputEncoding, setNodeValue, setPrefix, setStrictErrorChecking, setTextContent, setUserData, setValue, setXmlEncoding, setXmlStandalone, setXmlVersion, splitText, substringData
-
Constructor Details
-
ElemLiteralResult
public ElemLiteralResult()
-
-
Method Details
-
setIsLiteralResultAsStylesheet
public void setIsLiteralResultAsStylesheet(boolean b)Set whether this element represents a root element that is also the stylesheet element.- Parameters:
b- boolean flag indicating whether this element represents a root element that is also the stylesheet element.
-
getIsLiteralResultAsStylesheet
public boolean getIsLiteralResultAsStylesheet()Return whether this element represents a root element that is also the stylesheet element.- Returns:
- boolean flag indicating whether this element represents a root element that is also the stylesheet element.
-
compose
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.- Overrides:
composein classElemTemplateElement- Throws:
TransformerException
-
addLiteralResultAttribute
Set a literal result attribute (AVTs only).- Parameters:
avt- literal result attribute to add (AVT only)
-
addLiteralResultAttribute
Set a literal result attribute (used for xsl attributes).- Parameters:
att- literal result attribute to add
-
setXmlSpace
Set the "xml:space" attribute. A text node is preserved if an ancestor element of the text node has an xml:space attribute with a value of preserve, and no closer ancestor element has xml:space with a value of default.- Parameters:
avt- Enumerated value, either Constants.ATTRVAL_PRESERVE or Constants.ATTRVAL_STRIP.- See Also:
- strip in XSLT Specification, section-Creating-Text in XSLT Specification
-
getLiteralResultAttributeNS
Get a literal result attribute by name.- Parameters:
namespaceURI- Namespace URI of attribute node to getlocalName- Local part of qualified name of attribute node to get- Returns:
- literal result attribute (AVT)
-
getAttributeNS
Return the raw value of the attribute.- Specified by:
getAttributeNSin interfaceElement- Overrides:
getAttributeNSin classUnImplNode- Parameters:
namespaceURI- Namespace URI of attribute node to getlocalName- Local part of qualified name of attribute node to get- Returns:
- The Attr value as a string, or the empty string if that attribute does not have a specified or default value
-
getLiteralResultAttribute
Get a literal result attribute by name. The name is namespaceURI:localname if namespace is not null.- Parameters:
name- Name of literal result attribute to get- Returns:
- literal result attribute (AVT)
-
getAttribute
Return the raw value of the attribute.- Specified by:
getAttributein interfaceElement- Overrides:
getAttributein classUnImplNode- Parameters:
namespaceURI- :localName or localName if the namespaceURI is null of the attribute to get- Returns:
- The Attr value as a string, or the empty string if that attribute does not have a specified or default value
-
containsExcludeResultPrefix
Get whether or not the passed URL is flagged by the "extension-element-prefixes" or "exclude-result-prefixes" properties.- Overrides:
containsExcludeResultPrefixin classElemTemplateElement- Parameters:
prefix- non-null reference to prefix that might be excluded.(not currently used)uri- reference to namespace that prefix maps to- Returns:
- true if the prefix should normally be excluded.
- See Also:
- extension-element in XSLT Specification
-
resolvePrefixTables
Augment resolvePrefixTables, resolving the namespace aliases once the superclass has resolved the tables.- Overrides:
resolvePrefixTablesin classElemTemplateElement- Throws:
TransformerException
-
setNamespace
Set the namespace URI of the result element to be created. Note that after resolvePrefixTables has been called, this will return the aliased result namespace, not the original stylesheet namespace.- Parameters:
ns- The Namespace URI, or the empty string if the element has no Namespace URI.
-
getNamespace
Get the original namespace of the Literal Result Element. %REVIEW% Why isn't this overriding the getNamespaceURI method rather than introducing a new one?- Returns:
- The Namespace URI, or the empty string if the element has no Namespace URI.
-
setLocalName
Set the local name of the LRE.- Parameters:
localName- The local name (without prefix) of the result element to be created.
-
getLocalName
Get the local name of the Literal Result Element. Note that after resolvePrefixTables has been called, this will return the aliased name prefix, not the original stylesheet namespace prefix.- Specified by:
getLocalNamein interfaceNode- Overrides:
getLocalNamein classElemTemplateElement- Returns:
- The local name (without prefix) of the result element to be created.
-
setRawName
Set the raw name of the LRE.- Parameters:
rawName- The qualified name (with prefix), or the empty string if qualified names are not available.
-
getRawName
Get the raw name of the Literal Result Element.- Returns:
- The qualified name (with prefix), or the empty string if qualified names are not available.
-
getPrefix
Get the prefix part of the raw name of the Literal Result Element.- Specified by:
getPrefixin interfaceNode- Overrides:
getPrefixin classUnImplNode- Returns:
- The prefix, or the empty string if noprefix was provided.
-
setExtensionElementPrefixes
Set the "extension-element-prefixes" property.- Parameters:
v- Vector of URIs (not prefixes) to set as the "extension-element-prefixes" property- See Also:
- extension-element in XSLT Specification
-
getAttributes
Description copied from class:UnImplNodeUnimplemented. See org.w3c.dom.Node- Specified by:
getAttributesin interfaceNode- Overrides:
getAttributesin classUnImplNode- Returns:
- NamedNodeMap
- See Also:
Node
-
getExtensionElementPrefix
Get an "extension-element-prefix" property.- Parameters:
i- Index of URI ("extension-element-prefix" property) to get- Returns:
- URI at given index ("extension-element-prefix" property)
- Throws:
ArrayIndexOutOfBoundsException- See Also:
- extension-element in XSLT Specification
-
getExtensionElementPrefixCount
public int getExtensionElementPrefixCount()Get the number of "extension-element-prefixes" Strings.- Returns:
- the number of "extension-element-prefixes" Strings
- See Also:
- extension-element in XSLT Specification
-
containsExtensionElementURI
Find out if the given "extension-element-prefix" property is defined.- Parameters:
uri- The URI to find- Returns:
- True if the given URI is found
- See Also:
- extension-element in XSLT Specification
-
getXSLToken
public int getXSLToken()Get an int constant identifying the type of element.- Overrides:
getXSLTokenin classElemTemplateElement- Returns:
- The token ID for this element
- See Also:
Constants
-
getNodeName
Return the node name.- Specified by:
getNodeNamein interfaceNode- Overrides:
getNodeNamein classElemTemplateElement- Returns:
- The element's name
-
setVersion
Set the "version" property.- Parameters:
v- Version property value to set- See Also:
- forwards in XSLT Specification
-
getVersion
Get the "version" property.- Returns:
- Version property value
- See Also:
- forwards in XSLT Specification
-
setExcludeResultPrefixes
Set the "exclude-result-prefixes" property. The designation of a namespace as an excluded namespace is effective within the subtree of the stylesheet rooted at the element bearing the exclude-result-prefixes or xsl:exclude-result-prefixes attribute; a subtree rooted at an xsl:stylesheet element does not include any stylesheets imported or included by children of that xsl:stylesheet element.- Parameters:
v- vector of prefixes that are resolvable to strings.- See Also:
- literal-result-element in XSLT Specification
-
execute
Copy a Literal Result Element into the Result tree, copy the non-excluded namespace attributes, copy the attributes not of the XSLT namespace, and execute the children of the LRE.- Overrides:
executein classElemUse- Parameters:
transformer- non-null reference to the the current transform-time state.- Throws:
TransformerException- See Also:
- literal-result-element in XSLT Specification
-
enumerateLiteralResultAttributes
Compiling templates requires that we be able to list the AVTs ADDED 9/5/2000 to support compilation experiment- Returns:
- an Enumeration of the literal result attributes associated with this element.
-
accept
Accept a visitor and call the appropriate method for this class.- Overrides:
acceptin classElemTemplateElement- Parameters:
visitor- The visitor whose appropriate method will be called.- Returns:
- true if the children of the object should be visited.
-
callChildVisitors
Call the children visitors.- Overrides:
callChildVisitorsin classElemTemplateElement- Parameters:
visitor- The visitor whose appropriate method will be called.
-
throwDOMException
Throw a DOMException- Parameters:
msg- key of the error that occured.
-