This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XHTML to WML problem
- To: xsl-list at mulberrytech dot com
- Subject: Re: XHTML to WML problem
- From: Tom Myers <tom dot myers at postoffice dot worldnet dot att dot net>
- Date: Tue, 30 May 2000 16:45:42 -0400
- Reply-To: xsl-list at mulberrytech dot com
>Date: Tue, 30 May 2000 11:08:36 +0100
>From: Mark Lynch <Mark.Lynch@MobileAware.com>
>Subject: XHTML to WML problem
>
>Hi all,
>I want to convert an XHTML document to WML and deliver it to a WAP device.
>However there is a limitation on the amount of information that can be sent
>down to the WAP device - on Nokia 7110 I thinks its about 1.4Kb. I use XSLT
>to convert to WML. I then need to break down this file into 1.4Kb chunks.
>Has anybody out there done anything like this?
A related problem which _may_ be helpful...in Ch 19 of "Professional JSP"
(Wrox, just out at http://www.amazon.com/exec/obidos/ASIN/1861003625)
you'll see one way of emergency-pruning of XSL output for WML limits.
(The chapter is "Case Study: Weather with JSP, XSLT, and WAP", fwiw.)
For instance, on page 682 there's
<xsl:value-of select="pruner:prune($theSessionID,string($Zip),$Plim)"/>
which turns out to mean "try to produce the zip code as pulled from
the last database query of this httpSession, but don't go past a
total of $Plim output characters since the last reset (which happens
once per request). Notice that here we're pruning content, not tags,
all tags are always produced; the actual output content will depend
on the order of XSL evaluation, but correctness will not. (public
class XSLPrune is on pp674-675; it's not complicated.)
If you have trouble with it, tell me :-) 'cos my co-author, Sasha
Nakhimovsky, isn't on this list. (Nor is he on the amazon list of
authors; they always mess up somewhere.) BTW, I've since learned how
to do the XSL much better, but not in any way that affects the
pruning issue.
It does work, but I would love to see a simpler approach, and I don't
know how it would apply to your problem; not directly, of course. I
suspect that the best approach to your problem is going to depend on
the specifics of the problem; feel free to post more details. :-)
Tom Myers
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list