[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Char node-type

Subject: Re: Char node-type
From: "Dave Hartnoll" <Dave_Hartnoll@xxxxxxx>
Date: Thu, 23 Nov 2000 15:56:07 -0000
david hartnoll
I have an idea that will alleviate your depth of recursion problem, but as
I'm a relative newcomer to XSL, so I'm not fluent enough to express this
idea in XSL itself yet.

The idea is that your character processing template should first check the
length of it's string. When it's exactly 1 then process the character as you
do now. Otherwise, call yourself recursively, once for the 1st half of the
string, then again for the 2nd half.

Dave.

----- Original Message -----
From: "Richard Light" <richard@xxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxx>
Sent: Thursday, November 23, 2000 8:05 AM
Subject: Char node-type


>
> When transforming e.g. scientific articles to HTML, we often encounter
> characters which browsers cannot represent directly.  These have to be
> 'translated' to <img> elements which call in a suitable GIF.  Precisely
> which GIF to use (bold, superscript, etc.) depends on the ancestry of
> the string containing the element.  Similar techniques are required to
> resolve and render Unicode combining characters.
>
> Since the translate function only deals with one-to-one character
> mappings, we have written a template to process text() nodes which
> processed the first character, then calls itself recursively to process
> the rest of the string.  This works fine so long as you don't have more
> than about 600 characters in a single element - with a long enough
> string you get stack overflows.
>
> It wouldn't be necessary to use this unpleasant and inefficient
> technique if XPath defined in its data model, and XSLT supported, a char
> node-type.  (Isolating a single character would also allow us to access
> its character value via the number function, which would be handy for
> processing classes of Unicode characters.)
>
> I know that asking XSLT processors to process single characters is less
> efficient than working on strings, but given the need to process single
> characters, surely it makes sense to give the XSLT processor the job and
> do it in a way that won't blow the stack?
>
> ... or is there a clever way of doing this sort of thing in XSLT that I
> haven't thought of?  (There usually is!)
>
> Richard Light
> SGML/XML and Museum Information Consultancy
> richard@xxxxxxxxxxxxxxxxx
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.