[oXygen-user] Recusrive COUNT of specific elements in XSL 2.0

McGibbney, Lewis John Lewis.McGibbney at gcu.ac.uk
Wed Apr 18 12:16:41 CDT 2012


Hi Ken,
------------------------------------------------------
Can you try something along the lines of:

   <TotalImages value="{count(//img)}"/>

I don't know if you are using namespaces in your source or not, so
the above might have to change.
------------------------------------------------------

<TotalImages value="{count(//img)}"/>
  <xsl:value-of select="count(//html:img)"/>
<TotalImages/>

Worked a treat so thank you. I have a problem with the <TotalImages value="function">, however this is not crucial. I get the exact string entered in the brackets back e.g. "{count(//img)}"

Thank you very much.

Lewis

Glasgow Caledonian University is a registered Scottish charity, number SC021474

Winner: Times Higher Education’s Widening Participation Initiative of the Year 2009 and Herald Society’s Education Initiative of the Year 2009.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html

Winner: Times Higher Education’s Outstanding Support for Early Career Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html


More information about the oXygen-user mailing list