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 5850357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:07:45+00:00 2026-05-22T13:07:45+00:00

having a xml with same tag names but for that tag names values were

  • 0

having a xml with same tag names but for that tag names values were different , so we expecting an output like one by one transaction

<swift>
 <message>
 <block3>
    <tag>
       <name>32</name>
       <value>praveen</value>
    </tag>
    <tag>
       <name>42</name>
       <value>pubby</value>
   </tag>
</block3> 
<block4>
    <tag>
       <name>77</name>
       <value>pravz</value>
    </tag>
    <tag>
        <name>77</name>
        <value>pubbypravz</value>
    </tag>
    <tag>
        <name>76</name>
         <value>shanmu</value>
   </tag>
   </block4>
  </message>
</swift>

xslt

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">            
    <xsl:for-each select="swift/message">   

                  <xsl:for-each select ="block3/tag[name = '32']">
            <xsl:value-of select="value"/>
        </xsl:for-each>,<xsl:text/>

                    <xsl:for-each select ="block4/tag[name = '77']">
            <xsl:value-of select="value"/>,<xsl:text/>
        </xsl:for-each>

        </xsl:for-each>

</xsl:template>

by this above xslt i have reached up to this

praveen,pravz,pubbypravz,

output needed:

 praveen,pravz

 praveen,pubbypravz

hope we need to set a loop for each time please guide me …

  • 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-22T13:07:47+00:00Added an answer on May 22, 2026 at 1:07 pm

    Well, you changed your first example completely, so my first answer did not match any more to your question. That makes our discussion some kind of worthless for outsiders. Nevertheless, I adapted my solution to your new input data:

    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:output method="text" />
    
        <xsl:template match="/">
        <xsl:for-each select ="/swift/message/block3/tag[name='32']">
           <xsl:variable name = "first-val" select="value"/>
           <xsl:for-each select ="/swift/message/block4/tag[name='77']">
               <xsl:value-of select="concat($first-val, ',',value)"/>
    <xsl:text>
    </xsl:text>
           </xsl:for-each>
        </xsl:for-each>
    
        </xsl:template>
    </xsl:stylesheet>
    

    Hope this helps.

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

Sidebar

Related Questions

I'm having trouble accessing only one XML element that has the same name as
I have normally hand written xml like this: <tag><?= $value ?></tag> Having found tools
I am having problems manually looping through xml data that is received via an
I am having the problem that I cannot select a specific XML node which
I'm using the XML data source feature in Reporting Services 2005 but having some
I'm having an xml file like <Root> <Child val1=1 val2=2/> <Child val1=1 val2=3/> <Child
I'm having an xml file like <Root> <Child val1=1 Val2=0/> <Child val1=1 Val2=2/> <Child
I am having trouble implementing a sort. I have an XML document that I
In spring you can initialize a bean by having the applicationContext.xml invoke a constructor,
I'm having a problem writing Norwegian characters into an XML file using C#. I

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.