Hi,
I have used xsl to transform xml from sqlserver in and it works fine
now i have a webservice that uses a dataset to get the data and return it as
xml
like the code below
<WebMethod()> _
Public Function ReturnEarnedValues() As XmlDocument
Dim MyStream As New IO.StringWriter
Dim XD As New XmlDocument
OleDbDataAdapter1.Fill(MyDataSet1)
MyDataSet1.WriteXml(MyStream)
XD.LoadXml(MyStream.ToString)
Return XD
End Function
Now the problem, my XSL does not work anymore and i think it has to do with
the xmlns tag and "mydataset" because nothing is transformed anymore. So how
should i write the xml or the xsl to fix this problem?
The xmlfile returned look like this
<?xml version="1.0" encoding="utf-8"?>
<MyDataSet xmlns="http://ixx.se/MyDataSet.xsd">
<Table>
<Omsatt>601</Omsatt>
</Table>
</MyDataSet>
and the XSL file like this:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output indent="yes" method="html" />
<xsl:template match="/">
<html>
<head>
<style type="text/css">
.blackText {font-family:arial;color:#000000;}
.largeYellowText {font-family:arial;font-size:18pt;
color:#ffff00;}
.largeBlackText {font-family:arial;font-size:10pt;
color:#000000;}
.borders {border-left:1px solid #000000;
border-right:1px solid #000000;
border-top:1px solid #000000;
border-bottom:1px solid #000000;}
</style>
</head>
<body bgcolor="#ffffff">
<span class="largeBlackText">
<b>Scala:</b>
</span>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="Table">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:
collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="50%"
background="http://cougar/_layouts/images/partgrad.gif"><b>
<font face="Verdana" size="1">Omsatt idag <xsl:value-of
select="Omsatt"/></font></b></td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
Am I doing it wrong with the dataset or can I change the xsl or xml in some
way so it does not refer to the schema in the xmlfile like "standalone=yes"
or something?
Best regards
Fredrik