XML root node with slash ... inexplicable?

Why do you have rootnode in an XML document that looks like this:

<return/>

Why is this trait there? I have never seen an XML document like this, however in the application I am debugging, a root node similar to this one is created and adding any child nodes seems unsuccessful.

Removing a slash resets the program.

It uses the MSXML DOM in C ++ under windows.

+3
source share
2 answers

<foo/>equivalent to <foo></foo>. This is called an empty element . Without ending, the /open tag will not have the corresponding closing tag and, therefore, an error.

+9
source

node xml . .

+1

Source: https://habr.com/ru/post/1756181/


All Articles