p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: Display records in ordered format in ASP with XML as back end


Message #1 by mayur_vakharia@e... on Thu, 13 Mar 2003 11:18:36
Hello,
Can I display records in ordered format in ASP with XML as back end.
If so how...
Please reply asap.
Thanks and Regards,
Mayur
Message #2 by "Rodney Majola" <MajolaR@a...> on Thu, 13 Mar 2003 13:41:31 +0200
If you're using XSLT from your asp you might wanna have a look at this
example from your MSXML4.0 SDK. It basically uses the <xsl:sort> element
...


XML File (sortempl.xml)

<?xml version=3D'1.0'?>
<?xml-stylesheet type=3D"text/xsl" href=3D"sortempl.xsl"?>
<employees>
  <employee>
    <name>
      <given>Loni</given>
      <family>Ota</family>
    </name>
  </employee>
  <employee>
    <name>
      <given>Leonard</given>
      <family>Zuvela</family>
    </name>
  </employee>
  <employee>
    <name>
      <given>John</given>
      <family>Chen</family>
    </name>
  </employee>
  <employee>
    <name>
      <given>Jay</given>
      <family>Dirkson</family>
    </name>
  </employee>
  <employee>
    <name>
      <given>Anthony</given>
      <family>Dirkson</family>
    </name>
  </employee>
  <employee>
    <name>
      <given>Tony</given>
      <family>Dirkson</family>
    </name>
  </employee>
</employees>


XSLT File (sortempl.xsl)

<?xml version=3D'1.0'?>
<xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"
version=3D"1.0">

<xsl:template match=3D"employees">
  <ul>
    <xsl:apply-templates select=3D"employee">
      <xsl:sort select=3D"name/family"/>
      <xsl:sort select=3D"name/given"/>
    </xsl:apply-templates>
  </ul>
</xsl:template>

<xsl:template match=3D"employee">
  <li>
    <xsl:value-of select=3D"name/given"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select=3D"name/family"/>
  </li>
</xsl:template>

</xsl:stylesheet>



-----Original Message-----
From: mayur_vakharia@e... [mailto:mayur_vakharia@e...]
Sent: Thursday, March 13, 2003 1:19 PM
To: ASP Databases
Subject: [asp_databases] Display records in ordered format in ASP with
XML as back end

Hello,
Can I display records in ordered format in ASP with XML as back end.
If so how...
Please reply asap.
Thanks and Regards,
Mayur

  Return to Index