Subject: Concat function returning nodeset when param is part of arguments
From: Alex Muir <alex.g.muir@xxxxxxxxx>
Date: Fri, 16 Oct 2009 13:28:20 +0000
|
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
|