Package org.apache.xalan.templates
Class ElemNumber
java.lang.Object
org.apache.xml.utils.UnImplNode
org.apache.xalan.templates.ElemTemplateElement
org.apache.xalan.templates.ElemNumber
- All Implemented Interfaces:
Serializable
,SourceLocator
,XSLTVisitable
,PrefixResolver
,ExpressionNode
,WhitespaceStrippingElementMatcher
,Document
,Element
,Node
,NodeList
Implement xsl:number.
invalid input: '<!'ELEMENT xsl:number EMPTY> invalid input: '<!'ATTLIST xsl:number level (single|multiple|any) "single" count %pattern; #IMPLIED from %pattern; #IMPLIED value %expr; #IMPLIED format %avt; '1' lang %avt; #IMPLIED letter-value %avt; #IMPLIED grouping-separator %avt; #IMPLIED grouping-size %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
(ElemTemplateElement newChild) Add a child to the child list.void
callChildVisitors
(XSLTVisitor visitor, boolean callAttrs) Call the children visitors.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.void
execute
(TransformerImpl transformer) Execute an xsl:number instruction.getCount()
Get the "count" attribute.Get the "format" attribute.getFrom()
Get the "from" attribute.Get the "grouping-separator" attribute.Get the "grouping-size" attribute.getLang()
Get the "lang" attribute.Get the "letter-value" attribute.int
getLevel()
Get the "level" attribute.Return the node name.int
getPreviousNode
(XPathContext xctxt, int pos) Get the previous node to be counted.int
getTargetNode
(XPathContext xctxt, int sourceNode) Get the target node that will be counted..getValue()
Get the "value" attribute.int
Get an int constant identifying the type of element.void
Set the "count" attribute.void
Set the "format" attribute.void
Set the "from" attribute.void
Set the "grouping-separator" attribute.void
Set the "grouping-size" attribute.void
Set the "lang" attribute.void
Set the "letter-value" attribute.void
setLevel
(int v) Set the "level" attribute.void
Set the "value" attribute.Methods inherited from class org.apache.xalan.templates.ElemTemplateElement
appendChild, callVisitors, canAcceptVariables, canStripWhiteSpace, compareTo, containsExcludeResultPrefix, endCompose, error, error, 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
-
ElemNumber
public ElemNumber()
-
-
Method Details
-
setCount
Set the "count" attribute. The count attribute is a pattern that specifies what nodes should be counted at those levels. If count attribute is not specified, then it defaults to the pattern that matches any node with the same node type as the current node and, if the current node has an expanded-name, with the same expanded-name as the current node.- Parameters:
v
- Value to set for "count" attribute.
-
getCount
Get the "count" attribute. The count attribute is a pattern that specifies what nodes should be counted at those levels. If count attribute is not specified, then it defaults to the pattern that matches any node with the same node type as the current node and, if the current node has an expanded-name, with the same expanded-name as the current node.- Returns:
- Value of "count" attribute.
-
setFrom
Set the "from" attribute. Specifies where to count from. For level="single" or level="multiple": Only ancestors that are searched are those that are descendants of the nearest ancestor that matches the from pattern. For level="any: Only nodes after the first node before the current node that match the from pattern are considered.- Parameters:
v
- Value to set for "from" attribute.
-
getFrom
Get the "from" attribute. For level="single" or level="multiple": Only ancestors that are searched are those that are descendants of the nearest ancestor that matches the from pattern. For level="any: Only nodes after the first node before the current node that match the from pattern are considered.- Returns:
- Value of "from" attribute.
-
setLevel
public void setLevel(int v) Set the "level" attribute. The level attribute specifies what levels of the source tree should be considered; it has the values single, multiple or any. The default is single.- Parameters:
v
- Value to set for "level" attribute.
-
getLevel
public int getLevel()Get the "level" attribute. The level attribute specifies what levels of the source tree should be considered; it has the values single, multiple or any. The default is single.- Returns:
- Value of "level" attribute.
-
setValue
Set the "value" attribute. The value attribute contains an expression. The expression is evaluated and the resulting object is converted to a number as if by a call to the number function.- Parameters:
v
- Value to set for "value" attribute.
-
getValue
Get the "value" attribute. The value attribute contains an expression. The expression is evaluated and the resulting object is converted to a number as if by a call to the number function.- Returns:
- Value of "value" attribute.
-
setFormat
Set the "format" attribute. The "format" attribute is used to control conversion of a list of numbers into a string.- Parameters:
v
- Value to set for "format" attribute.- See Also:
-
getFormat
Get the "format" attribute. The "format" attribute is used to control conversion of a list of numbers into a string.- Returns:
- Value of "format" attribute.
- See Also:
-
setLang
Set the "lang" attribute. When numbering with an alphabetic sequence, the lang attribute specifies which language's alphabet is to be used; 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. Implementers should document for which languages they support numbering.- Parameters:
v
- Value to set for "lang" attribute.- See Also:
-
getLang
Get the "lang" attribute. When numbering with an alphabetic sequence, the lang attribute specifies which language's alphabet is to be used; 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. Implementers should document for which languages they support numbering.- Returns:
- Value ofr "lang" attribute.
- See Also:
-
setLetterValue
Set the "letter-value" attribute. The letter-value attribute disambiguates between numbering sequences that use letters.- Parameters:
v
- Value to set for "letter-value" attribute.- See Also:
-
getLetterValue
Get the "letter-value" attribute. The letter-value attribute disambiguates between numbering sequences that use letters.- Returns:
- Value to set for "letter-value" attribute.
- See Also:
-
setGroupingSeparator
Set the "grouping-separator" attribute. The grouping-separator attribute gives the separator used as a grouping (e.g. thousands) separator in decimal numbering sequences.- Parameters:
v
- Value to set for "grouping-separator" attribute.- See Also:
-
getGroupingSeparator
Get the "grouping-separator" attribute. The grouping-separator attribute gives the separator used as a grouping (e.g. thousands) separator in decimal numbering sequences.- Returns:
- Value of "grouping-separator" attribute.
- See Also:
-
setGroupingSize
Set the "grouping-size" attribute. The optional grouping-size specifies the size (normally 3) of the grouping.- Parameters:
v
- Value to set for "grouping-size" attribute.- See Also:
-
getGroupingSize
Get the "grouping-size" attribute. The optional grouping-size specifies the size (normally 3) of the grouping.- Returns:
- Value of "grouping-size" attribute.
- See Also:
-
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
-
getXSLToken
public int getXSLToken()Get an int constant identifying the type of element.- Overrides:
getXSLToken
in classElemTemplateElement
- Returns:
- The token ID for this element
- See Also:
-
getNodeName
Return the node name.- Specified by:
getNodeName
in interfaceNode
- Overrides:
getNodeName
in classElemTemplateElement
- Returns:
- The element's name
-
execute
Execute an xsl:number instruction. The xsl:number element is used to insert a formatted number into the result tree.- Overrides:
execute
in classElemTemplateElement
- Parameters:
transformer
- non-null reference to the the current transform-time state.- Throws:
TransformerException
-
appendChild
Add a child to the child list.- Overrides:
appendChild
in classElemTemplateElement
- Parameters:
newChild
- Child to add to child list- Returns:
- Child just added to child list
-
getPreviousNode
Get the previous node to be counted.- Parameters:
xctxt
- The XPath runtime state for this.pos
- The current node- Returns:
- the previous node to be counted.
- Throws:
TransformerException
-
getTargetNode
Get the target node that will be counted..- Parameters:
xctxt
- The XPath runtime state for this.sourceNode
- non-null reference to the current source node.- Returns:
- the target node that will be counted
- Throws:
TransformerException
-
callChildVisitors
Call the children visitors.- Parameters:
visitor
- The visitor whose appropriate method will be called.
-