xsl-list
[Top] [All Lists]

RE: Looping problem

2002-12-02 16:06:06
[ Deepak Rao]

The following is the XML I want to transform. Can anyone help 
me out in 
writing a statement which access only the LOOP2 section and 
its children of 
the first LOOP1 section. 

There are two LOOP2 elements in the first LOOP1.  I assume you want to
access both of them.

I want to ingnore the rest of the 
LOOP1 sections 
and its children. I want to use a for-each (if possible)

Why are you trying to use a for-each?  I would write (I have renamed the
top-level element to "root" since the name "XML" is a reserved name and
you should not use it) -

<xsl:template select='/root/LOOP1[1]'>
        <xsl:apply-templates select='LOOP2'/>
</xsl:template>


<XML>
   <ABC>2323</ABC>
   <LOOP1>
      <XYZ>232</XYZ>
      <ERT>5465</ERT>
      <LOOP2>
         <DFG>345</DFG>
         <CVB>675</CVB>
      </LOOP2>

<snip/>

Cheers,

Tom P

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



<Prev in Thread] Current Thread [Next in Thread>