1

Is it possible to move the result generated by the XSLT processor. e.g. in the below case i wanted Benefit type="Main" and its child elements to be displayed before Benefit type="Rider" Two separate templates are applied for Rider and Main, hence i think xsl:sort cannot be applied, since it sorts within a single collection.

<Policy>
            <Benefit type="Rider">
                <ProductAbbreviatedName>BBB</ProductAbbreviatedName>
                <ProductCode>U30</ProductCode>
                <ProductName>BBB</ProductName>
            </Benefit>
            <Benefit type="Main">
                <ProductAbbreviatedName>AAA</ProductAbbreviatedName>
                <ProductCode>231Y</ProductCode>
                <ProductName>AAAA</ProductName>
            </Benefit>

</Policy>

Kindly advice on some ideas to perform the desired output. Many thanks.

Ajai Singh
  • 33
  • 2
  • 6

1 Answers1

0

Just use in your code:

<xsl:apply-templates select="Benefit[@type='Main']"/>
<xsl:apply-templates select="Benefit[@type='Rider']"/>
Dimitre Novatchev
  • 240,661
  • 26
  • 293
  • 431
  • @DDimitre Novatchev `Thanks for the code` [http://stackoverflow.com/questions/12368164/declare-global-variable-in-project-and-use-it-in-xslt] . Can you pls guide me on my doubt that is posted in the link. Many thanks – Ajai Singh Sep 11 '12 at 11:00