Hi there,
I really someone can help me. This is a real head scratcher...
I have an XSLT stylesheet that transforms perfectly when I embed the
link to it in an XML document. But if I try to use the same
stylesheet with the same XML document (with no embedded link to a
styelsheet) I get nothing in the transform.
Stylesheet, XML and vb.net code below. Any Help is much appreciated.
Thanks in advance.
-Sam
Stylesheet.
************************************************** ******************
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:myns="http://www.w3.org/1999/xhtml">
<xsl:output method="html"></xsl:output>
<xsl:template match="/">
<p>
<xsl:text>Stuff is: </xsl:text>
<table border="1">
<tr>
<td>
<xsl:value-of select="span/myns:html/myns:*"></xsl:value-of>
</td>
</tr>
</table>
</p>
</xsl:template>
</xsl:stylesheet>
XML
************************************************** *************************
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="test1.xslt" ?>
<span>
<html xmlns="http://www.w3.org/1999/xhtml">
<body >
<table >
<tr>
<td align="left" colspan="6" valign="top"></td>
</tr>
<tr>
<td align="right" colspan="6" valign="top">
<table border="0" cellspacing="0" align="right" cellpadding="0">
<tr>
<td height="19" valign="middle"></td>
<td height="19" bgcolor="#D7D7D7" class="bodytext"
valign="top">blach!</td>
<td height="19" bgcolor="#D7D7D7" class="bodytext"
valign="top">bleem</td>
</tr>
<tr>
<td align="left" colspan="5" valign="top"></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
</span>
VB.NET source code:
************************************************** ******************************
dim myDoc as new XMLdocument
myDoc.load("thing.xml")
Dim myXSLT As New XslTransform
myXSLT.Load("test1.xslt")
'Dim writer As XmlTextWriter = New XmlTextWriter("data.html",
Nothing)
Dim fs As FileStream = New FileStream("out.html",
FileMode.Create)
myXSLT.Transform(myDoc, Nothing, fs, Nothing)
myDoc.Save(inFileName & ".xml")