03.01.2015 Views

C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Related Technologies ❘ 557<br />

The body of the template makes the processor emit the following text.<br />

<br />

<br />

<br />

<br />

Planet<br />

Distance to Sun<br />

Length of Year<br />

Length of Day<br />

<br />

<br />

<br />

<br />

<br />

This is ordinary HTML code except for the line highlighted in bold. That line uses the xsl:applytemplates<br />

element to tell the processor to apply the templates for Planet child nodes.<br />

In this example, the first template finds the Planets element and applies the template that matches<br />

Planet elements to that element’s children.<br />

The second template matches Planet elements and emits the following text for them.<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Again this is plain HTML text except for the bold statements. Those statements use the xsl:value-of<br />

element to select values from the Planet element’s children.<br />

The following HTML code shows the result.<br />

<br />

<br />

<br />

<br />

Planet<br />

Distance to Sun<br />

Length of Year<br />

Length of Day<br />

www.it-ebooks.info

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

Saved successfully!

Ooh no, something went wrong!