Subject: [xsl] [Q] for-each formatting problem From: hgadm@xxxxxxxxxxxxx Date: Tue, 07 Oct 2003 04:55:06 -0700 (PDT) |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] xsl:value-of select : how, Wendell Piez | Thread | RE: [xsl] [Q] for-each formatting p, Jarno . Elovirta |
Re: [xsl] xsl:value-of select : how, andrew . curry | Date | RE: [xsl] xsl:value-of select : how, Rod Humphris - FLPTN |
Month |