On Oct 31, 6:49 am, Oleg Tkachenko <f...@dummy.com> wrote:
> Joe Fawcett wrote:
> > "Oleg Tkachenko [MVP]" <s...@body.com> wrote in message
> >news:eaLg44uGIHA.1184@TK2MSFTNGP04.phx.gbl...
> >> Valery wrote:
> >>> In the following XML:
>
> >>> <?xml version="1.0" encoding="utf-8" ?>
> >>> <Plcy service="ILiability" boId ="LifePolicy, 1">
> >>> <Prem service="IPremium" boId ="RegularPremium, 1"></Prem>
> >>> <L1 service="ILifeMain" type = "Life1">
> >>> <FirstName>Sheila</FirstName>
> >>> <Age>65</Age>
> >>> <Relation>spouse</Relation>
> >>> </L1>
> >>> <L2 service="ILife" type = "Life2">
> >>> <FirstName>Bruce</FirstName>
> >>> <Age>70</Age>
> >>> </L2>
> >>> </Plcy>
>
> >>> I would like to select Nodes with boId attribute which are empty. I am
> >>> using an XPath expression:
>
> >>> "//*[@boId and not(text())]"
> >> IN English that means "all elements having attribute bold and not having
> >> at least one child text node". Plcy and Prem both satisfy this condition.
> >> Try wider - select nodes that have no child nodes of any type at all:
>
> >> "//*[@boId and not(node())]"
>
> >> --
> >> Oleg Tkachenko [XML MVP, MCPD]
> >>
http://www.tkachenko.com/blog|
http://www.XmlLab.Net >
> > Prem appears to have no content.
>
> Yes, but it has end tag, so in XmlReader/XPathNavigator terms isn't
> empty element:
>
> XPathNavigator.IsEmptyElement Property
>
> When overridden in a derived class, gets a value indicating whether the
> current node is an empty element without an end element tag.
>
>
http://msdn2.microsoft.com/en-us/library/system.xml.xpath.xpathnaviga... >
> --
> oleg- Hide quoted text -
>
> - Show quoted text -
Wow (surprised) and thanks. It works indeed.