Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Xpath query to return "NULL" values? >Thread Next - Re: Xpath query to return "NULL" values? Re: Xpath query to return "NULL" values?To: NULL Date: 6/6/2009 1:54:00 PM Mario Splivalo wrote: > <a> > <b>1</b> > <b>2</b> > <b></b> > <b>3</b> > </a> > > When I execute this XPath query against it: /a/b/text() > I get only 1, 2 and 3: That is correct. In the XML data model, an empty element has no children at all, so /a/b/text() or indeed /a/b/node() will skip over that entirely. If you want an empty string, you could rewrite this as /a/b/string(.) which returns the string value of each <b> element in turn. Since the string value of an element is the concatenation of its contained text nodes, this will yield the results you expected. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
