I have seen this being used in this contect:
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
Can anyone explain that the "node()|@*" means?
1. Well, more precisely, node() means child::node(), and @* means attribute::*, so it is matching all children and attributes of the context node. (It doesn't match document nodes or namespace nodes).
XSL (eXtensible Stylesheet Language) is a styling language for XML.
A second step called XML To Text (XTT) uses a similar approach to convert XML documents to text. It converts documents from XML to text formats such as comma separated values (CSV), fixed width or other text formats.
XSLT is a transformation language for XML. That means, using XSLT, you could generate any sort of other document from an XML document. For example, you could take XML data output from a database into some graphics.
This is called the identity transform. The node()|@*
is matching all child nodes (node()
is all text,element,processing instructions,comments) and attributes (@*
) of the current context.
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