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

  • Home
  • SEARCH
  • 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 8923613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:10:22+00:00 2026-06-15T07:10:22+00:00

I have the below sample source XML data. now i need to get the

  • 0

I have the below sample source XML data. now i need to get the output
in such a way that each serial number has to be printed with its productNo value conactinated by pipe symbol with the help of XSLT.

<orders>
    <orderItems>
        <productNo>500656-B21</productNo>
        <serialNumber>KRW13707EV</serialNumber>
        <serialNumber>PR9137RFRV</serialNumber>
        <serialNumber>PR9137RFRW</serialNumber>
        <serialNumber>PR9137RFRX</serialNumber>
    </orderItems>
   <orderItems>
        <productNo>500686-B21</productNo>
        <serialNumber>KRW13807EZ</serialNumber>
        <serialNumber>PR9138RFRD</serialNumber>
        <serialNumber>PR9138RFRY</serialNumber>
        <serialNumber>PR9138RF51</serialNumber>
    </orderItems>
   <orderItems>
        <productNo>500693-B26</productNo>
        <serialNumber>KRW139075V</serialNumber>
        <serialNumber>PR9139RFXV</serialNumber>
        <serialNumber>PR9139RFW7</serialNumber>
        <serialNumber>PR9139RFZ5</serialNumber>
    </orderItems>
</orders>

Expected Output is:

<orders>
<serialNo>500656-B21|KRW13707EV</serialNo>
<serialNo>500656-B21|PR9137RFRV</serialNo>
<serialNo>500656-B21|PR9137RFRW</serialNo>
<serialNo>500656-B21|PR9137RFRX</serialNo>
<serialNo>500686-B21|KRW13807EZ</serialNo>
<serialNo>500686-B21|PR9138RFRD</serialNo>
<serialNo>500686-B21|PR9138RFRY</serialNo>
<serialNo>500686-B21|PR9138RF51</serialNo>
<serialNo>500693-B26|KRW139075V</serialNo>
<serialNo>500693-B26|PR9139RFXV</serialNo>
<serialNo>500693-B26|PR9139RFW7</serialNo>
<serialNo>500693-B26|PR9139RFZ5</serialNo>
</orders>

Thanks for your help.

  • 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-06-15T07:10:24+00:00Added an answer on June 15, 2026 at 7:10 am
    <xsl:template match="orders">
       <xsl:copy>
         <xsl:apply-templates select="orderItems/serialNumber"/>
       </xsl:copy>
    </xsl:template>
    
    <xsl:template match="serialNumber">
      <serialNo>
        <xsl:value-of select="concat(../productNo, '|', .)"/>
      </serialNo>
    </xsl:template>
    
    <xsl:output indent="yes"/>
    

    should suffice.

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

Sidebar

Related Questions

I have posted my class below and with sample data. I need to pass
I have below sample data. AID Date Title ----- ---------- ------ 1 2011-12-12 test1
Below I have written a sample program that I have written to learn about
I have a sample xml file which looks like the one below: <Root> <SubOne>
I have a plot (sample code pasted below) that I am trying to add
I have a bit of xml file named Sample.xml which is shown below <?xml
I have a python script which outputs lots of data, sample is as below.
Suppose I have this database table (some sample code below) that stores the relationship
I have some simple data in XML format which I need to convert to
I have a IObservable [named rows in the sample below] from Reactive extensions framework

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.