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]

Re: How nested for loop in xsl?


This creates the output you requested though it does not look like a
particularly generic solution. I suspect there may be more meaning to your
input/output structures that is not apparent from the sample given.

<xsl:output method="xml" indent="yes"/>
  <xsl:template match="/">
   <name>
    <xsl:apply-templates select="sqlgeneral/*"/>
   </name>
  </xsl:template>

  <xsl:template match="productA">
    <xsl:for-each select="./row/name">
      <item><xsl:value-of select="."/></item>
    </xsl:for-each>
  </xsl:template>

  <xsl:template match="productB">
    <xsl:for-each select="./row/code">
      <type><xsl:copy-of select="."/></type>
    </xsl:for-each>
  </xsl:template>


Regards

Nick Browne
Slipstone Ltd

jvhew@asiatravelmart.com wrote:

> hi,
>
> I'am new in xsl and hope somebody can help me on this.
> I'll like to transform the below input.xml file to
> output.xml using the specify xsl file

etc.



 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]