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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:59:00+00:00 2026-06-10T15:59:00+00:00

This is my xml input <issues> <issue status=open type=Bug> <fix_versions> <fix_version>6.14.0</fix_version> <fix_version>6.13.0</fix_version> <fix_version>6.12.0</fix_version> </fix_versions>

  • 0

This is my xml input

<issues>
  <issue status="open" type="Bug">
    <fix_versions>
      <fix_version>6.14.0</fix_version>
      <fix_version>6.13.0</fix_version>
      <fix_version>6.12.0</fix_version>
    </fix_versions>
    <title>issue1</title>
    <description>Description</description>
  </issue>
  <issue status="open" type="Feature">
    <fix_versions>
      <fix_version>6.13.0</fix_version>
    </fix_versions>
    <title>issue2</title>
    <description>Description</description>
  </issue>
  <issue status="open" type="Improvement">
    <fix_versions>
      <fix_version>6.14.0</fix_version>
    </fix_versions>
    <title>issue3</title>
    <description>Description</description>
  </issue>
</issues>

And this is my xsl code

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<xsl:key name="versions" match="issue" use="fix_versions"/>
<xsl:key name="type" match="issue" use="concat(fix_versions, '+', @type)"/>

<xsl:template match="issues">



  <xsl:for-each select="//issue[generate-id(.)=generate-id(key('versions', fix_versions)[1])]">

    <xsl:sort select="fix_versions" order="descending"/> 



        <xsl:variable name="version"><xsl:value-of select="fix_versions"/></xsl:variable>


                <xsl:if test="//release[@version = \$version]">
                    <div class="release">
                    <a href="" class="version"><xsl:value-of select="\$version"/></a>
                    <div class="version" style="display:none;">
                        <xsl:for-each select="key('versions', fix_versions)[generate-id() = generate-id(key('type', concat(fix_versions, '+', @type))[1])]">
                            <div class="types">
                                <a href="" class="type"><xsl:value-of select="@type"/>s</a>
                                <div class="type" style="display:none">
                    <xsl:for-each select="key('type', concat(fix_versions, '+', @type))">
                        <div style="border-bottom:1px solid grey;">
                        <a href="" class="title"><xsl:value-of select="title"/></a>
                        <div class="toggle" style="display:none;">
                            <xsl:value-of select="description"/>
                        </div>
                        </div>
                                </xsl:for-each>
                                </div>
                            </div>                      
                </xsl:for-each>

            </div>
            </div>
                </xsl:if>


  </xsl:for-each>
</xsl:template>

And this is what i get

<div class="version">
  <a>6.14.0</a>
  <div class="issues">
    <div class="Bugs">
      <a href="issue1">issue1</a>
      <a href="issue7">issue7</a>
      <a href="issue2">issue12</a>
      <a href="issue17">issue17</a>
    </div>
    <div class="Improvements">
      <a href="issue3">issue3</a>
      <a href="issue9">issue9</a>
    </div>
  </div>
</div>
<div class="version">
  <a>6.13.0</a>
  <div class="issues">
    <div class="Bug">
      <a href="issue1">issue1</a>
      <a href="issue11">issue11</a>
    </div>
    <div class="Feature">
      <a href="issue2">issue2</a>
    </div>
  </div>
 </div>
 <div class="version">
   <a>6.12.0</a>
   <div class="issues">
     <div class="Bug">
       <a href="issue1">issue1</a>
     </div>
   </div>
</div>

All fine – The only Problem is that i only generate a key for fix_versions but i have the structure fix_versions/fix_version. So if there would be a node like <fix_versions>
<fix_version>6.14.0</fix_version>
<fix_version>6.13.0</fix_version>
<fix_version>6.12.0</fix_version>
</fix_versions>
, he would create the key 6.14.06.13.06.12.0 and would create a container for this version – but what i want is to put this issue into the three containers 6.14.0, 6.13.0 and 6.12.0. Is it genrally possible to duplicate one issue?

I tried something like <xsl:key name="versions" match="issue" use="fix_versions"/> and then use <xsl:for-each select="//issue[generate-id(.)=generate-id(key('versions', fix_versions)[1])]">, but he just creates the big group instead of sorting this issue into all of them.

Any idea?

  • 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-10T15:59:02+00:00Added an answer on June 10, 2026 at 3:59 pm

    Based on my guess of what the wanted result is:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
     <xsl:strip-space elements="*"/>
    
     <xsl:key name="kVersByVal" match="fix_version" use="."/>
     <xsl:key name="kBugTypeByVers" match="@type" use="../*/fix_version"/>
    
     <xsl:template match=
      "fix_version[generate-id()=generate-id(key('kVersByVal',.)[1])]">
      <div class="version">
       <a><xsl:value-of select="."/></a>
       <div class="issues">
         <xsl:for-each select="key('kBugTypeByVers',.)">
           <div class="{.}">
             <a href="{../title}"><xsl:value-of select="../title"/></a>
           </div>
         </xsl:for-each>
       </div>
      </div>
     </xsl:template>
     <xsl:template match="text()"/>
    </xsl:stylesheet>
    

    When this transformation is applied on the provided XML document:

    <issues>
      <issue status="open" type="Bug">
        <fix_versions>
          <fix_version>6.14.0</fix_version>
          <fix_version>6.13.0</fix_version>
          <fix_version>6.12.0</fix_version>
        </fix_versions>
        <title>issue1</title>
        <description>Description</description>
      </issue>
      <issue status="open" type="Feature">
        <fix_versions>
          <fix_version>6.13.0</fix_version>
        </fix_versions>
        <title>issue2</title>
        <description>Description</description>
      </issue>
      <issue status="open" type="Improvement">
        <fix_versions>
          <fix_version>6.14.0</fix_version>
        </fix_versions>
        <title>issue3</title>
        <description>Description</description>
      </issue>
    </issues>
    

    The presumed-wanted, correct result is produced:

    <div class="version">
       <a>6.14.0</a>
       <div class="issues">
          <div class="Bug">
             <a href="issue1">issue1</a>
          </div>
          <div class="Improvement">
             <a href="issue3">issue3</a>
          </div>
       </div>
    </div>
    <div class="version">
       <a>6.13.0</a>
       <div class="issues">
          <div class="Bug">
             <a href="issue1">issue1</a>
          </div>
          <div class="Feature">
             <a href="issue2">issue2</a>
          </div>
       </div>
    </div>
    <div class="version">
       <a>6.12.0</a>
       <div class="issues">
          <div class="Bug">
             <a href="issue1">issue1</a>
          </div>
       </div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am parsing data from this XML url The text input varies, depending on
This is my input xml. The xml can have maximunm three nodes and minimum
This is my input xml: <root> <node1/> <node2/> <node3/> <node4/> <othertags/> </root> The output
The input XML tag must be validated for a pattern which is like this:
I have this use case of an xml file with input like Input: <abc
-- This is my layout thus far for the input -- <?xml version=1.0 encoding=utf-8?>
I am trying to process some XML to reform it so that this input,
I am having an issue with creating an XLSX document with the Open XML
This is my XML for my check box: <CheckBox android:id=@+id/atm_checkbox android:layout_width=20dp android:layout_height=20dp android:background=@color/input_color />
I have the following XML <ns0:Root xmlns:ns0=http://Map_Sample.Input_Schema> <Number1> </Number1> <Number2>11</Number2> <Number3>12</Number3> </ns0:Root> In this

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.