🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.xml
Article #54

Re: Formatting xml attributes via stylesheets.

#54
From: Michael
Date: Wed, 29 Nov 2000 00:00
37 lines
1838 bytes
"Andreas Popper" <Andreas.Popper@gmx.de> wrote in message
news:3A1CBE86.74EA8E1E@gmx.de...
> Torsten Lund wrote:
> >
> > Hello. I have created a xml document. I have also created a xsl
stylesheet
> > to transform the data into a html presentation. However, i don't know
how to
> > process attributes in the style sheet.
> > Maybe an example would clearify :o)
> >
> > The xml document
> > <Unit id="0">
> > ...
> > <errordescription>Code 564:</errordescription>
> > ...
> > </Unit>
> >
> > The xsl style sheet
> > ...
> > <body>
> > <xsl:value-of select="Unit/errordescription">
> > </body>
> > ...

by using the '@' symbol infront of the attribute names allows access to the
attribute values

<xsl:value-of select="Unit/@id" />

don't forget to close your xsl tag with either / at the end of the tag as i
have done above or by adding a close tag as follows:

<xsl:value-of select="Unit/@id"></value-of>

- Mike
Technical Details
Message-ID: <902jvc$ire1@secnews.netscape.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8moit0$fca$1@news1.tele.dk> <3A1CBE86.74EA8E1E@gmx.de>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1047a4,3c3ba754dd86eb08
X-Google-Attributes: gid1047a4,public
X-Google-Thread: 10cf74,3c3ba754dd86eb08
X-Google-Attributes: gid10cf74,public
X-Google-Thread: 10cf80,3c3ba754dd86eb08
X-Google-Attributes: gid10cf80,public
X-Google-Thread: 115169,3c3ba754dd86eb08
X-Google-Attributes: gid115169,public
From: "Michael" <MichaelG@BodyMaster.co.uk>
Subject: Re: Formatting xml attributes via stylesheets.
Date: 2000/11/29
Message-ID: <902jvc$ire1@secnews.netscape.com>
X-Deja-AN: 699049228
References: <8moit0$fca$1@news1.tele.dk> <3A1CBE86.74EA8E1E@gmx.de>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Newsgroups: comp.text.xml,dk.edb.internet.webdesign,microsoft.public.xml,netscape.public.mozilla.layout.xslt