cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cassandra Bonner <cbonner...@yahoo.com>
Subject Fwd: WML "encoding" $,<,>,',", etc...
Date Fri, 20 Apr 2001 13:33:19 GMT
Hello,

Answer to my own question.  After pulling my head out of my %^#, I
realized this could be much easier handled by converting the text
within my xsl template for my WML.

Found this link on dpawson.co.uk (a great xslt & xpath reference btw)
and thought i'd pass on the solution.

http://www.dpawson.co.uk/xsl/N8343.html#d44e36871

thanks,
cass


--- Cassandra Bonner <cbonner_98@yahoo.com> wrote:
> Date: Wed, 18 Apr 2001 18:50:00 -0700 (PDT)
> From: Cassandra Bonner <cbonner_98@yahoo.com>
> Subject: WML "encoding" $,<,>,',", etc...
> To: cocoon-users@xml.apache.org
> CC: cbonner_98@yahoo.com
> 
> Hi,
> 
> Did a quick search through the archives and didn't see this one
> covered.
> 
> I'm currently demo-ing a site using cocoon, that will be returning
> ouput to multiple devices (e.g. any WAP-enabled device, ipac IE
> browser, ipac EZWap browser, netscape, ie, etc).
> 
> Cocoon's pretty cool and working great for this, but I was
> wondering
> if there's anything that's been done for WML-specific "encoding" to
> translate $'s to $$'s and &'s to &amp;, etc.  These translations
> only
> needs to occur for WML - which is particularly relevant for the
> dollar sign - as it will display two (2) $$'s for all non-WML.  For
> example, our current perl code to do this specifically for our WML
> is
> as follows:
> 
> NOTE:: Some of these will be translated via the email if viewing as
> html - as many people do - so just know that these originally (when
> i
> sent this message) said some like & to & + amp + ;, etc....
> 
>   if (defined ($str)) {
>     $str =~ s/\&/\&amp;/g;
>     $str =~ s/\</\&lt;/g;
>     $str =~ s/\>/\&gt;/g;
>     $str =~ s/\'/\&apos;/g;
>     $str =~ s/\"/\&quot;/g;
>     $str =~ s/\$/\$\$/g;
> 
>     # return the encoded string
>     return $str;
>   }
> 
> I'm currently hacking it for a demo (hard-coding on the user-agent
> header), but I'd like to be able to leverage cocoon's functionality
> with respect handling output based on the user agent. 
> 
> If there isn't an existing solution, I'm planning to write a
> content
> manager which leverages the Browser and Manager classes within the
> cocoon src to determine if the user agent coming in is one of the
> cocoon.properties browser configs that will be returning WML - and
> only encode for those.  I'd really rather not have to do this
> though
> as it somewhat nullifies the whole cocoon functionality.
> 
> Any advice on how this can be handled other than checking UserAgent
> "cagetory" and only encoding for those returning WML will be
> greatly
> appreciated.
> 
> thanks in advance,
> cass
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
> 
	

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message