Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- monkeys paw
September 8, 2009, 5:48 pm
rate this thread
The are called "empty elements".
are *equivalent* in XML, they do *not* differ.
You are free to write either one, and they have the same meaning.
Then you are not treating it as XML.
Errr, non-empty elements are ... not empty!
Look to see if there is any content.
I am pretty sure this is an XY-problem.
What are you really trying to accomplish?
That is, why do you think you need to be able to distinguish
between <br/> and <br></br>?
email: perl -le "print scalar reverse qq/moc.noitatibaher0cmdat/"
- Lawrence Statton
September 8, 2009, 9:09 pm
I had the same problem as OP once some years ago. I can't remember how
I solved it, but that was in the "bad old days" when I was still using
XML::Parser and friends, and I did solve it.
As to "why" one would want to differentiate between <foo/> and
<foo></foo>, in my situation I reading in a serialization stream from a
database dump, where the first tag was used to represent NULL and the
other to represent the empty-string.
That applying these semantics to XML tags was a incompatible with the
XML standard was lost on the long-dead author of the dump tool.
 He wasn't actually dead, but was just as unavailable to fix his
error as if he had been dead.
- » FAQ 3.19 How can I make my CGI script more efficient?
- — Next thread in » PERL Discussions