trilawney
trilawney

Reputation: 1792

is there a difference between <element/> and <element></element> in XML?

In an XML file, I need to send the value of an element as "nil", does having the tag as the following <element/> and <element></element> one and the same ?

Upvotes: 0

Views: 42

Answers (1)

Martin Honnen
Martin Honnen

Reputation: 167696

There is no difference between <element/> and <element></element>, both are markup for an empty element element. As for XSD, if you want to create a nil valued element, see http://www.w3.org/TR/xmlschema-0/#Nils, you need <element xsi:nil="true"/> respectively <element xsi:nil="true"></element>.

Upvotes: 1

Related Questions