Consider this XML: 1. <myElement> </yourElement> </myElement>
I get an error "The file is not well-formed.myElement closing element name expected."
However if I have yourElement as below it works fine. 2, <myElement> <yourElement></yourElement> </myElement>
Any idea why 1st XML doc is not well formed
Sharika Raj
Greenhorn
Joined: Aug 31, 2004
Posts: 26
posted
0
</yourElement> is a closing element.There is no start element, so it is not wellformed.You can use <yourElement> </yourElement> or <yourElement/> if element value is empty.
Vasim are you working in bangalore. I have seen lots of office mails with same name.
Vasim Patel
Ranch Hand
Joined: Apr 29, 2004
Posts: 87
posted
0
</yourElement> is a closing element.There is no start element, so it is not wellformed.
But isnt it valid to have just </yourElement> signifying empty element.
Vasim are you working in bangalore. I have seen lots of office mails with same name.
Yes I work in Bangalore. Who do you work for?
Vasim Patel
Ranch Hand
Joined: Apr 29, 2004
Posts: 87
posted
0
I got it.
It should be <myElement> <yourElement/> </myElement>
An empty element is represented by <yourElement/> and not </yourElement>