473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Transformation problems...

I have an XML document and an XSLT transformation sheet. My first issue is that my XML file won't load into the XPathDocument object. However, when I use an obsolete transformation method where I specify the XML input file and output file, I get the same error. The error is:

An unhandled exception of type 'System.Xml.XmlException' occurred in system.xml.dll
Additional information: System error.

Here's my code... commented to show where the errors are...
//XmlDocument xmlDoc = new XmlDocument();
XslTransform xslDoc = new XslTransform();

// ++++++ IF I UNCOMMENT THIS, THE FILE LOADS JUST FINE
//xmlDoc.Load(this.xmlFilePath.Text);
//xmlDoc.Save(@"c:\temp\xml.xml");

xslDoc.Load(this.xslFilePath.Text, null);

// +++++ ERROR HAPPENS HERE...
XPathDocument xpathdocument = new XPathDocument(@"C:\Temp\xml.xml");

XmlTextWriter writer = new XmlTextWriter(@"C:\temp\output.html", System.Text.Encoding.UTF8);
writer.Formatting = Formatting.Indented;// never reaches this part
xslDoc.Transform(xpathdocument, null, writer, null);
// +++++ IF I CHANGE THIS TO THE FOLLWOING, I GET THE SAME ERROR:
xslDoc.Transform(@"c:\temp\xml.xml", @"c:\temp\output.html");
Nov 12 '05 #1
1 1913
Why don't you catch the exception and print it out to see what the error is? It looks like there is an error in your file.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Andrew Connell" <sp**@aNOSPAMMEconnell.com> wrote in message news:Ov**************@TK2MSFTNGP12.phx.gbl...
I have an XML document and an XSLT transformation sheet. My first issue is that my XML file won't load into the XPathDocument object. However, when I use an obsolete transformation method where I specify the XML input file and output file, I get the same error. The error is:

An unhandled exception of type 'System.Xml.XmlException' occurred in system.xml.dll
Additional information: System error.

Here's my code... commented to show where the errors are...
//XmlDocument xmlDoc = new XmlDocument();
XslTransform xslDoc = new XslTransform();

// ++++++ IF I UNCOMMENT THIS, THE FILE LOADS JUST FINE
//xmlDoc.Load(this.xmlFilePath.Text);
//xmlDoc.Save(@"c:\temp\xml.xml");

xslDoc.Load(this.xslFilePath.Text, null);

// +++++ ERROR HAPPENS HERE...
XPathDocument xpathdocument = new XPathDocument(@"C:\Temp\xml.xml");

XmlTextWriter writer = new XmlTextWriter(@"C:\temp\output.html", System.Text.Encoding.UTF8);
writer.Formatting = Formatting.Indented;// never reaches this part
xslDoc.Transform(xpathdocument, null, writer, null);
// +++++ IF I CHANGE THIS TO THE FOLLWOING, I GET THE SAME ERROR:
xslDoc.Transform(@"c:\temp\xml.xml", @"c:\temp\output.html");
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sergio del Amo | last post by:
Hi, I use the xslt functions provided by php. I am running in my computer the package xampp(www.apachefriends.org) which includes php/apache/mysql .. In this package the php includes the sablotron...
0
by: pulvertum | last post by:
Hello, I need an org.w3c.dom.Document so I can pass them to do a transformation of my XML using XSL (to another XML as result). I've tried several solutions but didn't have the desired result:...
2
by: Alex | last post by:
We am facing a problem with transforming docbook xml to html. I am running PHP4 on apache and i first tried to use sablotron which took 40+ seconds to convert a 50kb xml file. When using xsltproc...
7
by: Bilal | last post by:
Hello, I'm attempting to "populate" an template XML file with some data using identity transform (approach suggested by Joe K.; Thanks! :-) and have come across some strange behaviour using...
2
by: HendrikLeder | last post by:
Hello everybody :-) Next year I`ll write my diploma in computer science for business (It`s a degree in Germany) and I`ve some questions about the topic. The diploma will handle about refactoring...
1
by: =?Utf-8?B?R2xlbm4gR29tZXo=?= | last post by:
Does Office Excel 2000 support XSLT transformation of data from XML cause am having problem when the attachment is opened in the client side if the Excels version is in Office 2000 and also its...
14
by: Thomas Bauer | last post by:
Hello, I search a example like that. (1,0,0,1,4,5 ) -- moving (1,0,0,1,0,0 ) -- normal matrix (-1,0,0,1,0,0 ) -- Mirror Y-Axis (0,-1,0,1,0,0 ) -- Mirror X-Axis I caluculate all in mm.
2
by: bizt | last post by:
Hi, I am performing an XSLT on a XML feed. The XSLT produces me with PHP code that I eval then insert into my DB. However, the way that the system Im assigned to is setup, I need to convert all...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.