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

Re: 2 values for an attribute?

Subject: Re: 2 values for an attribute?
From: Armen Martirossian <armmarti@xxxxxxxxx>
Date: Wed, 13 Aug 2003 00:00:34 -0700 (PDT)
Re:  2 values for an attribute?
--- Tig <tigger@xxxxxxxxxxxxxxxxx> wrote:
> Is it possible for a single element to have two
> values for one
> attribute? For example (two total guesses for <e>)
> 
> <x>
> 	<e value="1|2">Some text</e>
> 	<e value="1" value="2">Some text</e>
> </x>
> 

You can't have two attributes with the same name.

> 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>
> 
> 
It's not the only possible solution of course: if you
restricted to have just one attribute named "value"
for element "e", then probably the only solution is
which you suggested; if not, you can write:

<x>
  <e value1="1" value2="2">Some text</e>
</x>

Then you can access the attributes this way:

<xsl:template match="e">
  <xsl:for-each select="@*[substring(local-name(), 1,
5) = 'value']">

</xsl:template>


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


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

 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.