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: George Cristian Bina <george@xxxxxxxxxxxxx>
Date: Sat, 17 Oct 2009 00:22:16 +0300

This Saxon fix was integrated in the latest oXygen 11 build, 2009101512.
So just get the 2009101512 build from our download page and you will have this issue fixed:

Best Regards,
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Michael Kay wrote:
Known bug: see

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.


Michael Kay

-----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


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="";
xmlns:xs=""; version="2.0"> ...
<xsl:param name="regex_string_tags" as="xs:string" select="'\[\[B\]\]'"/> ...
<xsl:variable name="matchingString" as="xs:string"
<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.




Current Thread