p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

xslt thread: flag


Message #1 by hemamber reddy <hemamber_reddy@y...> on Mon, 30 Sep 2002 00:06:33 -0700 (PDT)
Just write an override template for the exception case:

<xsl:template match="mml:mo[.='&InvisibleTimes;']">
<prompt>times</prompt>
</xsl:template>

This assumes that the entity &InvisibleTimes is defined in your
stylesheet DOCTYPE declaration; if not, you will have to find out what
the contents of the entity are and substitute that in the above rule.

Michael Kay
Software AG
home: Michael.H.Kay@n...
work: Michael.Kay@s... 

> -----Original Message-----
> From: hemamber reddy [mailto:hemamber_reddy@y...] 
> Sent: 30 September 2002 08:07
> To: P2P_XSLT
> Subject: [xslt] flag
> 
> 
> 
> hi all, 
> 
>    I was using saxon to execute mathml and stylesheet to 
> produce voicexml output.
> 
>    for simple mathml which is written for the formula a+bc=d;
> 
>   my mathml document is as follows:
> 
>   <math>
> <mrow>
>  <mi>a</mi>
>  <mo>+</mo>
>  <mi>b</mi>
>  <mo>&InvisibleTimes;</mo>
>  <mi>c</mi>
>  <mo>=</mo>
>  <mi>d</mi>
> </mrow>
> </math>
> 
> I am getting the exact output except at <mo>&InvisibleTimes;</mo>.
> 
> my simple stylesheet is as follows.
> 
>  <xsl:stylesheet version ="1.0" xmlns:xsl = 
> "http://www.w3.org/1999/XSL/Transform" xmlns:mml 
> ="http://www.w3.org/1998/Math/MathML">
> <xsl:output method = "xml" omit-xml-declaration="yes" />
> 
> <!-- root template -->
> 
> <xsl:template match ="mml:math">
> <vxml version="2.0">
> <form id="init">
> <block>
> <xsl:apply-templates/>
> </block>
> </form>
> </vxml>
> </xsl:template>
> 
> <xsl:template match = "mml:mi">
> <prompt>The variable <xsl:value-of select ="."/></prompt> 
> </xsl:template>
> 
> <xsl:template match = "mml:mo">
> <prompt><xsl:value-of select = "."/></prompt>
> </xsl:template>
> 
> </xsl:stylesheet>
> 
>   I need to use a flag. so that .. In the template for 
> "mml:mo" if the value is something like &InvisibleTimes.. I 
> should just output as "times". otherwise it should output the 
> operator within <mo>.
> 
> kindly help is needed as soon as possible.
> 
> regards
> 
> Hemamber
> 
>  
> 
>  
> 
> 
> 
> ---------------------------------
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!
> 
> ---
> In developing the .NET Framework Microsoft has 
> taken XML to heart, and with ASP.NET representing 
> the cutting edge of Windows based web development, 
> Professional ASP.NET XML with C# has been published 
> to help web developers to appreciate how these 
> technologies can work together to provide 
> functional, powerful applications. 
> http://www.wrox.com/acon11.asp?ISBN=1861007345
> 


  Return to Index