Introduction to XSL Functions (3)

Source: Internet
Author: User

14, NodeName

Meaning: Returns a specific string of elements, attributes, entry names, or other types of nodes

Syntax: Pnode.nodename

Example: The name of the current node

This.nodename

XV, NodeType, nodetypestring

Meaning: Returns the numeric form (or string form) of the type of the knot.

Syntax: Pnode.nodetype or pnode.nodetypestring

return value:

Node type
Node type number node type string

Elements
1
"Element"

Element attributes
2
"Attribute"

markup-delimited Region of Text
3
"Text"

Processing instruction
7
"Processing_instruction"

Comment
8
"Comment"

Document Entity
9
"Document"


16, nodetypedvalue

Meaning: Returns the value of a node as a node-predefined data type

Syntax: pnode.nodetypedvalue

Example: Assuming the data type of the current node is fixed.14.4, the following example returns the value of the node as a number, rather than a literal string

this.nodetypedValue

17, nodevalue

Meaning: Returns the text of a node

Syntax: Pnode.nodevalue

Note: This method is not used for element class nodes and can be used for attributes, CDATA, annotations, text, and so on.

Example: The value of the first property of the current element

This.attributes (0). Nodevalue

The text within the current element (assuming that there is only text in the element, no other elements, that is, < Mark >text</mark), and it is recommended that you try to master its exact usage several times.

This.firstChild.nodeValue

18, Ownerdocument

Meaning: Returns the root of the document that contains the node

Syntax: pnode.ownerdocument

Note: This method is used for document root node errors

19, SelectNodes

Meaning: The given style match applies to the current node and returns a matching set of nodes

Syntax: pnode.selectnodes ("pattern")

Tip: Pattern writing is similar to the value of the Select property of < Xsl:for-each >, which begins with "/"

Searches from the root of the document, traversing all nodes of the document with a "//" beginning table; Beginning

Represents the beginning of the parent node of the current node, and cannot have the above special characters if you want to search down from the current node.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.