472,353 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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 2749
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Hayko Riemenschneider | last post by:
Hi! I've got me an XSL tranformation stylesheet for my XML file. In the XSL file I now wish to use PHP to do some scripting. So I thought I'll...
1
by: Paul Smith | last post by:
Apologies, I am new to XSLT. I am having trouble with something that I would expect to be quite straightforward. How do I leave XML tags as they...
4
by: Son KwonNam | last post by:
In XSLT, is this possible to get value from xml using XPath which is in XSLT variable? I mean XPath strings can be dynamic while XSL...
6
by: Prashanth Ellina | last post by:
Hi, I am an XSLT newbie. I need to solve something which I will express in pseudo-code. function f1() { xmltree = <emptydom>...
2
by: Jon Martin Solaas | last post by:
Hi, I have a general document somewhat like this: -------------------------------------- <root> <level1> <level2> <interestingstuff...
21
by: Damian | last post by:
Hi, I'm from an ASP.NET background an am considering making the switch to Python. I decided to develop my next project in tandem to test the waters...
0
by: poli | last post by:
Hi, It is my first xslt document that I have to write. And I have to do it quick (1 day). PLease help me. I have this input xml file: <?xml...
8
by: Hercules Dev. | last post by:
Hi all, I'm new in xslt and xpath, so my question might be simple but i'm learning. I have an XML document and need to transform it into...
0
by: ronc85 | last post by:
My environment is ASP.NET 2.0, C# and AJAX. I'm having a problem with 'Button Click' logic which is trying to display a Gridview and then use...
12
by: Stu | last post by:
Being a newbie with XSLT transformation code please excuse my neivte. In addition, I am not sure what I want to do can be done with xslt so I...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.