xsl-list
[Top] [All Lists]

Re: url query works with mozilla; not IE

2003-07-04 04:07:29
Hi Bill,

I am trying all sorts of variations. Here is one that will not, but
not sure why? Am I making an obvious mistake/assumption?

<img text="foo" alt="foo" 
src="translate('display.php?theimage={$myvar}','&#32;&#13;&#9;&#10;','')"></img>

I don't know what $myvar is but the result of this is going to produce
something that looks like:

  <img text="foo" alt="foo"
    src="translate('display.php?theimage=myvarvalue','&#32;&#13;&#9;&#10;','')" 
/>

I think it's unlikely to give you what you want, since the URL in the
src attribute isn't a valid URL. Probably you want the {}s around the
call to the translate() function, which means that you have to
concatenate the literal string 'display.php?theimage=' with the value
of $myvar:

  <img text="foo" alt="foo"
    src="{translate(concat('display.php?theimage=', 
$myvar),'&#32;&#13;&#9;&#10;','')}"></img>

Or, since you know that the string 'display.php?theimage=' doesn't
contain any of the characters that you want to delete from the string,
you may as well do what Jim suggested:

  <img text="foo" alt="foo"
    
src="display.php?theimage={translate($myvar,'&#32;&#13;&#9;&#10;','')}"></img>

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list