I'm pretty new to all this XML and .net stuff... not sure if this question belongs here or in the XML forum.
I'm writing a VB.NET program to take data provided by our IT department from our Unix/universe "mainframe" system and update our tables in a MSDE enviroment for ASP.NET use. Anyway, I was originally thought I was going to have to parse a txt file, but they decided to give it to me in XML... all the better, so I thought.
Anyway, I used:
DataSet1.ReadXml("filename.xml"
to generate a dataset to use to update the database. Problem is, when the program runs and tries to inturpret the xml, I get the following error:
'xml:stylesheet' is an invalid name for a processing instruction. Line 2, posistion 3.
I look at a demo file (more on trying to edit the original file later):
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="WEBXML.xsl"?>
<WEBP>
<ITEM>
<SER>AKCU01072</SER>
<PART>P70680</PART>
</ITEM>
... more elements...
Anyway, as I said, I'm new to this xml stuff, but I did go looking for examples of properly formatted xml, and found if I change the second line to:
<?xml-stylesheet type="text/xsl" href="WEBXML.xsl"?>
everything works hunky-dory. In fact, I have the program working... it humms along and updates my msde database.
I asked the IT guy who gave me the xml how it was generated. He knows about as much about xml as I do. He said he just used a "save as" feature in his wintegrate program.
Now, the problem is, I don't want to have to make this change everytime I receive new data. And to make troubles worse, the inital dump file for the database we are working on seems to be too big for me to open directly and change this second line. (run out of storage error).
SO! Any ideas on:
1. Why I am getting "badly formatted" xml in the first place? Or is it a .net parsing problem?
2. How to ignore this process instruction completely so I can use the xml in my program without bombing out?
3. Other ideas???
Thanks in advance for the help.
I'm writing a VB.NET program to take data provided by our IT department from our Unix/universe "mainframe" system and update our tables in a MSDE enviroment for ASP.NET use. Anyway, I was originally thought I was going to have to parse a txt file, but they decided to give it to me in XML... all the better, so I thought.
Anyway, I used:
DataSet1.ReadXml("filename.xml"
to generate a dataset to use to update the database. Problem is, when the program runs and tries to inturpret the xml, I get the following error:
'xml:stylesheet' is an invalid name for a processing instruction. Line 2, posistion 3.
I look at a demo file (more on trying to edit the original file later):
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="WEBXML.xsl"?>
<WEBP>
<ITEM>
<SER>AKCU01072</SER>
<PART>P70680</PART>
</ITEM>
... more elements...
Anyway, as I said, I'm new to this xml stuff, but I did go looking for examples of properly formatted xml, and found if I change the second line to:
<?xml-stylesheet type="text/xsl" href="WEBXML.xsl"?>
everything works hunky-dory. In fact, I have the program working... it humms along and updates my msde database.
I asked the IT guy who gave me the xml how it was generated. He knows about as much about xml as I do. He said he just used a "save as" feature in his wintegrate program.
Now, the problem is, I don't want to have to make this change everytime I receive new data. And to make troubles worse, the inital dump file for the database we are working on seems to be too big for me to open directly and change this second line. (run out of storage error).
SO! Any ideas on:
1. Why I am getting "badly formatted" xml in the first place? Or is it a .net parsing problem?
2. How to ignore this process instruction completely so I can use the xml in my program without bombing out?
3. Other ideas???
Thanks in advance for the help.