RE: [xsl] Concat function returning nodeset when param is part of arguments

Subject: RE: [xsl] Concat function returning nodeset when param is part of arguments
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 16 Oct 2009 14:45:18 +0100
Known bug: see
https://sourceforge.net/tracker/?func=detail&aid=2878207&group_id=29872&atid
=397617

Please note, if something stops working with a new release of a product,
then it's very likely to be a bug, and as such it should be reported first
on the forum for that product, not here on xsl-list. Both the Saxon and
oXygen lists are very responsive to problem reports.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 



> -----Original Message-----
> From: Alex Muir [mailto:alex.g.muir@xxxxxxxxx] 
> Sent: 16 October 2009 14:28
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Concat function returning nodeset when param 
> is part of arguments
> 
> Hi,
> 
> Running my code in version 11 of oxygen I'm getting the 
> following error on the matches function in the when test in 
> the code below
> 
> Severity: error
> Description: Attempting to access a sequence as a singleton item
> 
> 
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>     xmlns:xs="http://www.w3.org/2001/XMLSchema"; version="2.0"> ...
> <xsl:param name="regex_string_tags" as="xs:string" 
> select="'\[\[B\]\]'"/> ...
> <xsl:variable name="matchingString" as="xs:string"
> select="concat('^',$regex_string_tags,'(##[^#]+?##|\s)*?\[\[FONT')"/>
> ...
> <xsl:when test="matches(.,$matchingString,$regex_flags)">
> 
> 
> In the debugger it is stating that the variable matchingString is a
> nodeset(5) rather than the string I would have expected.
> 
> I noticed that if I remove the parameter from the concat 
> statement and replace it with 'some string' it then returns a 
> string as I expect also if I change the param into a variable 
> it returns a string.
> 
> <xsl:variable name="matchingString" as="xs:string"
> select="concat('^','some string','(##[^#]+?##|\s)*?\[\[FONT')"/>
> 
> So why is the parameter having this effect?
> 
> I suppose I could have made a change I didn't notice however 
> this was working in version 10.3 of oxygen.
> 
> Thanks
> 
> 
> 
> --
> 
> Alex
> https://sites.google.com/a/utg.edu.gm/alex

Current Thread