This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Char node-type


In message <20001125080957.6643.qmail@web6305.mail.yahoo.com>, Dimitre
Novatchev <dnovatchev@yahoo.com> writes
>Until now I thought that the string-length(), substring() and other
>string functions by design must deal correctly with combining "
>'character-plus-Unicode-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
combinations;
- 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>
      <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.:

<charset> 
  <charclass type="ASCII character"> 
         <char> 
                <value>A</value> <filename>0041</filename> 
         </char>
        ...
  </charclass> 
  <charclass type="ligature"> 
         <char> 
                <value>&#198;</value> 
                <mapping>AE</mapping> 
         </char> 
        ...
  </charclass> 
  <charclass type="combining character"> 
         <char> 
                <value>&#771;</value> 
                <mapping>[tilde]</mapping><filename>0303</filename><comb
ines-with>
Z</combines-with>
                
         </char> 
        ...

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

Richard.

Richard Light
SGML/XML and Museum Information Consultancy
richard@light.demon.co.uk


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]