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

Re: recognize character entities

Subject: Re: recognize character entities
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 30 Aug 2006 09:31:45 +0100
xsl character entities
> we have a problem within mathml
impossible!

> This is my concrete problem: we have  
> to change by xslt all m:mo elements that consist of one special  
> character (entity reference) to symbol font for output. the input is  
> coming from design science mathflow on arbortext editor:
> 
>    <m:mo>&divide;</m:mo>

Hey they're my entities you know:-)

So here you definitely do not want to test for an entity reference as
you want &divide; &#247; &#xf7; and the w character all to work the
same way.

The parser makes them all into a single character before XSLT starts and
you can match on that character

<xsl:template match="m:mo[.='&#247;']">... stuff....</xsl:template>

So you just need a load of these (it's often useful to generate all the
needed templates by using a different xsl stylesheet)

If you are using xslt2 then an alternative approach is to use character
maps:
  <xsl:character-map name="toc">
    <xsl:output-character character="&#177;" string="+/-"/>
    <xsl:output-character character="&#8211;" string="-"/>
    <xsl:output-character character="&#8467;" string="l"/>
    <xsl:output-character character="&#967;" string="chi"/>
....

David

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.