org.apache.xalan.templates
Class ElemUse

java.lang.Object
  extended by org.apache.xml.utils.UnImplNode
      extended by org.apache.xalan.templates.ElemTemplateElement
          extended by org.apache.xalan.templates.ElemUse
All Implemented Interfaces:
java.io.Serializable, javax.xml.transform.SourceLocator, XSLTVisitable, PrefixResolver, ExpressionNode, WhitespaceStrippingElementMatcher, org.w3c.dom.Document, org.w3c.dom.Element, org.w3c.dom.Node, org.w3c.dom.NodeList
Direct Known Subclasses:
ElemAttributeSet, ElemCopy, ElemElement, ElemLiteralResult

public class ElemUse
extends ElemTemplateElement

Implement xsl:use. This acts as a superclass for ElemCopy, ElemAttributeSet, ElemElement, and ElemLiteralResult, on order to implement shared behavior the use-attribute-sets attribute.

See Also:
attribute-sets in XSLT Specification, Serialized Form

Field Summary
private  QName[] m_attributeSetsNames
          The value of the "use-attribute-sets" attribute.
(package private) static long serialVersionUID
           
 
Fields inherited from class org.apache.xalan.templates.ElemTemplateElement
m_docOrderNumber, m_firstChild, m_hasVariableDecl, m_nextSibling, m_parentNode
 
Fields inherited from class org.apache.xml.utils.UnImplNode
actualEncoding, fDocumentURI
 
Fields 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
 
Fields 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
 
Fields 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
ElemUse()
           
 
Method Summary
 void applyAttrSets(TransformerImpl transformer, StylesheetRoot stylesheet)
          Add the attributes from the named attribute sets to the attribute list.
private  void applyAttrSets(TransformerImpl transformer, StylesheetRoot stylesheet, QName[] attributeSetsNames)
          Add the attributes from the named attribute sets to the attribute list.
 void execute(TransformerImpl transformer)
          Copy attributes specified by use-attribute-sets to the result tree.
 QName[] getUseAttributeSets()
          Get the "use-attribute-sets" attribute.
 void setUseAttributeSets(QName[] v)
          Set the "use-attribute-sets" attribute.
 void setUseAttributeSets(java.util.Vector v)
          Set the "use-attribute-sets" attribute.
 
Methods inherited from class org.apache.xalan.templates.ElemTemplateElement
accept, addOrReplaceDecls, appendChild, appendChild, callChildVisitors, callChildVisitors, callVisitors, canAcceptVariables, canStripWhiteSpace, compareTo, compose, containsExcludeResultPrefix, endCompose, error, error, executeNSDecls, executeNSDecls, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, getBaseIdentifier, getChildNodes, getColumnNumber, getDeclaredPrefixes, getDOMBackPointer, getEndColumnNumber, getEndLineNumber, getFirstChild, getFirstChildElem, getLastChild, getLastChildElem, getLength, getLineNumber, getLocalName, getNamespaceForPrefix, getNamespaceForPrefix, getNextSibling, getNextSiblingElem, getNodeName, getNodeType, getOwnerDocument, getOwnerXSLTemplate, getParentElem, getParentNode, getParentNodeElem, getPrefixTable, getPreviousSibling, getPreviousSiblingElem, getPublicId, getStylesheet, getStylesheetComposed, getStylesheetRoot, getSystemId, getTagName, getUid, getXmlSpace, getXSLToken, handlesNullPrefixes, hasChildNodes, hasTextLitOnly, hasVariableDecl, insertBefore, isCompiledTemplate, item, needToCheckExclude, recompose, removeChild, replaceChild, replaceChild, resolvePrefixTables, runtimeInit, setDOMBackPointer, setEndLocaterInfo, setLocaterInfo, setParentElem, setPrefixes, setPrefixes, setPrefixTable, setUid, setXmlSpace, shouldStripWhiteSpace, unexecuteNSDecls, unexecuteNSDecls
 
Methods inherited from class org.apache.xml.utils.UnImplNode
adoptNode, appendData, cloneNode, compareDocumentPosition, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, getActualEncoding, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getBaseURI, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getFeature, getImplementation, getInputEncoding, getNamespaceURI, getNodeValue, getOwnerElement, getPrefix, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

m_attributeSetsNames

private QName[] m_attributeSetsNames
The value of the "use-attribute-sets" attribute.

Constructor Detail

ElemUse

public ElemUse()
Method Detail

setUseAttributeSets

public void setUseAttributeSets(java.util.Vector v)
Set the "use-attribute-sets" attribute. Attribute sets are used by specifying a use-attribute-sets attribute on xsl:element, xsl:copy (see [7.5 Copying]) or xsl:attribute-set elements. The value of the use-attribute-sets attribute is a whitespace-separated list of names of attribute sets. Each name is specified as a QName, which is expanded as described in [2.4 Qualified Names].

Parameters:
v - The value to set for the "use-attribute-sets" attribute.

setUseAttributeSets

public void setUseAttributeSets(QName[] v)
Set the "use-attribute-sets" attribute. Attribute sets are used by specifying a use-attribute-sets attribute on xsl:element, xsl:copy (see [7.5 Copying]) or xsl:attribute-set elements. The value of the use-attribute-sets attribute is a whitespace-separated list of names of attribute sets. Each name is specified as a QName, which is expanded as described in [2.4 Qualified Names].

Parameters:
v - The value to set for the "use-attribute-sets" attribute.

getUseAttributeSets

public QName[] getUseAttributeSets()
Get the "use-attribute-sets" attribute. Attribute sets are used by specifying a use-attribute-sets attribute on xsl:element, xsl:copy (see [7.5 Copying]) or xsl:attribute-set elements, or a xsl:use-attribute-sets attribute on Literal Result Elements. The value of the use-attribute-sets attribute is a whitespace-separated list of names of attribute sets. Each name is specified as a QName, which is expanded as described in [2.4 Qualified Names].

Returns:
The value of the "use-attribute-sets" attribute.

applyAttrSets

public void applyAttrSets(TransformerImpl transformer,
                          StylesheetRoot stylesheet)
                   throws javax.xml.transform.TransformerException
Add the attributes from the named attribute sets to the attribute list. TODO: Error handling for: "It is an error if there are two attribute sets with the same expanded-name and with equal import precedence and that both contain the same attribute unless there is a definition of the attribute set with higher import precedence that also contains the attribute."

Parameters:
transformer - non-null reference to the the current transform-time state.
stylesheet - The owning root stylesheet
Throws:
javax.xml.transform.TransformerException

applyAttrSets

private void applyAttrSets(TransformerImpl transformer,
                           StylesheetRoot stylesheet,
                           QName[] attributeSetsNames)
                    throws javax.xml.transform.TransformerException
Add the attributes from the named attribute sets to the attribute list. TODO: Error handling for: "It is an error if there are two attribute sets with the same expanded-name and with equal import precedence and that both contain the same attribute unless there is a definition of the attribute set with higher import precedence that also contains the attribute."

Parameters:
transformer - non-null reference to the the current transform-time state.
stylesheet - The owning root stylesheet
attributeSetsNames - List of attribute sets names to apply
Throws:
javax.xml.transform.TransformerException

execute

public void execute(TransformerImpl transformer)
             throws javax.xml.transform.TransformerException
Copy attributes specified by use-attribute-sets to the result tree. Specifying a use-attribute-sets attribute is equivalent to adding xsl:attribute elements for each of the attributes in each of the named attribute sets to the beginning of the content of the element with the use-attribute-sets attribute, in the same order in which the names of the attribute sets are specified in the use-attribute-sets attribute. It is an error if use of use-attribute-sets attributes on xsl:attribute-set elements causes an attribute set to directly or indirectly use itself.

Overrides:
execute in class ElemTemplateElement
Parameters:
transformer - non-null reference to the the current transform-time state.
Throws:
javax.xml.transform.TransformerException