473,915 Members | 7,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="t rue" 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="t rue" 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 2820
Use

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

instead.

"Nicole Szymanski" <nm**@nmps.inva lid> 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="t rue" 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="t rue" 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*****@muenst er.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.inva lid> schrieb im Newsbeitrag
news:Xn******** *************** ******@213.228. 0.133...
Cf. news:be******** ****@ID-98527.news.uni-berlin.de, "Julian F. Reschke"
<re*****@muenst er.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
4182
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: <xsl:processing-instruction name="php"> echo $hello; </xsl:processing-instruction>
1
1575
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 want to apply a stylesheet such that the XML is exactly the same apart from the only <row> should be the first one from the XML below. I can output some text for position()=1 but I can't output the original XML too. So the only thing I get in my...
4
21217
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 native English speaker, it's quite hard to make the problem clear. Please see the following example.
6
1525
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") addnamevaluepair(xmltree, "color","blue")
2
1846
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"/> <interestingstuff number="1"/>
21
2556
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 language, etc. What I've got is: two websites, one in ASP.NET v2 and one in Python 2.5 (using 4suite for XML/XSLT) both on the same box (Windows Server 2003) both using the same XML, XSLT, CSS
0
1028
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 version="1.1.0.0"> <Model Name="x"> <OutputResolution ResX="600" ResY="600">
8
15912
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 case that i don't know how to solve, I need to concat a string from multiple childs into a standard way, the following is an example of the source and the target XML.
0
1644
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 does not display the Gridview but opens the created file in Excel.If I comment out the ExportDatasetToExcel routine the Gridview displays correctly. I'm assuming the problem is something to do with the Response methods.
12
2398
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 have a shell script that needs to get values from an XML file. What I want to do is transform the XML into something more KSH friendly so it can be easy to parsed in my KSH script. I would like to go through an entire XML document and for every...
0
10039
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9883
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
11069
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10543
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7259
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4779
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3370
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.