Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - XPATH descendants repeating [Thread Next] One more thing...To: NULL Date: 7/3/2007 3:16:00 PM If I use "//TC1710/*", then I get the results that I want. However, I also need to be able to display only nodes that have the attribute A="1" using "//TC1710/*[@A='1']" for the XPATH. The problem is that descendant nodes of a node that has A="0" are not displayed whereas they are using "//TC1710/descendant::*[@A='0']" but that XPATH causes duplicates of the descendant nodes to be displayed. David "David Webb" <strangecargo> wrote in message news:utHxZTavHHA.2068@T...... > I have a .NET 2.0 web form that has a Treeview control bound to an > XmlDataSource control bound to the following XML document (only the relevant > part of the document is shown here): > > <TC1710 A="1" GQ="0" GQ1="0" GQ2="0" PS="0" GC="0" LC="0" OL=""> > <TC5485 A="0" GQ="0" GQ1="0" GQ2="0" PS="0" GC="0" LC="0" OL="" /> > <TC0191 A="0" GQ="0" GQ1="0" GQ2="0" PS="0" GC="0" LC="0" OL=""> > <TC8133 A="0" GQ="0" GQ1="0" GQ2="0" PS="0" GC="0" LC="0" OL=""> > <TC8151 A="1" GQ="0" GQ1="0" GQ2="0" PS="0" GC="0" LC="0" OL="" /> > <TC1773 A="1" GQ="0" GQ1="0" GQ2="0" PS="0" GC="0" LC="0" OL=""> > <TC1779 A="1" GQ="0" GQ1="0" GQ2="0" PS="0" GC="0" LC="0" OL="" /> > </TC1773> /> > </TC8133> /> > </TC0191> > </TC1710> > > I set the XPATH of the XmlDataSource to "//TC1710/descendant::*" with the > intention of selecting the descendant nodes of the TC1710 node expecting: > TC5485 > -TC0191 > --TC8133 > ---TC8151 > ---TC1773 > ----TC1779 > > But instead, each node that is within each descendant is displayed again as > separate branches: > TC5485 > TC0191 > -TC8133 > --TC8151 > --TC1773 > ---TC1779 > TC8133 > - TC8151 > - TC1773 > -- TC1779 > TC8151 > TC1773 > - TC1779 > TC1779 > > Shouldn't each node be displayed only once? > > There are no duplicates in the XML document. I have not been able to > determine if this is an issue with my XPATH syntax, the XmlDataSource, or > the Treeview control. > > I really need to be able to display the nodes as organized in the XML > document. This is my first XPATH project so any help will be greatly > appreciated. > > David > > > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
