Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Xml sorting - URGENT Xml sorting - URGENTTo: NULL Date: 7/10/2007 5:43:00 AM
I have a website about historical events and my data will be coming in
in well-formed XML format like below
<?xml version="1.0" standalone="yes"?>
<events>
<topic>
<event>Vienna Summit with Soviet Premier Nikita Kruschev</
event>
<year>1961</year>
</topic>
<topic>
<event>Born: May 29, 1917 in Brookline, Massachusetts </
event>
<year>1917</year>
</topic>
<topic>
<event>In 1953, Kennedy married Jacqueline Lee Bouvier </
event>
<year>1953</year>
</topic>
year>
</topic>
</events>
I have successfully read the data into a datagrid, but I need to sort
the events by year. I'd like to do that not at the .aspx level of my
web-form but prior to reading it into that.
I'm very new to the concept of sorting XML but I found some snippets
that may help if anyone could give me some basic clues:
I'm assuming I need to publish an XSL file separate (?) from the
actual XML file (?):
something like:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="events">
<html>
<body>
<!--
<ul>
<xsl:apply-templates select="event">
<xsl:sort select="year"/>
</xsl:apply-templates>
</ul>
</xsl:template>
-->
</body>
</html>
</xsl:template>
</xsl:stylesheet>
There are probably syntax or logioc errors above from this I get and
modified from MSDN, but I thought it would be a start. Also how can I
associate the XML file with the XSL to do the SORT?
THANKS!!!!!!
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
