Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Test for Blank Children >Thread Next - Re: Test for Blank Children Re: Test for Blank ChildrenTo: NULL Date: 8/1/2005 7:47:00 PM Michael wrote: > <document> > ... > <comments> > <comment> > <author></author> > <reference></reference> > <date></date> > <data></data> > </comment> > ... > </comments> > ... > </document> > How can I check to see if the fields under <comment> are blank? You want to check whether the child elements of a <comment> element have any child nodes themselves so if a <comment> element is the context node you can simply check <xsl:if test="*/node()"> That should work for the sample you have above. If you also have to deal with elements that might contain only white space e.g. <data> </data> and you consider that as blank too then you need to refine the test e.g. <xsl:if test="*/node()[normalize-space() != '']"> -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
