This issue introduces multiple XSL methods and attributes for VBScript, JScript, to give full play to the XML advantages for < Xsl:script >, < xsl:eval > Markup Expression Authoring or < Xsl:if >, < xsl:when > Expr attribute.
First, Absolutechildnumber
Meaning: Returns the ordinal number of a node relative to all its siblings (regardless of the name)
Syntax: Absolutechildnumber (node)
Parameters: node── object, to return the number of nodes.
Example:
1. Assume that the document structure is:< documents >< head/>< body/></document, where documentation is the top-level node and the following expression outputs
< Xsl:eval >
Absolutechildnumber (This.selectnodes ("/document/body"). Item (0))
</xsl:eval >
2. Determine the serial number of the current node relative to all of its brothers
< Xsl:eval >absolutechildnumber (this) </xsl:eval >
Second, Ancestorchildnumber
Meaning: Returns the ordinal number of the nearest ancestor node (relative to the same node) based on the given ancestor node name, starting at the given node. Returns 0 if the ancestor is not found.
Syntax: Ancestorchildnumber (Bstrnodename, Pnode)
Parameters:
bstrnodename── string. The name of the ancestor node being searched.
pnode── object. The node where the search starts.
Example:
Finds the nearest name of the current node, called the statement ancestor node.
Ancestorchildnumber ("The", this)
Third, attributes
Meaning: Returns a collection of node attributes
Syntax: object.attributes
Parameters: object── Node Object
Example:
Number of current node properties
This.attributes.length
The value of the third property of the current node
This.attributs.item (2). value
or This.attributes.item (2). Text
or This.attributes (2). Text
Note: If the given subscript is larger than the property sum minus 1, the subscript for the first property is 0.
Four, BaseName
Meaning: Returns the base name with a namespace limit, that is, not including the name prefix
Syntax: Object.basename
Parameters: object── Node Object
Example: the base name of the current node: this.basename
Five, Childnumber
Meaning: Returns the ordinal number of a node relative to a sibling of the same name
Syntax: Childnumber (object)
Parameter: object─? Cape Leng Yun?/p>
Example: Assuming that the XML document is structured as follows
< x >< y >< z >< z/>< y/></x >
If the current node is Z, Childnumber (this) returns 1, and Absolutechildnumber (this) returns 3.