Reply
I need help to requeste XML to ASP
Old 07-07-2007, 05:25 PM I need help to requeste XML to ASP
MAHKUM-DK's Avatar
Junior Talker

Posts: 1
Location: Turkey >> Sivas
How can I requeste XML to ASP?

File: valuta.xsl

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <html>
  <body>
    <table cellspacing="0" cellpadding="5" border="1">
      <tr bgcolor="#66ccff">
        <th align="left">Kode</th> 
        <th align="left">Møntfod</th>
        <th align="right">Kurs</th>  
      </tr>
      <xsl:for-each select="exchangerates/dailyrates/currency">
      <tr>
        <td><xsl:value-of select="@code" /></td>
        <td><xsl:value-of select="@desc" /></td>
        <td align="right"><xsl:value-of select="@rate" /></td>
      </tr>
      </xsl:for-each>
  </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

Lav endnu et dokument med denne kode:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Valuta Kurser</title>
<script type="text/JavaScript">
function getRates() {
    var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
    xmlDoc.async = false
    xmlDoc.load("http://www.nationalbanken.dk/dndk/valuta.nsf/valuta.xml")
    
    var xslDoc = new ActiveXObject("Microsoft.XMLDOM")
    xslDoc.async = false
    xslDoc.load("valuta.xsl")
    
    document.write( xmlDoc.transformNode(xslDoc) );
}
</script>
</head>
<body>

<div>
    <script type="text/javascript">getRates()</script>
</div>

</body>
</html>
MAHKUM-DK is offline
Reply With Quote
View Public Profile Visit MAHKUM-DK's homepage!
 
When You Register, These Ads Go Away!
Reply     « Reply to I need help to requeste XML to ASP
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11941 seconds with 12 queries