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

[Q] for-each formatting problem

Subject: [Q] for-each formatting problem
From: hgadm@xxxxxxxxxxxxx
Date: Tue, 07 Oct 2003 04:55:06 -0700 (PDT)
rdf xsl for each
Dear all,

this is probably a bloody newbie question but I really
struggle to get this to work:

This is a snippet out of an RDF-XML file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type='text/xsl'
href='kno{rdf}2html.xsl' version='1.0'?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
....>
....
<azkno:annotation>
	<rdf:Description>
		<dc:contributor>author_1</dc:contributor>
		<dc:date>
			<rdf:Description>
				<rdfs:isDefinedBy
rdf:resource="http://purl.org/dc/terms/W3CDTF"/>
				<rdf:value>2003-09-20</rdf:value>
			</rdf:Description>
		</dc:date>
		<rdf:value>I did implement this and it worked
fine</rdf:value>
	</rdf:Description>
</azkno:annotation>
<azkno:annotation>
	<rdf:Description>
		<dc:contributor>author_2</dc:contributor>
		<dc:date>
			<rdf:Description>
				<rdfs:isDefinedBy
rdf:resource="http://purl.org/dc/terms/W3CDTF"/>
				<rdf:value>2003-09-22</rdf:value>
			</rdf:Description>
		</dc:date>
		<rdf:value>There is a more recent discussion on that,
see TMS</rdf:value>
	</rdf:Description>
</azkno:annotation>
</rdf:Description>

</rdf:RDF>

This is the respective xsl snippet that does not
provide formatting:
...
<xsl:for-each select="//azkno:annotation">
<I><font color="#CC00CC">Annotation</font></I>
<font color="#000000">
<xsl:apply-templates select="."/>
</font>
<br/><hr />
</xsl:for-each>
...

It is serialised into (HTML):
-----------------------------------------------------
Annotationauthor_12003-09-20I did implement this and it
worked fine

-----------------------------------------------------
Annotationauthor_22003-09-22There is a more recent
discussion on that, see TMS

-----------------------------------------------------

Now, how do I achieve - within the for-each loop - a
formatting that produces an HTML serialisation like:
-----------------------------------------------------
Annotation: Contributor: author_1 Date: 2003-09-20
I did implement this and it worked fine

-----------------------------------------------------
Annotation: contributor: author_2 Date: 2003-09-22
There is a more recent discussion on that, see TMS

-----------------------------------------------------


Kind regards and thanks for your help !

Holger

PS:
Replacing <xsl:apply-templates select="."/> by

<xsl:value-of
select="//azkno:annotation/rdf:Description/dc:contributor"/>
<xsl:value-of
select="//azkno:annotation/rdf:Description/dc:date"/>
<br />
<xsl:value-of
select="//azkno:annotation/rdf:Description/rdf:value"/>

does basic formatting but is retrieving author_1 only:

-----------------------------------------------------
Annotation author_1 2003-09-20 
I did implement this and it worked fine

-----------------------------------------------------
Annotation author_1 2003-09-20 
I did implement this and it worked fine

-----------------------------------------------------

How is the relative addressing done in the for-each
loop when sub-nodes are present ?

___________________________________________________
The ALL NEW CS2000 from CompuServe
 Better!  Faster! More Powerful!
 250 FREE hours! Sign-on Now!
 http://www.compuserve.com/trycsrv/cs2000/webmail/





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.