portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Lawrence Murphy <ga...@canada.com>
Subject Bug: XSL requires post-processing stage
Date Mon, 06 Jan 2003 21:41:46 GMT
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:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>

View raw message