xml - XSLT select all items that contain text -


I have not touched xslt in half a decade, and I do not remember how it would be. Basically, I have XML structure that looks like this:

  & lt; Xml & gt; & Lt; MenuDataResult & gt; & Lt; Item name = "firstlieritem" & gt; & Lt; Item & gt; & Lt; / Item & gt; & Lt; Item & gt; & Lt; / Item & gt; & Lt; Item name = "secondsreitim" & gt; & Lt; Item name = "Third Delirite" & gt; & Lt; ItemSelected & gt; True & lt; / ItemSelected & gt; & Lt; / Item & gt; & Lt; / Item & gt; & Lt; Item & gt; & Lt; / Item & gt; & Lt; Item & gt; & Lt; / Item & gt; & Lt; / Item & gt; & Lt; / MenuDataResult & gt; & Lt; / XML & gt; This XSLT is building a UL from this framework, but only at the second level of objects (this is for a secondary navigation bar on the left side of a page, which is the only other-command navigation. Item) It is used in maximum depth of two layers, so a simple check for item-selected node at the second level allows us to add the element of the "current" element of that node or the CSS of that element Similar navigation to enable lighting.  

Now they want to add a third layer like the above, move here, the third layer does not actually appear in the unordered list, only the second layer is the object, so the second layer is called the "current" To get the square, there should be one, even if the "item selected" node

we used to check it:

   & Lt; Xsl: if test = "('true', $ selected menu)" & gt; ... & lt; / Xsl: if & gt;   

And then check whether it is equal to the right to add to the class or not. But now I need that it not only look at the current item, but also in all the sub-commodities, as well as any of them are "true".

Can someone help me, to do so? I do not remember any subtlety of XSLT or how to do this ...

but Now I need that I want to look not only in the current item, but also in all sub-commodities, to see that none of them has "truth".

Use :

  .//* [. = 'True']    

Comments