This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

xsl:for-each




XML:  Data ==> 

<Info>

<Response>

<PDetail>

    <CDetail>
	  <ROIN>1111</ROIN>
          <CNo>111111</CNo>
          <Type>B</Type>
          <CTType>W</CTType>
	
         <CoDetail>
	       <CoNo>1</CoNo>				 </CoDetail>
     </CDetail>


</PDetail>

</Response>

</Info>


Here is my  XSL - COde: 

<xsl:template  match="Info">
 
<xsl:for-each select="Response">

<xsl:apply-templates select="PDetail"/>		
			
</xsl:for-each>

</xsl:template> 


<xsl:template match="PDetail"> 
	<xsl:for-each select="CDetail"/>
		<xsl:apply-templates select="CDetail"/>
</xsl:template>


Hello!!

I have a question related to using xsl:for-each 
in my code above  I Stated with my first pair of 
<xsl:for-each> & </xsl:for-each>  but when I tried to
give the same  for "CDetail"  XML Spy gives a
malformed XML error ... so I couldn't give an closing
</xsl:for-each> 

if I leave my code as shown above it works.. I am
getting the desired output but when I give 

<xsl:template match="PDetail"> 
	<xsl:for-each select="CDetail">
		<xsl:apply-templates select="CDetail"/>
        </xsl:for-each>
</xsl:template>

I am not getting a mal formed xml for the XSL sheet
but I am not getting the desired result.. please
advise if you find anything wrong with my code

Basically I want to make sure if each occurance of
xsl:for-each need to be terminated with a matching
</xsl:for-each>


thanks

ram





__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]