[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subject: RE: weird problem of non shown text with xsl:value-of
From: "Dan Powderhill" <dan.powderhill@xxxxxxxxxxxxxxx>
Date: Mon, 3 Oct 2005 16:24:38 +0100
hov text
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:  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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.