Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 XML document cannot contain multiple root level

views
     
everling
post Oct 17 2009, 10:12 PM

Look at all my stars!!
*******
Senior Member
3,591 posts

Joined: Feb 2008
If I'm interpreting right, this should be an example of your problem.
CODE
<?xml version="1.0"?>
<rootNode1>
    <childGen1>
    </childGen1>
</rootNode1>
<rootNode2>
    <childGen1>
    </childGen1>
</rootNode2>


This is an example of what a valid XML file may look like.
CODE
<?xml version="1.0"?>
<rootNode>
    <childGen1>
    </childGen1>
    <childGen1>
    </childGen1>
</rootNode>


Please note that an XML document cannot contain multiple root nodes.
everling
post Oct 18 2009, 01:29 AM

Look at all my stars!!
*******
Senior Member
3,591 posts

Joined: Feb 2008
Not having any errors doesn't mean that the application will work as expected. It may instead silently use default values if it didn't detect any recognisable input; default values that may not be what you want.

If you're lucky, the application that uses that XML isn't sensitive to where that XML fragment is located, or the default values happened to be what you wanted. Location of XML fragments can be a factor for XML using apps.

Haha. "<! --" gets escaped as "[bad html removed]". No wonder your code pasting didn't made sense in the first place. Bad forum!

I don't really understand why they sanitised it by replacing it. Isn't escaping it with "&lt;!--" enough?

This post has been edited by everling: Oct 18 2009, 01:32 AM

 

Change to:
| Lo-Fi Version
0.0152sec    0.68    6 queries    GZIP Disabled
Time is now: 17th December 2025 - 06:53 PM