473,395 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 2798
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 use the PIs like this: ...
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 are in a transformation? From the XML below, I...
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 Transforming. If possible, How?? Because I'm not a...
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> addnamevaluepair(xmltree, "size","100")...
2
by: Jon Martin Solaas | last post by:
Hi, I have a general document somewhat like this: -------------------------------------- <root> <level1> <level2> <interestingstuff number="2"/> <interestingstuff number="3"/>...
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 and everything is working well, loving the...
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 version="1.0" encoding="UTF-8"?> <Node...
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 another XML, I use xslt and it works, but there is a...
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 XML/XSLT to build an Excel file. The following code...
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 apologize up front for asking anything stupid I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.