Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: empty xml element spanning multiple lines >Thread Next - Re: empty xml element spanning multiple lines Re: empty xml element spanning multiple linesTo: NULL Date: 3/23/2009 5:21:00 PM Hermann Peifer <peifer@g...> writes: > Mark wrote: >> I've working on processing xml from an external source (who I can >> contact to change things if they turn out to be incorrect) and in >> their xml documents empty elements span multiple lines e.g. >> <element> >> </element> >> rather than <element /> or <element></element>. When I'm parsing the >> xml the text of the element is '\n' which is what I would expect, >> but not what they intend - it should be null or an empty string or >> whatever. Is what they're doing wrong in expressing an empty >> element, or is it simply ugly (but not wrong)? >> TIA > > As you noticed: the "empty" elements are obviously not empty. If the data provider's intention was to provide a true empty element, then the only options are <element /> or <element></element>, anything else would be wrong. [Pedantry alert]. Well, 'only' may be a bit strong. There are also forms like <element ></element> and <element /> -- unlikely to matter to the OP or the data source, but not to be overlooked by a parser. --CMSMcQ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
