Global GuideLine Home HTML Tutorial JavaScript Tutorial SQL Tutorial CSS Tutorial SEO Tutorial XML Tutorial XSLT Tutorial Articles Tutorial Interview Questions and Answers Guide Jobs GuideLine Bookmark With Google Bookmark With Yahoo Bookmark With FaceBook Bookmark With Live Follow @GlobalGuideLine on Twitter Bookmark Global GuideLine
XSLT Loop, XSLT Tutorial, Global Guideline

Bookmark Bookmark: XSLT Loop, XSLT Tutorial
Global Guideline is UNITED STATES's favorite website


      Home                    

Basic XSLT Tutorial.     
 XSLT Introduction.          
 XSLT Templates.            
 XSLT Attributes.              
 XSLT Transformation.     
 XSLT Variables.              
 XSLT Formatting.            
 XSLT Loops.
 XSLT Sorting.                 
 XSLT Conditions.             
 XSLT Multi Selection.     
 XSLT Functions.              
 XSLT Copying.                
 XSLT Combining.           
 XSLT Summary.              

XSLT Tutorial >> XSLT Loop.


     Back             Next     



XSLT is a declarative language it doesn't allow updating variables. For this reason there are no constructs to create iterative loops, which are well-known from vital programming languages such as C++ or Java. Even <xsl:for-each> is not really a loop construct in XSLT. To solve iterative problems you have to transform them into recursive problems - no problem if you're familiar with that hum.

Example of XSLT Loops

XML Code for XSLT Loops Example [XSLT_Loops_Example.xml]

<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="xslt_For_Each_Loop.xsl"?>
  <globalGuideLine>
     <employee>
       <FirstName>Angela</FirstName>
       <LastName>Julie</LastName>
     </employee>
     <employee>
       <FirstName>Alfa</FirstName>
       <LastName>Cute</LastName>
     </employee>
  </globalGuideLine>

XSLT for XSLT For Each Loop Example [XSLT_For_Each_Loop.xsl]

<?xml version="1.0" encoding="ISO-8859-1"?>
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>XSLT Loops at Global Guide Line XSLT Tutorial</title>
  </head>
<body>
  <xsl:for-each select="globalGuideLine/employee">
    <b><xsl:value-of select="FirstName"/> 
    <xsl:value-of select="LastName"/></b> is working at Global Guide Line<br/>
  </xsl:for-each>
</body>
</html>

Complete Sources for Example of XSLT For Each Loop

XSLT Tutorial section of sources and outputs for XSLT loops view it by simply clicking on file name of XSLT, XML and Out Put of XSLT For Each Loop
 

     Back             Next     
 
In order to link this page as Reference, click on below text area and pres (CTRL-C) to copy the code in clipboard or pres right click then copy the following lines after that past into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code:

[ About ] [ Contact ] [ Home ]
[ Links ] [ Site Map ] [ Services ] [ Privacy ]

Copyright © 2005-2006 www.globalguideline.com All rights reserved. 488 visitors are online now