Skip Menu |

This queue is for tickets about the XML-XSLT CPAN distribution.

Report information
The Basics
Id: 44741
Status: resolved
Priority: 0/
Queue: XML-XSLT

People
Owner: jns [...] gellyfish.co.uk
Requestors: alessio.signorini [...] spryte.it
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Error in regexp of _attribute_value_of() + solution
Due to a mistake in the regexps in the function _attribute_value_of() at lines 2961, 2972, 2976, if one specifies more than one character in an attribute before an XSLT embedded tag (i.e. {@something}) it does not get replaced. For example, this will get correctly parsed (and {@name} replaced) <img src='a{@name}' /> while the following will not <img src='ab{@name}' /> due to the regexp /\G[^\\]?\{(.*?[^\\]?)\}/ and similar ones at the lines declared above. To correct this problem it is necessary to change [^\\]? into [^\\]* Have fun, Alessio
On Wed Apr 01 20:19:14 2009, bluesky wrote: Show quoted text
> Due to a mistake in the regexps in the function > > _attribute_value_of() > > at lines 2961, 2972, 2976, if one specifies more than one character in > an attribute before an XSLT embedded tag (i.e. {@something}) it does not > get replaced. > > For example, this will get correctly parsed (and {@name} replaced) > > <img src='a{@name}' /> > > while the following will not > > <img src='ab{@name}' /> > > due to the regexp > > /\G[^\\]?\{(.*?[^\\]?)\}/ > > and similar ones at the lines declared above. To correct this problem it > is necessary to change > > [^\\]? > > into > > [^\\]* > > Have fun, > > Alessio
Hi, I've applied this as https://github.com/jonathanstowe/XML-XSLT/commit/5d66ea8b7865d664f129c63f984626cdc41bf281 it still passes the existing tests so it will be in the next release.