You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Gary Lawrence Murphy <ga...@canada.com> on 2003/01/06 22:41:46 UTC

Bug: XSL requires post-processing stage

If no one is in charge of this, stand by and I'll probably have time
to fix it over the next couple of days, but it's an easy fix and the
author can probably code it faster than I can find the spot.

It's a common problem: Only Microsoft XSL provides filter tags to
un-escape markup embedded in the description tags (markup can also
be embedded in other tags, even link GET request.

The short story is that a listing ends up being rendered with
entities expanded by the browser:

  Western Oil Sands Inc . - Fire extinguished at the Muskeg River ...
  Canada NewsWire (press release),&nbsp;CA<br> <b>...</b> The mine's
  <b>emergency</b> <b>response</b> <b>...</b> It is part of the
  Athabasca Oil Sands Project (AOSP),<br> a joint venture of Shell
  <b>Canada</b> Limited (60 per cent), Chevron <b>...</b>

Instead of <b> causing bold-face, it gets printed verbatim.

The fix is something I had to do on my website as well: After the XSL
transform, you need to comb through and replace the common entities
with string equivalents.  

In perl (ack! blasphemy! ok, in OROInc's donated Perl5Match ;) 
you need to apply the following filters just after the XSL transform:

    $quot = "'";
    while (<>) {
        $line = $_;
        $line =~ s/&amp;/&/g;
        $line =~ s/&lt;/</g;
        $line =~ s/&gt;/>/g;
        $line =~ s/&quot;/$quot/g;
        $line =~ s/&nbsp;/ /g;

        print $line;
    }

So the question then becomes whether you want to implicate Perl5 jars
into Jetspeed, or if you want to do it brute-force -- Although it's a
lot of jars for just one use, there's probably other uses for the
Perl5Util classes in portlet applications.  I'm a big fan of the old
ORO packages, so if they get folded into the Jetspeed kit, you'll get
no complaints from me :)

-- 
Gary Lawrence Murphy - garym@teledyn.com - TeleDynamics Communications
   - blog: http://www.teledyn.com/mt/ - biz: http://teledyn.com/ -
  "Computers are useless. They can only give you answers." (Picasso)

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Bug: XSL requires post-processing stage

Posted by David Sean Taylor <da...@bluesunrise.com>.
On Monday, January 6, 2003, at 01:41  PM, Gary Lawrence Murphy wrote:

> If no one is in charge of this, stand by and I'll probably have time
> to fix it over the next couple of days, but it's an easy fix and the
> author can probably code it faster than I can find the spot.
>
> It's a common problem: Only Microsoft XSL provides filter tags to
> un-escape markup embedded in the description tags (markup can also
> be embedded in other tags, even link GET request.
>
> The short story is that a listing ends up being rendered with
> entities expanded by the browser:
>
>   Western Oil Sands Inc . - Fire extinguished at the Muskeg River ...
>   Canada NewsWire (press release),&nbsp;CA<br> <b>...</b> The mine's
>   <b>emergency</b> <b>response</b> <b>...</b> It is part of the
>   Athabasca Oil Sands Project (AOSP),<br> a joint venture of Shell
>   <b>Canada</b> Limited (60 per cent), Chevron <b>...</b>
>
> Instead of <b> causing bold-face, it gets printed verbatim.
>
> The fix is something I had to do on my website as well: After the XSL
> transform, you need to comb through and replace the common entities
> with string equivalents.
>
> In perl (ack! blasphemy! ok, in OROInc's donated Perl5Match ;)
> you need to apply the following filters just after the XSL transform:
>
>     $quot = "'";
>     while (<>) {
>         $line = $_;
>         $line =~ s/&amp;/&/g;
>         $line =~ s/&lt;/</g;
>         $line =~ s/&gt;/>/g;
>         $line =~ s/&quot;/$quot/g;
>         $line =~ s/&nbsp;/ /g;
>
>         print $line;
>     }
>
> So the question then becomes whether you want to implicate Perl5 jars
> into Jetspeed, or if you want to do it brute-force -- Although it's a
> lot of jars for just one use, there's probably other uses for the
> Perl5Util classes in portlet applications.  I'm a big fan of the old
> ORO packages, so if they get folded into the Jetspeed kit, you'll get
> no complaints from me :)
>
Nothing wrong with Perl IMO.
Anyway,  jakarta-regexp-1.2.jar has been in the distribution for a 
while now. See the lib directory.

I haven't come across the problem you described above.
It sounds like a lot of extra processing that will not be necessary in 
most cases.
If you are going to submit a patch to the Jetspeed transform class, 
please make this feature optional and configurable.

--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
+01 707 773-4646




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>