Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XSLT value-of

Reply
Thread Tools

XSLT value-of

 
 
Nicole Szymanski
Guest
Posts: n/a
 
      07-10-2003
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
 
Reply With Quote
 
 
 
 
Julian F. Reschke
Guest
Posts: n/a
 
      07-10-2003
Use

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

instead.

"Nicole Szymanski" <> schrieb im Newsbeitrag
news:Xns93B4C97CE7244nmpsnmpsinvalid@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



 
Reply With Quote
 
 
 
 
Nicole Szymanski
Guest
Posts: n/a
 
      07-10-2003
Cf. news:bekbbo$629q0$, "Julian F. Reschke"
<> :

> Use
>
> xsl:copy-of select="node()"
>
> instead.


Ok thanks alot.

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

--
Nicole
 
Reply With Quote
 
Julian F. Reschke
Guest
Posts: n/a
 
      07-10-2003

"Nicole Szymanski" <> schrieb im Newsbeitrag
news:Xns93B4D771D2A1Bnmpsnmpsinvalid@213.228.0.133 ...
> Cf. news:bekbbo$629q0$, "Julian F. Reschke"
> <> :
>
> > 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Including XSLT/XML document within a XSLT document dar_imiro@hotmail.com XML 4 12-13-2005 02:26 AM
Multiple XSLT Transforms using a Controller XSLT sneill@mxlogic.com XML 2 10-19-2005 11:00 AM
ANN: New low-cost XML Editor, XSLT Editor, XSLT Debugger, DTD/Schema Editor Stylus Studio Java 0 08-03-2004 03:53 PM
xslt alone or xslt/java for static site? ted XML 1 01-26-2004 10:41 AM
[XSLT]Passing values from Javascript to a XSLT variable Benjamin Hillsley XML 3 09-25-2003 04:50 AM



Advertisments