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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:36:33+00:00 2026-05-12T18:36:33+00:00

Could anyone help me with the following transformation? Here is the XML <Chart> <Chart.Series>

  • 0

Could anyone help me with the following transformation?

Here is the XML

<Chart>
<Chart.Series>
    <DataSeries LegendText="Complete On Time"  >
        <DataSeries.DataPoints>
            <DataPoint AxisXLabel="Sep 09" YValue="10" />
            <DataPoint AxisXLabel="Oct 09" YValue="11" />
            <DataPoint AxisXLabel="Nov 09" YValue="12" />
        </DataSeries.DataPoints>
    </DataSeries>

    <DataSeries LegendText="Complete Overdue"  >
        <DataSeries.DataPoints>
            <DataPoint  YValue="1" />
            <DataPoint  YValue="2" />
            <DataPoint  YValue="3" />
        </DataSeries.DataPoints>
    </DataSeries>
</Chart.Series>
</Chart>

and here is the output id like

<table>
<thead>
    <tr>
        <th></th>
        <th>Complete On Time</th>
        <th>Complete Overdue</th>
    </tr>
</thead>
<tbody>
    <tr>
        <th>Sep 09</th>
        <th>10</th>
        <th>1</th>
    </tr>
    <tr>
        <th>Oct 09</th>
        <th>11</th>
        <th>2</th>
    </tr>
    <tr>
        <th>Nov 09</th>
        <th>12</th>
        <th>3</th>
    </tr>
</tbody>

  • 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-12T18:36:34+00:00Added an answer on May 12, 2026 at 6:36 pm

    A more natural solution:

    <xsl:stylesheet 
      version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >
      <!-- basic table structure -->
      <xsl:template match="Chart">
        <table>
          <thead>
            <xsl:apply-templates select="Chart.Series" mode="thead" />
          </thead>
          <tbody>
            <xsl:apply-templates select="Chart.Series" mode="tbody" />
          </tbody>
        </table>
      </xsl:template>
    
      <!-- table head -->
      <xsl:template match="Chart.Series" mode="thead">
        <tr>
          <th />
          <xsl:for-each select="DataSeries">
            <th>
              <xsl:value-of select="@LegendText" />
            </th>
          </xsl:for-each>  
        </tr>
      </xsl:template>
    
      <!-- table body -->
      <xsl:template match="Chart.Series" mode="tbody">
        <xsl:variable name="ds" select="DataSeries" />
    
        <!-- the first data series contains the labels -->
        <xsl:for-each select="$ds[1]/*/DataPoint">
          <xsl:variable name="pos" select="position()" />
          <tr>
            <td>
              <xsl:value-of select="@AxisXLabel" />
            </td>
            <!-- process all data points at the current position -->
            <xsl:apply-templates select="$ds/*/DataPoint[$pos]" />
          </tr>
        </xsl:for-each>
      </xsl:template>
    
      <!-- data points become a <td> -->
      <xsl:template match="DataPoint">
        <td>
          <xsl:value-of select="@YValue" />
        </td>
      </xsl:template>
    </xsl:stylesheet>
    

    Note that I use template modes to do different things with the same input.

    The result is:

    <table>
      <thead>
        <tr>
          <th />
          <th>Complete On Time</th>
          <th>Complete Overdue</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>Sep 09</td>
          <td>10</td>
          <td>1</td>
        </tr>
        <tr>
          <td>Oct 09</td>
          <td>11</td>
          <td>2</td>
        </tr>
        <tr>
          <td>Nov 09</td>
          <td>12</td>
          <td>3</td>
        </tr>
      </tbody>
    </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could anyone please help me with the following transformation? Here is the input xml:
Could anyone help me to understand following line of code: sol< ?=f((1<< n)-1,i,0)+abs(P[i])*price; I
Could anyone help me with how can we create chart for every row of
I am confused with the following statement . Could anyone help me in understanding
Could anyone help me with the following WHERE statement ? I want to say
Could anyone help me understand why the following query works fine in SQL 2000
Could anyone help with porting the following binding from Ninject to TinyIOC : Bind<Func<Type,
I am trying to do the following - could anyone help me out? I
Could anyone help me in assessing why the code below doesn't work. I'm using
Could anyone please help me convert this code to vb.net, I have tried it

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.