Click here to Skip to main content
16,005,141 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: Output not obtained Pin
Fadi Yoosuf1-Jun-09 22:39
Fadi Yoosuf1-Jun-09 22:39 
QuestionASP.NET : Get Attribute Value from XML Pin
Vijay Jadhav, India.25-May-09 23:36
Vijay Jadhav, India.25-May-09 23:36 
AnswerRe: ASP.NET : Get Attribute Value from XML Pin
Vijay Jadhav, India.26-May-09 3:59
Vijay Jadhav, India.26-May-09 3:59 
QuestionRender the custom server side control using XSL Pin
Brij25-May-09 19:08
mentorBrij25-May-09 19:08 
QuestionPrint XSLT? Pin
notarry24-May-09 23:24
notarry24-May-09 23:24 
AnswerRe: Print XSLT? I want to print XSLT(HTML and PDF) file. Pin
adatapost26-May-09 1:38
adatapost26-May-09 1:38 
AnswerRe: Print XSLT? Pin
notarry27-May-09 16:06
notarry27-May-09 16:06 
QuestionReading XML Pin
M_Aurelius23-May-09 22:20
M_Aurelius23-May-09 22:20 
I orginally posted this in the C# forum as I did not notice there was a xml forum... Big Grin | :-D

I am trying to read an xml file into a dataset and have been met with nothing but problems.

The xml file is in the following format:

<?xml version="1.0"?><br />
<Catalog xmlns:dt="dt"><br />
<Rec><br />
<ITEM dt:dt="string"></ITEM><br />
<QTY dt:dt="string">1</QTY><br />
<SUB dt:dt="string"></SUB><br />
<CATALOG dt:dt="string">ABC123</CATALOG><br />
</Rec><br />
</Catalog>


I have tried this code in C#:
<br />
Dataset ds = new DataSet("Test");<br />
ds.ReadXML(OFD.FileName);<br />

When I set a breakpoint just after this code and examine ds, all have is a table called "Rec" and one column called "Rec_Id", clearly this is not what I want!!

Someone else has tried this and gets finds that ds has changed from "Test" to "Catalog", which is believed to have been picked up from the xml file. Expanding the Tables node reveals have 5 tables:
[0] Rec
[1] ITEM
[2] QTY
[3] SUB
[4] CATALOG

I think this can be done by specifing a schema, but I do not know how you do this whilst reading into a dataset nor do I know enough about schemas to know what to specify where!!

If I remove the dt:dt="String" datatypes then everything is fine. I do not want to manually do this so if this is the only way then how can I do it programatically? I need an automated solution.

Can anyone help?

Thanks
AnswerRe: Reading XML Pin
harold aptroot23-May-09 23:46
harold aptroot23-May-09 23:46 
QuestionHelp for newbie Pin
Konstantin Yazvinski21-May-09 12:28
Konstantin Yazvinski21-May-09 12:28 
AnswerRe: Help for newbie Pin
led mike22-May-09 4:31
led mike22-May-09 4:31 
QuestionSelect XmlElement Help Pin
papy-boom21-May-09 3:27
papy-boom21-May-09 3:27 
QuestionHow to create a tool to generate xslt to transform one xml to another? Pin
salon21-May-09 1:15
salon21-May-09 1:15 
Questionremoving unwanted empty XML elements (this one contains code in a legible form) Pin
Craig Irwin20-May-09 17:37
Craig Irwin20-May-09 17:37 
AnswerRe: removing unwanted empty XML elements (this one contains code in a legible form) [modified] Pin
brifiction24-Apr-10 18:23
brifiction24-Apr-10 18:23 
QuestionRemoving unwanted empty XML elements Pin
Craig Irwin20-May-09 17:22
Craig Irwin20-May-09 17:22 
QuestionASP.Net : Xml Version Format Pin
Vijay Jadhav, India.18-May-09 0:18
Vijay Jadhav, India.18-May-09 0:18 
AnswerRe: ASP.Net : Xml Version Format Pin
Samer Aburabie18-May-09 7:29
Samer Aburabie18-May-09 7:29 
GeneralRe: ASP.Net : Xml Version Format Pin
Vijay Jadhav, India.18-May-09 22:01
Vijay Jadhav, India.18-May-09 22:01 
AnswerRe: ASP.Net : Xml Version Format [modified] Pin
George L. Jackson19-May-09 6:20
George L. Jackson19-May-09 6:20 
GeneralRe: ASP.Net : Xml Version Format Pin
Vijay Jadhav, India.20-May-09 0:55
Vijay Jadhav, India.20-May-09 0:55 
GeneralRe: ASP.Net : Xml Version Format Pin
Vijay Jadhav, India.25-May-09 20:03
Vijay Jadhav, India.25-May-09 20:03 
QuestionASP.NET : Identify XSD on the basis of XML in Web Service [modified] Pin
Vijay Jadhav, India.18-May-09 0:11
Vijay Jadhav, India.18-May-09 0:11 
Questionhow do i delete a xml file ? Pin
YiXiang_8916-May-09 22:47
YiXiang_8916-May-09 22:47 
Questionparse out the member name value Pin
califgal13-May-09 21:22
califgal13-May-09 21:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.