|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: MathML tags in an attribute of an HTML EMBED tag ?
Frédéric,
>and I want to output this :
>
><EMBED TYPE="text/mathml" MMLDATA="
><math>...some mathml ...</math>" HEIGHT="75" WIDTH="200" />
>to render MathML with the IBM techexplorer plug-in.
This is not well-formed XML as it stands. Do you know whether the the IBM
techexplorer plug-in will work if you have:
<EMBED TYPE="text/mathml" MMLDATA="
<math>...some mathml ...</math>" HEIGHT="75" WIDTH="200" />
instead, as this *is* well-formed XML and therefore easier to produce?
If so (and I hope so), then you can use a serialising template to take the
contents of the FORMULE element and turn it into a serialised XML version:
----
<xsl:template match="FORMULE">
<EMBED TYPE="text/mathml" HEIGHT="75" WIDTH="200">
<xsl:attribute name="MMLDATA">
<xsl:apply-templates mode="serialise" />
</xsl:attribute>
</EMBED>
</xsl:template>
<xsl:template match="*" mode="serialise">
<xsl:text /><<xsl:value-of select="name()" />
<xsl:for-each select="@*">
<xsl:text> </xsl:text>
<xsl:value-of select="name()" />
<xsl:text />="<xsl:value-of select="." />"<xsl:text />
</xsl:for-each>
<xsl:text>></xsl:text>
<xsl:apply-templates mode="serialise" />
<xsl:text /></<xsl:value-of select="name()" />><xsl:text />
</xsl:template>
<xsl:template match="text()[not(normalize-space())]" mode="serialise" />
----
If not, then you have two options. One is to produce the whole thing as
text; obviously that's undesirable because you can't take advantage of the
way you can build elements and attributes in XSLT. The other is to create
an output filter or emitter or whatever that can be plugged into Xalan and
used to serialise the DOM in whatever way you want. Again, that involves a
lot of work.
Sorry not to be more help,
Jeni
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








