What is //
in XSLT? (e.g. $currentPage//node
)
XSLT Processor takes the XSLT stylesheet and applies the transformation rules on the target XML document and then it generates a formatted document in the form of XML, HTML, or text format. This formatted document is then utilized by XSLT formatter to generate the actual output which is to be displayed to the end-user.
Extensible Stylesheet Language Transformations (XSLT) is an XML-based language used, in conjunction with specialized processing software, for the transformation of XML documents.
XSLT (eXtensible Stylesheet Language Transformations) is the recommended style sheet language for XML. XSLT is far more sophisticated than CSS. With XSLT you can add/remove elements and attributes to or from the output file.
XSLT <xsl:text> The <xsl:text> element is used to write literal text to the output. Tip: This element may contain literal text, entity references, and #PCDATA.
what // in xslt? e.g. ($currentPage//node)
In XPath the abbreviation:
The value of some attributes of xslt instructions (such as the select
attribute) must be an XPath expression.
Therefore,
($currentPage//node)
stands for
($currentPage/descendant-or-self::node()/node)
This selects all elements named node
that are children of nodes that are either contained in the variable $currentPage
or are descendents of nodes that are contained in the variable $currentPage
.
Do note that in the provided expression node()
is a node-test (it selects all node types on the descendant-or-self::
axis, such as elements, text nodes, comments and processing-instructions.
On the other side, somePath/node
is a shorthand for somePath/child::node
and only selects elements named node
that are children of the context node.
I strongly recommend not to use the name node
for an element in order to avoid this confusion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With