Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / June 2004

Tip: Looking for answers? Try searching our database.

Transfrom() issues with xsl:document() function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 28 Jun 2004 15:25 GMT
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
Xselerator using MSXML4.
Mike - 28 Jun 2004 16:19 GMT
Found my problem. The answer isn't even worth posting.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.