On Wed, 18 Feb 2004, Bruce Britts wrote:

> I'm attempting to use the XML::XPath count() function and will
> get,  'XML::XPath::Node::Element=SCALAR(0x1fa205c)'  returned instead
> of  the expected integer using the code below;
>
> [% FILTER null;
>          USE indx = XML.XPath('statspages.xml');
>          output = [ ];
>          FOREACH row = indx.findnodes('/statspages/statscat/category');
>                  num = row(count('linehead'));

Just a guess off the top of my head, but how about this instead:

                   num = row(indx.count('linehead'));

I've never used XML::XPath, but if you're trying to call a function
of that package, it seems to me like you might need to call it as a
method of your indx instance.  Your template environment doesn't get
polluted with exported functions like in a Perl script.

Sorry if I'm way off the mark...

Take care,

Dave

/L\_/E\_/A\_/R\_/N\_/T\_/E\_/A\_/C\_/H\_/L\_/E\_/A\_/R\_/N\
Dave Cash                              Power to the People!
Frolicking in Fields of Garlic               Right On-Line!
[EMAIL PROTECTED]                                  Dig it all.

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to