Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.NET, XML, and Nested Relations

Status
Not open for further replies.

jopaumier

Programmer
Mar 15, 2002
97
US
Hi,

We have been given $$ by a client to develop a program in VB.NET that will take an ASCII file and convert it into XML based on a predefined schema that we are not at liberty to modify. Since we are new to this, we wanted to explore parsing the data, and use ReadXMLSchema and WriteXML to get the desired result.

However, when we use ReadXMLSchema, we get the error
"The same table (table_name) cannot be the child table in two nested relations."

We see where the "problem" is and by comments in cyberspace, apparently this is a shortcoming/bug in VB.NET. Some XML validators we tried do not choke on this, just VB.NET.

Has anyone encountered this error? Have you been able to work around it? Are our thoughts on the process (ReadXMLSchema, WriteXML) valid anyway? Sorry, no 3rd party tools allowed; must be all in VB.NET.

Thanks,
Jim
 
An XSD document is (well, supposed to be) a valid XML document. You could load the XSD into a DOM and parse it yourself -- just look for the elements starting with "xs" or "xsd" namespace (whichever one the XSD writer used).

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
If you know the table format, why not create the dataset/table and then ds.writexml after you have read the file.
 
Chip and DigitalGeek,

Thank you for your replies. The XSD is valid under the few validators we tried, and it is a known problem with vb.net.

We cannot modify the schema and we were hoping that having it would simplify the process of reading a set of text files and writing out XML files without additional hoops.

I will have the person who is working on this project look at the DOM. That may give us what we need - again, two newbies feeling their way along!

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top