[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] 2 values for an attribute?


Subject: RE: [xsl] 2 values for an attribute?
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 13 Aug 2003 08:01:46 +0100

> 
> Is it possible for a single element to have two values for 
> one attribute? 

No.

> For example (two total guesses for <e>)
> 
> <x>
> 	<e value="1|2">Some text</e>
> 	<e value="1" value="2">Some text</e>
> </x>

In your first example the attribute has a single value, "1|2". You can
interpret that value any way you like. If you want the value of the
attribute to be a list then it's more common (and supported by XML
Schema) to use a space as the separator.
> 
> Or is the only solution to double up on data like this (as 
> one example)
> 
> <x>
> 	<e value="1">Some text</e>
> 	<e value="2">Some text</e>
> </x>

Holding data redundantly is a bad idea. A much better solution is to
switch from using attributes to using child elements.

I can't quite see what this has to do with XSLT?

Michael Kay


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



Current Thread
Keywords
xml