Re: Char node-type

Subject: Re: Char node-type
From: Richard Light <richard@xxxxxxxxxxxxxxxxx>
Date: Mon, 27 Nov 2000 10:04:53 +0000
In message <20001125080957.6643.qmail@xxxxxxxxxxxxxxxxxxxxxx>, Dimitre
Novatchev <dnovatchev@xxxxxxxxx> writes
>Until now I thought that the string-length(), substring() and other
>string functions by design must deal correctly with combining "
>character(s)' sequences into an image representing the single combined
>character.  "
>If this was not so, they would be very difficult to use.
>Could somebody confirm or deny this?

Converting the characters in your source XML into 'images' that can be
rendered in an HTML browser is a challenge in its own right.  We have
identified three types of challenge:

- well-defined Unicode characters which a 'typical' [add your own
definition here] client browser cannot be relied upon to render;
- ditto, for all but the simplest base- plus combining-character
- custom characters declared within the Unicode Private Use area

In every case, we would like to be able to call upon a font resource to
represent the glyph in question, but can't.  Accordingly, we have to use
image references instead.  To do the job properly, we need variant image
filenames appropriate to the context - bold, italic, superscript, title
font, ...  With XSLT, we can easily check a character's ancestry and add
components to the filename in a consistent manner:

    <xsl:attribute name="src">
      <xsl:value-of select="$image-prefix"/>
      <xsl:if test="ancestor-or-self::titlegrp/title">H2_</xsl:if>
      <xsl:if test="ancestor-or-self::section/title|subsect1/title">H3_<
      <xsl:if test="ancestor-or-self::bo|bi|abstract">B_</xsl:if>
      <xsl:if test="ancestor-or-self::it|bi">I_</xsl:if>

The other technique we find helpful is to keep information about
character classes in an external XML document, e.g.:

  <charclass type="ASCII character"> 
                <value>A</value> <filename>0041</filename> 
  <charclass type="ligature"> 
  <charclass type="combining character"> 

This separates the information about character mappings from the actual
XSLT script.


Richard Light
SGML/XML and Museum Information Consultancy

 XSL-List info and archive:

Current Thread