469,097 Members | 1,540 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,097 developers. It's quick & easy.

XSLT value-of

Hello,

I am developing a XML application that uses XSLT in order to transform
math lessons written in XML to XHTML. I write TEX equation between math
tags, for instance :

<math>a^2+b^2=c^2</math>

This code is transformed to MathML with OpenMathTag. The previous example
would give :

<math><msup><mi>a</mi><mn>2</mn>.... </math>

And eventually the XSL template is applied to the XML document. I use the
following XSL statement :

<xsl:template match="math">
<math displaystyle="true" xmlns="http://www.w3.org/1998/Math/MathML">
<xsl:value-of select="." />
</math>
</xsl:template>

Unfortunately this strips out all MathML tags. This is the output of the
previous example :

<math displaystyle="true" xmlns="http://www.w3.org/1998/Math/MathML">
a2+b2=c2
</math>

Do you know how I can have the XSL template just "copy" the code between
<math> and </math> tags without looking at it ?

I thought that the main difference between value-of and apply-templates
was that the former didn't recursively interpret node data unfortunately
this example seems to have proven me wrong.
Thanks in advance for help,
--
Nicole
Jul 20 '05 #1
3 2666
Use

xsl:copy-of select="node()"

instead.

"Nicole Szymanski" <nm**@nmps.invalid> schrieb im Newsbeitrag
news:Xn*****************************@213.228.0.75. ..
Hello,

I am developing a XML application that uses XSLT in order to transform
math lessons written in XML to XHTML. I write TEX equation between math
tags, for instance :

<math>a^2+b^2=c^2</math>

This code is transformed to MathML with OpenMathTag. The previous example
would give :

<math><msup><mi>a</mi><mn>2</mn>.... </math>

And eventually the XSL template is applied to the XML document. I use the
following XSL statement :

<xsl:template match="math">
<math displaystyle="true" xmlns="http://www.w3.org/1998/Math/MathML">
<xsl:value-of select="." />
</math>
</xsl:template>

Unfortunately this strips out all MathML tags. This is the output of the
previous example :

<math displaystyle="true" xmlns="http://www.w3.org/1998/Math/MathML">
a2+b2=c2
</math>

Do you know how I can have the XSL template just "copy" the code between
<math> and </math> tags without looking at it ?

I thought that the main difference between value-of and apply-templates
was that the former didn't recursively interpret node data unfortunately
this example seems to have proven me wrong.
Thanks in advance for help,
--
Nicole

Jul 20 '05 #2
Cf. news:be************@ID-98527.news.uni-berlin.de, "Julian F. Reschke"
<re*****@muenster.de> :
Use

xsl:copy-of select="node()"

instead.


Ok thanks alot.

Still, what is the difference between value-of and apply-templates ?

--
Nicole
Jul 20 '05 #3

"Nicole Szymanski" <nm**@nmps.invalid> schrieb im Newsbeitrag
news:Xn*****************************@213.228.0.133 ...
Cf. news:be************@ID-98527.news.uni-berlin.de, "Julian F. Reschke"
<re*****@muenster.de> :
Use

xsl:copy-of select="node()"

instead.


Ok thanks alot.

Still, what is the difference between value-of and apply-templates ?


value-of takes the string value, apply-templates let's template processing
happen. In the latter case it depends on the template you have defined for
the child elements.
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Hayko Riemenschneider | last post: by
1 post views Thread by Paul Smith | last post: by
4 posts views Thread by Son KwonNam | last post: by
6 posts views Thread by Prashanth Ellina | last post: by
2 posts views Thread by Jon Martin Solaas | last post: by
21 posts views Thread by Damian | last post: by
reply views Thread by poli | last post: by
8 posts views Thread by Hercules Dev. | last post: by
12 posts views Thread by Stu | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.