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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:28:14+00:00 2026-06-17T11:28:14+00:00

I have a data set (which I have no control over) which has a

  • 0

I have a data set (which I have no control over) which has a simple key value structure. If a table is populated which has n-rows a sample of the output would be:

<property>
  <name>Row1_Field1</name>
  <value>Data Value Sample</value>
</property>
<property>
  <name>Row1_Field2</name>
  <value>Data Value Sample</value>
</property>
<property>
  <name>Row2_Field1</name>
  <value>Data Value Sample</value>
</property>
<property>
  <name>Row2_Field2</name>
  <value>Data Value Sample</value>
</property>

Is it possible, using XSLT, to convert this into something easier to work with such as the example below?

<rows>
  <row>
    <Field1>Data Value Sample</Field1>
    <Field2>Data Value Sample</Field2>
  </row>
  <row>
    <Field1>Data Value Sample</Field1>
    <Field2>Data Value Sample</Field2>
  </row>
</rows>
  • 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-17T11:28:15+00:00Added an answer on June 17, 2026 at 11:28 am

    This transformation:

    <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:template match="/*">
         <rows>
          <xsl:apply-templates/>
         </rows>
     </xsl:template>
    
     <xsl:template match=
      "property[not(substring-before(name,'_')
                   =
                    substring-before(preceding-sibling::*[1]/name,'_'))]">
      <row>
        <xsl:apply-templates mode="inRow" select=
         "/*/property[substring-before(name,'_') = substring-before(current(),'_')]"/>
      </row>
     </xsl:template>
    
     <xsl:template match="property" mode="inRow">
      <xsl:element name="{substring-after(name,'_')}"><xsl:value-of select="value"/></xsl:element>
     </xsl:template>
     <xsl:template match="property"/>
    </xsl:stylesheet>
    

    when applied on the provided XML document:

    <properties>
        <property>
            <name>Row1_Field1</name>
            <value>Data Value Sample</value>
        </property>
        <property>
            <name>Row1_Field2</name>
            <value>Data Value Sample</value>
        </property>
        <property>
            <name>Row2_Field1</name>
            <value>Data Value Sample</value>
        </property>
        <property>
            <name>Row2_Field2</name>
            <value>Data Value Sample</value>
        </property>
    </properties>
    

    produces the wanted, correct result:

    <rows>
       <row>
          <Field1>Data Value Sample</Field1>
          <Field2>Data Value Sample</Field2>
       </row>
       <row>
          <Field1>Data Value Sample</Field1>
          <Field2>Data Value Sample</Field2>
       </row>
    </rows>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the swiss data set provided by R, which has the following form:
I have a mysql table field set as time type which stores data in
I have a set of controls bound to data, on which I would like
I have a data set which consists of an ID and a matrix (n
I have a large set of data which I access via a generator/iterator. While
I have a set of data points in 3D space which apparently all fall
I have several objects set up in Core Data, one of which is Deck
I'm pretty new to Entity Frameworks. I have a set of Static Data which
I have a large json data object (over 300K uncompressed, 40K gzipped) which is
I have a repeater control outputting some HTML. I want a table which outputs

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.