Thanks to all who responded.
I appreciate that and will give it a try over the weekend (when I next have
time spare :-)
Needless to say, I hadn't thought of accumulating the output in a variable
- fantastic !
More comments inline.
In the case of a WML deck, I think that you'll want to count the markup
too and to do so, you'd need to simulate a formating, for instance (not
dealing with attributes and namespaces):
Yes, I will be able to provide an estimate for these based on the bytecode
substitiutions for the limited tag set I will be using (I can give a
generic value for each card and an overhead value which is deducted from my
limit)
I don't think you can get a very accurate estimation except if you can
know exactly how the output method will behave.
Possibly I will only need to count text and attribute text, but the code
above will work to give a 'close-enough' estimate. Afaik, WML uses UTF-8
so, single bytes per character.
I had the same problem for http://wap.xmlfr.org and have solved this by
writing an extension function (for XT) which estimates the output. I
realize now that I could have used an adaptation of your stylesheet to
get a close result!
Also - About transcoding - there was an interesting article here
http://www.research.ibm.com/journal/sj/401/britton.html for the IBM
websphere appliance about chopping up XML to WML content tailored per device.
Thanks again for all thie ideas.
Cheers - Neil Smith.
========================================================
CaptionKit http://www.captionkit.com : Production tools
for accessible subtitled internet media, transcripts
and searchable video. Supports Real Player, Quicktime
and Windows Media Player.
VideoChat with friends online, get Freshly Toasted every
day at http://www.fresh-toast.net : NetMeeting solutions
for a connected world.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list