Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ===== Important Notes ===== There are two key parts to XSLT processing: * Selecting the nodes or elements to be processed (using a match pattern of XPath or XQuery) by defining a template * Applying the processing to the selected nodes by using a templates * Accessing the selected node values ==== Selecting Nodes ==== The basic XSLT element for selecting a node is : <code> <xsl:template match=pattern> Actions to be taken or text to be written out </xsl:templates> </code> When the XSLT processor matches a template's pattern, the node or node set becomes the **//context//** node / node set. You can also refer to the current node as **'.'** By default a template only matches the the current element and attributes, rather than any children. ==== Applying Logic to Nodes ==== The basic construct for applying the logic is: <code> <xsl:apply-template> </code> The apply-templates construct only applies to nodes or child nodes, but not to attributes. This can addressed by using the //select // construct in the apply-templates construct. To apply a specific template the full construct becomes: <code> <xsl:apply-template select="xpath expression"> </code> You can also apply a names template by substituting the final //select// section with: <code> <xsl:call-template name="templatename"> </xsl:call-template> </code> and adding in: <code> <xsl:template name="templatename"> </xsl:template> </code> You can also specifiy prameters to pass to the called template by using the <code><xsl:param></code> and <code><xsl:with-param></code> inside the called template. ==== Accesing Node Values ==== In order to get the value of a node the construct is: <code> <xsl:value-of select="xpath expression"> </code> plang/xslt/selectnodes/start.txt Last modified: 01/06/13 @ 20:54:16by 127.0.0.1