Jump to content

xml into xslt


Naomi85
 Share

Recommended Posts

I want to change my xml file into xsl so that it can fit into my chart, I am trying to put it into ascending form…

This is my .xml<?xml version="1.0" encoding="UTF-8"?>

<?xml-stylesheet type="text/xsl" href="banks.xsl"?>

<chart caption='Banks' xAxisName='Bank Types' yAxisName='Amount' numberPrefix='$' showValues='0'>

 

<set label='UOB' value='420000' />

<set label='UOB' value='910000' />

<set label='DBS' value='720000' />

<set label='OCBC' value='550000' />

<set label='UOB' value='810000' />

<set label='DBS' value='510000' />

<set label='OCBC' value='680000' />

<set label='UOB' value='620000' />

<set label='DBS' value='610000' />

<set label='OCBC' value='490000' />

<set label='OCBC' value='530000' />

<set label='DBS' value='330000' />

 

 

<styles>

 

<definition>

<style name='CanvasAnim' type='animation' param='_xScale' start= '0' duration='1' />

</definition>

 

<application>

<apply toObject='Canvas' styles='CanvasAnim' />

</application>

 

</styles>

 

</chart>

 

And this is my .xsl file

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

 

<xsl:template match="chart">

<xsl:apply-templates select="label">

<xsl:sort order="ascending" />

</xsl:apply-templates>

</xsl:template>

 

</xsl:stylesheet>

 

 

I had another try:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:output indent="yes"/><xsl:strip-space elements="*"/><xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"><xsl:sort select="@value"/></xsl:apply-templates></xsl:copy></xsl:template></xsl:stylesheet>

 

But both cannot work... please help me...

 

Thank you!!!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...