Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7402349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:43:18+00:00 2026-05-29T04:43:18+00:00

Input XML: <Data> <BPP> <CP>A</CP> <Name>Joe</Name> </BPP> <BPP> <CP>A</CP> <Name>Show</Name> </BPP> <BPP> <CP>B</CP> <Name>Cunny</Name>

  • 0

Input XML:

<Data>
    <BPP>
        <CP>A</CP>
        <Name>Joe</Name>
    </BPP>
    <BPP>
        <CP>A</CP>
        <Name>Show</Name>
    </BPP>
    <BPP>
        <CP>B</CP>
        <Name>Cunny</Name>
    </BPP>
    <BPP>
        <CP>D</CP>
        <Name>Johny</Name>
    </BPP>
    <BPP>
        <CP>C</CP>
        <Name>Bunny</Name>
    </BPP>
    <BPP>
        <CP>B</CP>
        <Name>Sunny</Name>
    </BPP>
    <BPP>
        <CP>C</CP>
        <Name>Neha</Name>
    </BPP>
    <BPP>
        <CP>D</CP>
        <Name>Josh</Name>
    </BPP>
    <BPP>
        <CP>B</CP>
        <Name>Ash</Name>
    </BPP>
    <BPP>
        <CP>A</CP>
        <Name>Isha</Name>
    </BPP>
</Data>

My Code In XSL-FO:

<fo:table table-layout="fixed" border-width="1mm" border-style="solid">
<fo:table-column column-width="25%"/>
<fo:table-column column-width="25%"/>
<fo:table-column column-width="25%"/>
<fo:table-column column-width="25%"/>
<fo:table-body>
<!-- Repeatable row-->
    <fo:table-row>
        <fo:table-cell padding="1mm" border-width="1mm" border-style="solid">
            <fo:block font-weight="bold">Header</fo:block>
        </fo:table-cell>
        <fo:table-cell padding="1mm" border-width="1mm" border-style="solid">
            **<fo:block font-weight="bold"><!--Serial Value of 'A' or 'B'--></fo:block>**
        </fo:table-cell>

        <fo:table-cell padding="1mm" border-width="1mm" border-style="solid">
            <fo:block><xsl:value-of select='Data/BPP/Name'/></fo:block>
        </fo:table-cell>
        <fo:table-cell padding="1mm" border-width="1mm" border-style="solid">
            <fo:block><xsl:value-of select='Data/BPP/CP'/></fo:block>
        </fo:table-cell>
    </fo:table-row>
</fo:table-body>
</fo:table>

My requirement:

if Data/BPP/CP=’A’ or Data/BPP/CP=’B’
then in Each row, 2nd column of the table serial number should be displayed
The resultant output has to be in the following table format

Header 1

Joe A


Header 2

Show A


Header 3

Cunny B


Header 4

Sunny B


Header 5

Ash B


Header 6

Isha A


How to achieve the above serial number for ‘A’ or ‘B'(not for ‘C’,’D’ etc)? i’ve tried to get this with xslt but i failed. Any help either with xslt or xsl-fo regarding this is really Commendable..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:43:19+00:00Added an answer on May 29, 2026 at 4:43 am

    I can’t test this, but try:

    <xsl:for-each select="Data/BPP[./CP = 'A' or ./CP = 'B']">
        <xsl:number value="position()" format="1" />
    </xsl:for-each>
    

    (I edited away my previous answer, as it was wrong. I now understand your question)

    The above XSL will select all BPP nodes where CP is A or is B. The position() will output the position of the current node. I’m just not sure if it will output the position of the node in the entire node list, or in the result of our for-each.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any tools to transform SVG (XML) data to Canvas friendly input?
I am looking to transform a input xml given below <profile name=default> <color id=forecolor
I need XSLT transformation for money. In input XML data are prices as numbers:
I have the following xml input: <data> <parent Id=1 value=ParentOne> <child x=1 y=2 />
I am trying to get the data from input xml message using functoids. But
in input XML I have a tag <name>Sample '</name> in XSL I transform this
I have an input document of XML data that will resolve nicely into data
I'm trying to input data from an XML file in a C++ program using
The input XML tag must be validated for a pattern which is like this:
I have rather large input XML files that must be converted to a given

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.