For example my xml looks like this:


    <bookTitle>Lorem 1</bookTitle>




I need to loop the elements "Choices"... How can i do this? I know how to work with the for each loop, but i don't know how to get the values in choices.

<xsl:for-each select="root/Book_information">
  <xsl:value-of select ="GET THE VALUES IN CHOICES???"/>

I don't want to use choices[1], choices[2], choices[3],...
because then it would be too much code.




Edited 6 Years Ago by ozkanb: n/a

one Way is use the template go discribe what is doing when the parser
found the node

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output indent="yes" method="xml"/>
	<xsl:template match="/">
			<xsl:apply-templates select="root"/>
	<xsl:template match="root">
		<xsl:apply-templates select="Book_information"/>
	<xsl:template match="Book_information">
		<xsl:apply-templates select="choices"/>
	<xsl:template match="choices">
			<xsl:value-of select="."/>


<?xml version='1.0' ?>
This article has been dead for over six months. Start a new discussion instead.