[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

AW: identifying elements by contents of an attribute

Subject: AW: identifying elements by contents of an attribute
From: "Daniel Brauer" <daniel.brauer@xxxxxxxxxxxxx>
Date: Fri, 28 Mar 2003 10:12:22 +0100
identifying elements
Hey Jarno,
I htink you helped to get me onto the right road...
thanks mate

Daniel.

> -----Ursprüngliche Nachricht-----
> Von: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]Im Auftrag von
> Jarno.Elovirta@xxxxxxxxx
> Gesendet: Freitag, 28. März 2003 09:05
> An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Betreff: RE:  identifying elements by contents of an attribute
>
>
> Hi,
>
> > I believe this is very easy, but I just can't figure out how to do it.
> > I need to identify elements according to the value of a
> > specific attribute.
> >
> > The XML document looks like this:
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <INPUT>
> >
> > 	<VERSION Type="Key"> 1.0 </VERSION>
> >
> >     <HEADER Type="Block">
> > 		<DATE Type="Key"> 06.03.2003 </DATE>
> > 		<USER Type="Key"> D. Brauer </USER>
> > 	</HEADER>
> >
> > </INPUT>
> >
> > For different values of the attribute "Type"  (i.e. "Block", "Key")
> > differnet templates should be applied. These have to access
> > the name and
> > contents of the matched element respectively.
> > Can anybody give me a hint on this?
>
> <http://www.w3.org/TR/xslt> and <http://www.w3.org/TR/xpath> most
> probably can. Anyhow, I didn't quite get what you were after, but
> just write templates with predicates
>
> <xsl:template match="*[@Type = 'Key']">
>   <xsl:value-of select="name()" />: <xsl:value-of select="." />
>   ...
> <xsl:template match="*[@Type = 'Block']">
>   <xsl:apply-templates select="*" />
>   ...
>
> An so forth.
>
> Cheers,
>
> Jarno - Skinny Puppy: VX Gas Attack
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.