[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Matching " within a variable as:item()*


Subject: Re: [xsl] Matching " within a variable as:item()*
From: Alex Muir <alex.g.muir@xxxxxxxxx>
Date: Tue, 5 Jan 2010 13:30:17 +0000

Hi I just figured out the problem although I don't really understand
the reason for it.

In my example I changed it a bit too much from the real code to see
the problem.

Within the VariableAsItem I was creating the "ZXZX" as follows due to
a lazy cut and paste from previous code that was selecting the value
of a variable rather than just text.

              <xsl:text>"</xsl:text>
            <xsl:value-of select="'ZXZX'"/>
            <xsl:text>"</xsl:text>

If I write the code such as
          <xsl:text>"ZXZX"</xsl:text>

Than the match will now work properly. Maybe I'm doing something else
wrong not sure however the output looks the same as text so I'm not
clear what that would be.

Alex




On Tue, Jan 5, 2010 at 1:19 PM, Alex Muir <alex.g.muir@xxxxxxxxx> wrote:
> Hi,
>
> I added the $regex variable rather than paste a specific regex. But
> the VariableAsItem is working fine to get the text I require.
>
> It's the analyze-string method within VariableAsElement which is not
> matching on the double quotes within the VariableAsItem text. if I
> remove the double quotes in the match it works fine.
>
>
> On Tue, Jan 5, 2010 at 1:08 PM, Martin Honnen <Martin.Honnen@xxxxxx> wrote:
>> Alex Muir wrote:
>>
>>> I'm for some reason not able to match a string containing a " within
>>> VariableAsItem within an analyze string method in VariableAsElement.
>>>
>>>
>>>     <xsl:variable name="VariableAsItem" as="item()*">
>>>        <xsl:analyze-string select="." regex="$regex" >
>>
>> I think you want/need
>>
>>          <xsl:analyze-string select="." regex="{$regex}" >
>>
>>
>>
>> --
>>
>>        Martin Honnen
>>        http://msmvps.com/blogs/martin_honnen/
>>
>>
>
>
>
> --
>
> Alex
> https://sites.google.com/a/utg.edu.gm/alex
>



--

Alex
https://sites.google.com/a/utg.edu.gm/alex


Current Thread