|
Subject: Re: [xsl] 2 values for an attribute? From: Armen Martirossian <armmarti@xxxxxxxxx> Date: Wed, 13 Aug 2003 00:04:22 -0700 (PDT) |
Sorry, my previous posting was not finished...
--- 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:value-of select="."/>;
</xsl:for-each>
</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 |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] 2 values for an attribute, Michael Kay | Thread | [xsl] how to close html tags : link, Myriam Delperier |
| RE: [xsl] 2 values for an attribute, Michael Kay | Date | Re: [xsl] Calling exslt date functi, Maik Stührenberg |
| Month |