<Need Help>How to get the count of elements referencing another element in XSLT?

Joined
Sep 12, 2008
Messages
3
Reaction score
0
Hi,
I have the following question:

XML snippet:

<root>

<template1>
<elem1>1000</elem1>
<elem2>
<subelem1>65</subelem1>
</elem2>
</template1>

<template2>
<type1>
<tag1>1000</tag1>
<tag2>1</tag2>
<type1>

<rule>
<ref>1</ref>
</rule>

<rule>
<ref>1</ref>
</rule>

<rule>
<ref>1</ref>
</rule>

<rule>
<ref>1</ref>
</rule>

<rule>
<ref>1</ref>
</rule>

</template2>

</root>

In the above example,
/template2/type1/tag1 references to /template1/elem1
and /template2/rule/ref references to /template2/type1/tag2

How can we write a XSLT rule to allow only 4 <rule> tags for every <type1> only if the corresponding /template1/elem2/subelem1 is greater than 60.

In the above example it has to give error as (value of)tag1=elem1 and number of <rule> tags are 5 that have (value of)ref=tag2.

Please help me in this regard.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top