O'Reilly logo

Practical Web Technologies by V. Lau, P. K. Yuen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5.3. Manipulating XML data with XSLT

5.3.1. Generating loops with XSLT

In this section, we consider some XSLT pages and techniques that can perform some data manipulation of an XML file. First, we will show you how to perform loops on XML data. Based on the loops, a number of basic database operations such as sorting, filtering, and query can be performed.

Another way to display the entire XML page or data is to use the for-each element <xsl:foreach>. This element has the following general form:

   <xsl:for-each select="street/profile">
     xxx
     xxx
   </xsl:for-each>

This statement can read all children of the <profile> element one by one specified by the calling XML document. To construct an example of this feature, you first modify line 2 of ex05-11.xml ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required