Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] weird problem of non shown text with xsl:value-of

From: "Dan Powderhill" <dan.powderhill@--------------->
To:
Date: 10/3/2005 3:34:00 PM
Within your for-each loop you're requesting the value of
"oefeningen/zinnen/zin", which is relative to the node you're currently
in in the for-each loop, so the full request will be
"oefeningen/zinnen/zin/oefeningen/zinnen/zin". If you change
"oefeningen/zinnen/zin" to "." in your value-of tag it should work.

<ol>
<xsl:for-each select="oefeningen/zinnen/zin">
	<li><xsl:value-of select="." /></li>
</xsl:for-each>
</ol>

Dan



-----Original Message-----
From: Roel Dillen [mailto:dillenroel@xxxxxxxxxx]
Sent: 03 October 2005 16:19
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] weird problem of non shown text with xsl:value-of

 <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>Oefeningen</title>
</head>
<body>
<h2>Oefeningen</h2>
<h3>Opgave</h3>
<xsl:value-of select="oefeningen/opgave" /> <ol> <xsl:for-each
select="oefeningen/zinnen/zin">
	<li><xsl:value-of select="oefeningen/zinnen/zin" /></li>
</xsl:for-each> </ol> </body> </html> </xsl:template> </xsl:stylesheet>


This is my xsl

With this xml


<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE oefening [
<!ELEMENT oefeningen (opgave,zinnen)> <!ELEMENT opgave (#PCDATA)>
<!ELEMENT zinnen (zin*)> <!ELEMENT zin (#PCDATA)>]
>
<?xml-stylesheet type="text/xsl" href="oefeningentemplate.xsl"?>

<!--
<oefeningen>
	<opgave></opgave>
	<zin></zin>
</oefeningen>
-->
<oefeningen>
	<opgave>opgave</opgave>
	<zinnen>
	<zin>
	test
	</zin>
	<zin>
	test2
	</zin>
	</zinnen>
</oefeningen>

Giving me


Oefeningen

Opgave

Opgave

1.
2.


Instead of the desired

Oefeningen

Opgave

Opgave

1.test
2.test2

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.9/116 - Release Date:
30-9-2005


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent