Package org.apache.xalan.templates
Class ElemSort
java.lang.Object
org.apache.xml.utils.UnImplNode
org.apache.xalan.templates.ElemTemplateElement
org.apache.xalan.templates.ElemSort
- All Implemented Interfaces:
Serializable
,SourceLocator
,XSLTVisitable
,PrefixResolver
,ExpressionNode
,WhitespaceStrippingElementMatcher
,Document
,Element
,Node
,NodeList
Implement xsl:sort.
invalid input: '<!'ELEMENT xsl:sort EMPTY> invalid input: '<!'ATTLIST xsl:sort select %expr; "." lang %avt; #IMPLIED data-type %avt; "text" order %avt; "ascending" case-order %avt; #IMPLIED >
- See Also:
-
Field Summary
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendChild
(Node newChild) Add a child to the child list.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.Get the "case-order" attribute.Get the "data-type" attribute.getLang()
Get the "lang" attribute.Return the node name.getOrder()
Get the "order" attribute.Get the "select" attribute.int
Get an int constant identifying the type of element.void
setCaseOrder
(AVT v) Set the "case-order" attribute.void
setDataType
(AVT v) Set the "data-type" attribute.void
Set the "lang" attribute.void
Set the "order" attribute.void
Set the "select" attribute.Methods inherited from class org.apache.xalan.templates.ElemTemplateElement
appendChild, callVisitors, canAcceptVariables, canStripWhiteSpace, compareTo, containsExcludeResultPrefix, endCompose, error, error, execute, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, getBaseIdentifier, getChildNodes, getColumnNumber, getDeclaredPrefixes, getDOMBackPointer, getEndColumnNumber, getEndLineNumber, getFirstChild, getFirstChildElem, getLastChild, getLastChildElem, getLength, getLineNumber, getLocalName, 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, resolvePrefixTables, runtimeInit, setDOMBackPointer, setEndLocaterInfo, setLocaterInfo, setParentElem, setPrefixes, setPrefixes, setUid, setXmlSpace, shouldStripWhiteSpace
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
-
Constructor Details
-
ElemSort
public ElemSort()
-
-
Method Details
-
setSelect
Set the "select" attribute. xsl:sort has a select attribute whose value is an expression. For each node to be processed, the expression is evaluated with that node as the current node and with the complete list of nodes being processed in unsorted order as the current node list. The resulting object is converted to a string as if by a call to the string function; this string is used as the sort key for that node. The default value of the select attribute is ., which will cause the string-value of the current node to be used as the sort key.- Parameters:
v
- Value to set for the "select" attribute
-
getSelect
Get the "select" attribute. xsl:sort has a select attribute whose value is an expression. For each node to be processed, the expression is evaluated with that node as the current node and with the complete list of nodes being processed in unsorted order as the current node list. The resulting object is converted to a string as if by a call to the string function; this string is used as the sort key for that node. The default value of the select attribute is ., which will cause the string-value of the current node to be used as the sort key.- Returns:
- The value of the "select" attribute
-
setLang
Set the "lang" attribute. lang specifies the language of the sort keys; it has the same range of values as xml:lang [XML]; if no lang value is specified, the language should be determined from the system environment.- Parameters:
v
- The value to set for the "lang" attribute
-
getLang
Get the "lang" attribute. lang specifies the language of the sort keys; it has the same range of values as xml:lang [XML]; if no lang value is specified, the language should be determined from the system environment.- Returns:
- The value of the "lang" attribute
-
setDataType
Set the "data-type" attribute.data-type
specifies the data type of the strings; the following values are allowed:-
text
specifies that the sort keys should be sorted lexicographically in the culturally correct manner for the language specified bylang
. -
number
specifies that the sort keys should be converted to numbers and then sorted according to the numeric value; the sort key is converted to a number as if by a call to the number function; thelang
attribute is ignored. - A QName with a prefix is expanded into an expanded-name as described in [2.4 Qualified Names]; the expanded-name identifies the data-type; the behavior in this case is not specified by this document.
The default value is
text
.NOTE: The XSL Working Group plans that future versions of XSLT will leverage XML Schemas to define further values for this attribute.
- Parameters:
v
- Value to set for the "data-type" attribute
-
-
getDataType
Get the "data-type" attribute.data-type
specifies the data type of the strings; the following values are allowed:-
text
specifies that the sort keys should be sorted lexicographically in the culturally correct manner for the language specified bylang
. -
number
specifies that the sort keys should be converted to numbers and then sorted according to the numeric value; the sort key is converted to a number as if by a call to the number function; thelang
attribute is ignored. - A QName with a prefix is expanded into an expanded-name as described in [2.4 Qualified Names]; the expanded-name identifies the data-type; the behavior in this case is not specified by this document.
The default value is
text
.NOTE: The XSL Working Group plans that future versions of XSLT will leverage XML Schemas to define further values for this attribute.
- Returns:
- The value of the "data-type" attribute
-
-
setOrder
Set the "order" attribute. order specifies whether the strings should be sorted in ascending or descending order; ascending specifies ascending order; descending specifies descending order; the default is ascending.- Parameters:
v
- The value to set for the "order" attribute
-
getOrder
Get the "order" attribute. order specifies whether the strings should be sorted in ascending or descending order; ascending specifies ascending order; descending specifies descending order; the default is ascending.- Returns:
- The value of the "order" attribute
-
setCaseOrder
Set the "case-order" attribute. case-order has the value upper-first or lower-first; this applies when data-type="text", and specifies that upper-case letters should sort before lower-case letters or vice-versa respectively. For example, if lang="en", then A a B b are sorted with case-order="upper-first" and a A b B are sorted with case-order="lower-first". The default value is language dependent.- Parameters:
v
- The value to set for the "case-order" attribute
-
getCaseOrder
Get the "case-order" attribute. case-order has the value upper-first or lower-first; this applies when data-type="text", and specifies that upper-case letters should sort before lower-case letters or vice-versa respectively. For example, if lang="en", then A a B b are sorted with case-order="upper-first" and a A b B are sorted with case-order="lower-first". The default value is language dependent.- Returns:
- The value of the "case-order" attribute
-
getXSLToken
public int getXSLToken()Get an int constant identifying the type of element.- Overrides:
getXSLToken
in classElemTemplateElement
- Returns:
- The token ID of the element
- See Also:
-
getNodeName
Return the node name.- Specified by:
getNodeName
in interfaceNode
- Overrides:
getNodeName
in classElemTemplateElement
- Returns:
- The element's name
-
appendChild
Add a child to the child list.- Specified by:
appendChild
in interfaceNode
- Overrides:
appendChild
in classElemTemplateElement
- Parameters:
newChild
- Child to add to the child list- Returns:
- Child just added to the child list
- Throws:
DOMException
-
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:
compose
in classElemTemplateElement
- Throws:
TransformerException
-