XML fragment with multiple roots: suppressing VS error

Posted by Laurent on Stack Overflow See other posts from Stack Overflow or by Laurent
Published on 2010-05-26T09:56:35Z Indexed on 2010/05/26 10:01 UTC
Read the original article Hit count: 215

Filed under:
|

In Visual Studio, I have an XML file (with .xml extension) which contains an XML fragment that I use in my program:

<tag1>
data 
...
</tag1>
<tag2>
data 
...
</tag2>

Visual Studio shows me an error in the error list: "XML document cannot contain multiple root level elements".

But this is not a complete document, just a fragment that will be reused. I want to keep my 2 roots in my fragment. How can I get rid of the error message?

Thanks

© Stack Overflow or respective owner

Related posts about Xml

Related posts about visual-studio