Jump to content
Sign in to follow this  
Naomi85

xml into xslt

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!!!

Share this post


Link to post
Share on other sites

Try CSS. Or go back over the tutorial. Start small with this task, by getting one element to render, ones that is accomplish. Extend it to your needed portion.Link to another post on this subject.http://w3schools.invisionzone.com/index.php?showtopic=8839&page=1entry47686And here:http://w3schools.invisionzone.com/index.php?showtopic=9130&page=1entry49430

Edited by L8V2L

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...