[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|