473,554 Members | 3,228 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using XSLT to transform XML prior to loading into Dataset

I am trying to transfor an XML document prior to loading into a
Dataset. My problem stems from the known bug in Visual Studio that
prevents loading a well formed XML because of duplicate child names:

http://support.microsoft.com/default...b;en-us;325696

Anyway, I want to transform the XML using the XSLT to get around this
problem, but I am having a tough time coming up with a way to apply
the XSLT before loading it into the dataset. Any help and sample code
appreciated.
Thanks in advance.
-Patrick
ps***********@h otmail.com
Nov 12 '05 #1
2 4481
The XslTransform class has an overload of the Transform method that returns
an XmlReader. Use that the load the DataSet.

"Patrick J. Schouten" <ps***********@ hotmail.com> wrote in message
news:1b******** *************** ***@posting.goo gle.com...
I am trying to transfor an XML document prior to loading into a
Dataset. My problem stems from the known bug in Visual Studio that
prevents loading a well formed XML because of duplicate child names:

http://support.microsoft.com/default...b;en-us;325696

Anyway, I want to transform the XML using the XSLT to get around this
problem, but I am having a tough time coming up with a way to apply
the XSLT before loading it into the dataset. Any help and sample code
appreciated.
Thanks in advance.
-Patrick
ps***********@h otmail.com

Nov 12 '05 #2
Thanks. That worked great! Here is what I came up with. Let me know if
you have any comments. Thanks again.

Dim resolver As XmlUrlResolver = New XmlUrlResolver
resolver.Creden tials =
System.Net.Cred entialCache.Def aultCredentials

Dim xslt As New XslTransform
xslt.Load(CType ("c:\mytest.xsl ", String))

Dim myData As New XPath.XPathDocu ment("c:\myTest .xml")

Dim reader As XmlReader = xslt.Transform( myData, Nothing,
resolver)

ds.ReadXml(read er)

Me.DataGrid1.Da taSource = ds

Patrick
ps***********@h otmail.com
"Dare Obasanjo [MSFT]" <da***@online.m icrosoft.com> wrote in message news:<#O******* *******@TK2MSFT NGP10.phx.gbl>. ..
The XslTransform class has an overload of the Transform method that returns
an XmlReader. Use that the load the DataSet.

"Patrick J. Schouten" <ps***********@ hotmail.com> wrote in message
news:1b******** *************** ***@posting.goo gle.com...
I am trying to transfor an XML document prior to loading into a
Dataset. My problem stems from the known bug in Visual Studio that
prevents loading a well formed XML because of duplicate child names:

http://support.microsoft.com/default...b;en-us;325696

Anyway, I want to transform the XML using the XSLT to get around this
problem, but I am having a tough time coming up with a way to apply
the XSLT before loading it into the dataset. Any help and sample code
appreciated.
Thanks in advance.
-Patrick
ps***********@h otmail.com

Nov 12 '05 #3

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

Similar topics

4
1967
by: Pat | last post by:
Is anyone using XML instead of HTML for pages of content? If so is there a public site to browse? Can someone point me to a discussion of the pros and cons of doing this? I am trying to get a handle on how close XML is to replacing HTML for browsing specifically (I am aware of its other benefits.) Also I do understand that XML can be...
1
363
by: Wil | last post by:
I'm very new to developing in .NET and even newer to XML. The past few days have been pretty frustrating for me because I'm trying to perform a transform on data in a dataset and it's not working. Basically, all of the data is stored in an Access .mdb that is read into a dataset when the application is loaded. There are some minor changes...
0
1252
by: Rocio | last post by:
I have a dataset with 5 columns. The first 4 columns are simply string columns, but the last one is another dataset with 4 simple columns. The problem is that, the XSLT transform only reads data from the main dataset, for the embedded dataset (5th column) it only gets the column type. This is what I get after I read data into this dataset:...
3
3208
by: Matthias Marx | last post by:
Hi, May some one could help me. I want to transform data, coming from SQL Server and loaded to a dataset wiuth xslt. After that, I want convert it by a xslt style sheet, and store it back or in
7
2438
by: Doug Heeren | last post by:
I have the following section of VB.NET code that transforms a simple dataset into an Excel xml workbook. It works fine for < 50 rows or so, but I have about 8,000 rows I need to transform. Is there a better way than what I am doing. This is part of an ASP.NET applicaiton. 'Clear the output stream Response.ClearHeaders()...
5
17688
by: Drew Yallop | last post by:
I read an XML file with a stream reader in VB.Net. When I look at the stream reader output in debug mode (by passing cursor over the stream reader object)the format is a perfect replica of the file as displayed when I open the xml file in VS .net 2003 IDE. When I perform the same procedure in C# the stream reader obkect displays a chaotic...
0
1262
by: Terry Brown | last post by:
I have an xml file: <?xml version="1.0" encoding="utf-8" ?> <G2Registers xmlns="http://tempuri.org/registers.xsd"> <register> <name>Version Register</name> <address>"00000000"</address> <verilogname>"PPC_Version"</verilogname> <bitfield>
3
1998
by: thomas.porschberg | last post by:
Hi, I want to read records from a database and export it in an arbitrary format. My idea was to feed a class with a String array fetched from the database and let this class fire SAX events as processor input. The basic class hierarchy is:
2
5649
by: kamil.nowicki | last post by:
Hi there, I want to create flat txt file from my data stored in my dataset. I do xslt transformation and i've got sth like that: (where ds - is my dataset, output.txt - is my result --------------------------------------------------------------- //Create a new XslTransform object. XslTransform xslt = new XslTransform();
0
7775
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8008
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7526
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5411
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5133
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3525
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1992
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1107
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
808
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.