I have a doctype that has 20 properties on it... all true/false datatypes. 10 of these properties need to be checked for a true state and counted. So somehow I need to be able to single out or define these 10 properties from all other properties and then build a value of TOTAL clicked true.
In other words, if 7 of the specific 10 properties have been clicked true, I need to be able to print that value to screen via <vsl:value-of select="$totalTrue"/>
Can this be done, and if so, can someone please point me in the right direction with a code sample or guide? thx!
Hi, first of all it seems to me that you'd better implement your properties with a checkbox list. Since a checkbox list represented by a comma-separated string of the selected options you can count them e.g. like this:
Rodion's suggestion is probably the better solution - but I also know that migrating those 20 properties on a lot of documents will probably never happen, so try this:
of course, if you know something that can make the XPath better, be sure to include that, e.g.: If they're all prefixed with 'use' (useCandyBars, useFreeware, etc.), change the XPath to this:
XSLT - counting doctype properties - thue/false checked
I have a doctype that has 20 properties on it... all true/false datatypes. 10 of these properties need to be checked for a true state and counted. So somehow I need to be able to single out or define these 10 properties from all other properties and then build a value of TOTAL clicked true.
In other words, if 7 of the specific 10 properties have been clicked true, I need to be able to print that value to screen via <vsl:value-of select="$totalTrue"/>
Can this be done, and if so, can someone please point me in the right direction with a code sample or guide? thx!
Hi, first of all it seems to me that you'd better implement your properties with a checkbox list. Since a checkbox list represented by a comma-separated string of the selected options you can count them e.g. like this:
Hi Robert,
Rodion's suggestion is probably the better solution - but I also know that migrating those 20 properties on a lot of documents will probably never happen, so try this:
of course, if you know something that can make the XPath better, be sure to include that, e.g.: If they're all prefixed with 'use' (useCandyBars, useFreeware, etc.), change the XPath to this:
(if you're inside a loop, you don't need $currentPage, but you may know that already)
/Chriztian
is working on a reply...