Groups | Blog | Home
all groups > dotnet xml > june 2004 >

dotnet xml : Transfrom() issues with xsl:document() function



Mike
6/28/2004 7:25:15 AM
I'm getting a strange result when I reference an external
xml document in my XSLT. The transformation work's fine in
Xselerator, but not in .NET. It looks as though I'm
getting garbage in the output. Here's the relevant portion
of the xslt:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes"/>
<xsl:variable name="xmlDataset" select="document
('file:\\C:\dataset.xml')"/>

<xsl:template match="/">
<Record>
<DataFields>
<DataField Value="0001"/>
<DataField>
<xsl:attribute name="Value">
<xsl:value-of
select="$xmlDataset//Table/Company_Name"/>
</xsl:attribute>
</DataField>
</DataFields>

<xsl:apply-templates select="//Table"/>
</Record>
</xsl:template>

The results from the input file are fine, but the result
of the select="$xmlDataset//Table/Company_Name" which
references the external document looks like this:

<DataField Value=\"admin\t&#xD;&#xA;\t\t\t\t\t\t\Test
Company">
</DataField>

The 'Test Company' is correct, but what's up with all of
the stuff before that? Like I said, it works fine in
Mike
6/28/2004 8:19:09 AM
AddThis Social Bookmark Button