• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Cannot convert #NUMBER to a NodeList - Xalan and the XPath function count()

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to count the occurrences of an Element based on the value of one its attributes. I have written the XSLT displayed below and tested it in an online XSLT tester and it works so far.

When I write my own Java code, though, I keep getting an error that Cannot convert #NUMBER to a NodeList. I cannot find a good answer though.

Here is my XSLT:



And here is how I invoke the transformation


In the above code I iterate over a list of files and apply the XSLT to get the count of it and save it inside an XML SVG File as per the XSLT transformation which goes to a string (via a ByteArrayOutputStream). However even before I reach that point, I get the exception I mentioned at the top.

So what's the issue?

Thanks,
D.
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think there is such thing in xslt/xpath

<xsl:value-of select="count(/**/xacml3:Rule[@Effect='Deny'])" />


write instead this,
 
reply
    Bookmark Topic Watch Topic
  • New Topic