| From | Sent On | Attachments |
|---|---|---|
| Jones Mark Mr (ITCS) | Mar 18, 2008 7:29 am | |
| Andrew Welch | Mar 18, 2008 8:27 am | |
| Jones Mark Mr (ITCS) | Mar 18, 2008 9:32 am | |
| Martin Honnen | Mar 18, 2008 9:37 am | |
| David Carlisle | Mar 18, 2008 9:37 am | |
| Jones Mark Mr (ITCS) | Mar 18, 2008 10:10 am | |
| ac | Mar 18, 2008 10:10 pm | |
| ac | Mar 18, 2008 10:25 pm | |
| Mukul Gandhi | Mar 19, 2008 1:28 am | |
| Michael Kay | Mar 19, 2008 2:15 am | |
| Michael Kay | Mar 19, 2008 2:21 am | |
| David Carlisle | Mar 19, 2008 3:01 am | |
| Patrick Bergeron | Mar 19, 2008 7:17 am | |
| David Carlisle | Mar 19, 2008 7:28 am | |
| Wendell Piez | Mar 19, 2008 9:44 am | |
| Michael Kay | Mar 19, 2008 10:21 am | |
| ac | Mar 19, 2008 10:33 am | |
| Ken Tam | Mar 19, 2008 9:49 pm | |
| Dimitre Novatchev | Mar 19, 2008 10:38 pm | |
| Dimitre Novatchev | Mar 20, 2008 6:34 am | |
| Michael Kay | Mar 20, 2008 7:31 am |
| Subject: | RE: [xsl] Looping through multiple elements | |
|---|---|---|
| From: | Jones Mark Mr (ITCS) (Mark...@uea.ac.uk) | |
| Date: | Mar 18, 2008 9:32:13 am | |
| List: | com.mulberrytech.lists.xsl-list | |
Hi Andy,
Thanks for the tip - that makes sense.
I tried this;
<xsl:for-each select="//dc:creatorid | //dc:creator1id | //dc:creator2id | //dc:creator3id"> <component group="authors_logins" name="value"> <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if> </component> </xsl:for-each>
And the output was just this. <component name="value" group="authors_logins">n030, </component>
The metadata has values for dc:creatorid and dc:creator1id so there should be a value after the comma.
I also tried this but again the output is the same.
<xsl:for-each select="//dc:creatorid | //dc:creator1id | //dc:creator2id | //dc:creator3id"> <component group="authors_logins" name="value"> <xsl:value-of select="."/> <xsl:if test="position() != last()"> <xsl:text>, </xsl:text> </xsl:if> </component> </xsl:for-each>
Perhaps it is something to do with the // before the element name?? I tried cominations without these (select="//dc:creatorid | dc:creator1id |) but didn't fix it. Are these paths?
Thanks for your help. Mark
Mark Jones University of East Anglia Norwich NR4 7TJ Tel: 01603 59 1250
-----Original Message----- From: Andrew Welch [mailto:andr...@gmail.com] Sent: Tuesday, March 18, 2008 3:28 PM To: xsl-...@lists.mulberrytech.com Subject: Re: [xsl] Looping through multiple elements
On 18/03/2008, Jones Mark Mr (ITCS) <Mark...@uea.ac.uk> wrote:
example, there are also these fields (dc:creator, dc:creator1, dc:creator2, dc:creator3). I need to make the xml output for this generate the xml below (the names are just examples)
<component name="value" group="creators">Smith, Jones, Black, White</component>
In 1.0 you can do:
<xsl:for-each select="dc:creator | dc:creator1 | dc:creator2 | dc:creator3"> <xsl:value-of select="."/> <xsl:if test="position() != last()">, </xsl:if> </xsl:for-each>
In 2.0 it's easier:
string-join((dc:creator, dc:creator1, dc:creator2, dc:creator3), ', ')
cheers -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/
--~------------------------------------------------------------------ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ or e-mail: <mailto:xsl-...@lists.mulberrytech.com> --~--
--~------------------------------------------------------------------ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ or e-mail: <mailto:xsl-...@lists.mulberrytech.com> --~--





