O
oSup
Hi, I have a question, how to solve this stupid problem:
Let's have this source:
<data>
<groups>
<group id="1">gr1</group>
<group id="2">gr2</group>
<group id="3">gr3</group>
</groups>
<articles>
<article aid="1">
<group id="2"/><group id="3"/>
</article>
<article aid="2">
<group id="2"/><group id="3"/><group id="1"/>
</article>
<article aid="3">
<group id="4"/>
</article>
<article aid="4">
</article>
</articles>
</data>
I'd like to select just articles, they are contained in at least one
existing group. It means articles aid={1, 2}. How to select them? Id
tried something like condition:
.... i'm in /data/articles/article scope...
count(/data/groups/group[@id = ./group/@id]) > 0
correctly I should use something like IN operator, because I'm
comparing ID with group of attributes, it means
count(/data/groups/group[@id in ./group/@id]) > 0
.... but XSLT doesn't have this kind of operator... well, do you have
any idea to solve that?
Thanks a lot!
osup
Let's have this source:
<data>
<groups>
<group id="1">gr1</group>
<group id="2">gr2</group>
<group id="3">gr3</group>
</groups>
<articles>
<article aid="1">
<group id="2"/><group id="3"/>
</article>
<article aid="2">
<group id="2"/><group id="3"/><group id="1"/>
</article>
<article aid="3">
<group id="4"/>
</article>
<article aid="4">
</article>
</articles>
</data>
I'd like to select just articles, they are contained in at least one
existing group. It means articles aid={1, 2}. How to select them? Id
tried something like condition:
.... i'm in /data/articles/article scope...
count(/data/groups/group[@id = ./group/@id]) > 0
correctly I should use something like IN operator, because I'm
comparing ID with group of attributes, it means
count(/data/groups/group[@id in ./group/@id]) > 0
.... but XSLT doesn't have this kind of operator... well, do you have
any idea to solve that?
Thanks a lot!
osup