|
Subject: Re: [xsl] Links for IDREFS From: Jarkko.Moilanen@xxxxxx Date: Thu, 8 Jan 2004 12:20:30 +0200 |
Lainaus Kaarle Kaila <kaarle.kaila@xxxxxx>:
< hello,
<
< I have an XML file containing person information. The data is grouped into
< table elements
< The person element may have a table attribute that indicates the table the
< person "owns".
< Below is a simple example of this:
< ....XML code snippet ...
< <table number="1">
< <person sex="M" table="5">
< <name><givenname>Seppo </givenname><surname>Kaila</surname></name>
< </person>
< </table>
<
< .... XSLT snippet that creates a html link for above person.
<
< <xsl:template match="person">
< <xsl:variable name="lname" select="@table"/>
< <a href="data{$lname}.html">Table <xsl:value-of select="@table"/></a>
< </xsl:template>
<
< --------------------------------------------
< I have also cases where person is a member of several tables. These I
< indicate by using
< tables attributes like in next piece of XML similarly as IDREFS types in
< XML:
<
< <table number="1">
< <person sex="M" tables="5 7 10">
< <name><givenname>Seppo </givenname><surname>Kaila</surname></name>
< </person>
< </table>
<
< ........
<
< How should I create links to all tables with result something like this:
<
< Tables <a href="data5.html">5</a>, <a href="data7.html">7</a>, <a
< href="data10.html">10</a>
< ------------------------
< regards
< Kaarle Kaila
You might want to use recursion to "go through" all the numbers separated by
empty space. That means a call-template method.
Jarkko
***************************************************
* Jarkko Moilanen *
* Project Manager, ITCM (www.itcm.org) *
* Profound XML technology Expert *
* University of Tampere *
* Hypermedia Laboratory *
***************************************************
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Links for IDREFS, Kaarle Kaila | Thread | Re: [xsl] Links for IDREFS, David Carlisle |
| [xsl] Links for IDREFS, Kaarle Kaila | Date | Re: [xsl] Links for IDREFS, David Carlisle |
| Month |