xml file
-
I Had an xml file that had a table in it.table0 I have recently added another. table1. now when I run my program it says there are multiple root elements Line 10,position 2. does this mean i need to use SQL. if so or if not can someone type some sample code that would stop the root element problem. If you need to see my code I have another thread posted under datagrid/xmlfile that i posted yesterday and is on the next page.
-
I Had an xml file that had a table in it.table0 I have recently added another. table1. now when I run my program it says there are multiple root elements Line 10,position 2. does this mean i need to use SQL. if so or if not can someone type some sample code that would stop the root element problem. If you need to see my code I have another thread posted under datagrid/xmlfile that i posted yesterday and is on the next page.
The clue is in the error... i am guessing your original file was something like this:
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>Now i am guessing that you have a second table it looks something like this:
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>The problem is the two Table nodes in the root, therefore you need to put in a single root element:
<Tables>
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>
<Table>
<FirstElement/>
<SecondElement/>
...
<LastElement/>
</Table>
</Tables>Hope this helps Tom