I need to create the following
<Document>
<Cstr>
<Book>
<name>test</name>
</Book>
<Book>
<name>test</name>
</Book>
</cstr>
</Document>
How do I get </cstr>??
Can you help me with the code for the same??
I need to create the following
<Document>
<Cstr>
<Book>
<name>test</name>
</Book>
<Book>
<name>test</name>
</Book>
</cstr>
</Document>
How do I get </cstr>??
Can you help me with the code for the same??
Cstr isn't a root node - it's embedded in the Document node. Or it would if the opening tag matched the closing one. It doesn't because the closing tag doesn't start with the capital 'C'.
By the way, the structure will be obvious if you use indentation (see below). You can achieve that by using Insert > Insert Code (in the rich formatting view), therefore please use that for pasting code snippets.
test test
XML documents can have only one root node, that's defined in the XML standard.
If your XML file has many <Document> elements, you can add <Documents> root node and put all <Document> elements as child nodes of <Documents>.
You also asked "How do I get </cstr>?" What do you mean by that?
André Arnaud de Cal...
293,238
Super User 2025 Season 1
Martin Dráb
231,923
Most Valuable Professional
nmaenpaa
101,156
Moderator