26.01.2019 Views

XML Simplified

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Module 6<br />

XSL and XSLT<br />

Applies the template on DOJ element.<br />

xsl:value-of<br />

Used to extract the value of a selected node.<br />

Concepts<br />

xsl:template match="Name"<br />

If the template is matched with Name element, the value of the Name element is displayed in green<br />

color with font size 22 pixels.<br />

xsl:template match="DOJ"<br />

If the template is matched with DOJ element, the value of the DOJ element is displayed in blue<br />

color.<br />

The output is shown in figure 6.9.<br />

6.2.4 The select Attribute<br />

Figure 6.9: Output of Using Templates<br />

The select attribute can be used to process nodes selected by an expression instead of processing all<br />

children. The xsl:apply-templates with a select attribute can be used to choose a particular set<br />

of children instead of all children.<br />

Figure 6.10 shows the syntax for select Attribute.<br />

Figure 6.10: select Attribute Syntax<br />

<strong>XML</strong> <strong>Simplified</strong><br />

Version 1.0 © Aptech Limited

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!