View Single Post
  #6 (permalink)  
Old September 8th, 2011, 02:07 AM
ROCXY ROCXY is offline
Authorized User
Points: 345, Level: 6
Points: 345, Level: 6 Points: 345, Level: 6 Points: 345, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 71
Thanks: 10
Thanked 0 Times in 0 Posts
Default

Dear Kay

The following code is not working

Code:
<xsl:template match="@*[. = '=']">
  <xsl:copy>
    <xsl:attribute name="font">XYZ</xsl:attribute>
    <xsl:attribute name="font-size">12.6</xsl:attribute>
    <xsl:text>=</xsl:text>
  </xsl:copy>
</xsl:template>
Here is my complete XSLT.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
    xpath-default-namespace="http://www.w3.org/1998/Math/MathML"
    exclude-result-prefixes="xs xd"
    version="2.0">
   
    <xsl:template match="*">
        <xsl:copy>
            <xsl:copy-of select="@*"></xsl:copy-of>
            <xsl:apply-templates></xsl:apply-templates>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="mspace"/>
    <xsl:template match="annotation"/>
    
    <xsl:template match="@*[. = '&#x3d;']">
        <xsl:copy>
            <xsl:attribute name="font">XYZ</xsl:attribute>
            <xsl:attribute name="font-size">12.6</xsl:attribute>
            <xsl:text>&#x3d;</xsl:text>
        </xsl:copy>
    </xsl:template>

</xsl:stylesheet>
Here below is the input
Code:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://www.w3.org/Math/XSL/mathml.xsl"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"  "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><title>Basic XHTML+MathML Document</title></head>
<body>
<math xmlns="http://www.w3.org/1998/Math/MathML">
    <semantics>
      <mstyle >
        <mo>[</mo>
        <mo>&#x3d;</mo>
        <mo>]</mo>
      </mstyle>
    </semantics>
  </math>
</body>
</html>
Here below is the output
Code:
<?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:pref="http://www.w3.org/2002/Math/preference" xml:lang="en">
   <head profile="">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title>Basic XHTML+MathML Document</title>
   </head>
   
   <body>
      
      
      <math xmlns="http://www.w3.org/1998/Math/MathML" overflow="scroll">
         
         <semantics definitionURL="" encoding="">
            
            <mstyle>
               
               <mo>[</mo>
               
               <mo>=</mo>
               
               <mo>]</mo>
               
            </mstyle>
            
         </semantics>
         
      </math>
      
   </body>
   
</html>
XSLT Processor: Saxon-PE 9.2.1.2

Any help would be greatly appreciated.
__________________
Thanks,
Rocxy.
Reply With Quote