Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > <Need Help>How to get the count of elements referencing another element in XSLT?

Reply
Thread Tools

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

 
 
njsimha njsimha is offline
Junior Member
Join Date: Sep 2008
Posts: 3
 
      09-12-2008
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
referencing an element in another frame Cat 22 HTML 0 10-17-2010 07:56 PM
problems referencing form elements by deriving their name from the value of another element libsfan01 Javascript 2 07-13-2006 09:32 PM
container elements for repeating elements ('element farms') needed? Wolfgang Lipp XML 1 01-30-2004 04:09 PM
container elements for repeating elements ('element farms') needed? Wolfgang Lipp XML 0 01-28-2004 02:50 PM
Can't get referencing element by id to work in mozilla James McGuigan HTML 6 07-21-2003 01:25 PM



Advertisments