Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XSLT question : For Loop is not working in XSLT 2.0 in my scenario. Please advise.

Hari SelvaMay 21 2018 — edited May 22 2018

Hi Experts,

Expected Output:

For loop has to loop for # of <Detail> element in the following pageLayout.

Input:

<pageLayout>

<PageLayOut>

<Pages>

<Page>1</Page>

<Detail>1</Detail>

<Detail>2</Detail>

<Detail>3</Detail>

<Detail>4</Detail>

<Detail>5</Detail>

<Detail>6</Detail>

</Pages>

</PageLayOut>

</pageLayout>

Both the following options seems to be not working. Please advise.

Existing code I have:

XSLT 2.0:

    <xsl:for-each select="1 to xsd:integer(count($pageLayout/PageLayOut/Pages/Detail))">

      <xsl:variable name="var2" select="."/>

...

    </xsl:for-each>

XSLT 1.0:

<xsl:template match="/">

    <xsl:for-each select="$pageLayout/PageLayOut/Pages/Detail">

      <xsl:variable name="var2" select="number(position())"/>

    </xsl:for-each>

....

  </xsl:template>

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 19 2018
Added on May 21 2018
2 comments
441 views