Subject: Re: multiple XML tags -> single output
From: zbrown@xxxxxxxxxxxxx
Date: Wed, 27 Dec 2000 17:37:25 -0800
|
On Wed, Dec 27, 2000 at 04:41:30PM -0800, Kevin McCarthy wrote:
> Try
> <xsl:value-of select="."/><xsl:value-of select="//issue/@num"/><xsl:value-of
> select="//issue/@date" />
>
> The two "//" in the xpath select indicate that they are top-level elements.
it worked! Now I just have to figure out why... :-)
OK, the docs I've got say that '//issue' will match all <issue> elements
anywhere in the document. As opposed to 'issue' which only matches children
in the current context. OK, that's clear. ah ha! And the current context is the
<title> tag, because I've now got
<xsl:template match="title">
<h1>
<xsl:value-of select="."/> #<xsl:value-of select="//issue/@num"/>
For <xsl:value-of select="//issue/@date" />
</h1>
</xsl:template>
Cool!
Thanks,
Zack
> -Kevin
>
> >This doesn't work for me either...
> >
> >I think I must be missing something, if two answers have been given and
> > neither
> > of them work for me. Maybe I don't have the right tools. I'm using
> > XML::XSLT
> > under Linux, with Perl 5.005; could this feature be unsupported by that
> > module?
> >
> >Zack
>
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
--
--
Zack Brown, Linuxcare, Inc.
tel: 1-415-354-4878x284, fax: 1-415-701-7457
zbrown@xxxxxxxxxxxxx, http://www.linuxcare.com/
Linuxcare. Support for the revolution.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- Re: multiple XML tags -> single output, (continued)
- zbrown - Wed, 27 Dec 2000 15:58:11 -0800
- Mike Brown - Wed, 27 Dec 2000 17:06:23 -0700 (MST)
- zbrown - Wed, 27 Dec 2000 16:19:09 -0800
- Kevin McCarthy - Wed, 27 Dec 2000 16:41:30 -0800
- zbrown - Wed, 27 Dec 2000 17:37:25 -0800 <=
- Mike Brown - Wed, 27 Dec 2000 21:05:29 -0700 (MST)
- zbrown - Wed, 27 Dec 2000 21:30:01 -0800
- Jiri Jirat - Thu, 28 Dec 2000 08:45:56 +0100
- Mike Brown - Thu, 28 Dec 2000 01:05:08 -0700 (MST)
|
|