[xsl] Re: Digest Issue 664 - How to adress ... and Assebling Variable names

Subject: [xsl] Re: Digest Issue 664 - How to adress ... and Assebling Variable names
From: "cavecatem@xxxxxxxxxxxxx" <cavecatem@xxxxxxxxxxxxx>
Date: Thu, 19 Jan 2006 18:10:53
Hi David and Michael Kay,

first of all, thanks for your suggestions, they provided a solution for both
problems.
Sorry I forgot to include I'm working with XSLT 2.

>   <xsl:value-of
>
> select="/x:xmpmeta/rdf:RDF/rdf:Description/(tiff:ImageWidth|@tiff:
> ImageWidth)
> " />

This is the version I used and it seems to work fine.
>
> If I was doing this in xslt2 I'd probably write a function
>
> <xsl:function name="f:property" as="xs:string">
>  <xsl:param name="x" as="xs:string"/>
>  <xsl:sequence select="string((@*|*)[local-name()=$x][1])"/>
> </xsl:function>

I'm sorry to say I didn't get the function to work, the oxygen 7 rejected an
undefined position.

BTW: to which URI is the f namespaceprefix bound?

> <xsl:variable name=3D"lookup">
>   <a code=3D"0">unknown</a>
>   <a code=3D"1">Daylight</a>
> </xsl:variable>
>
> <xsl:value-of select=3D"$lookup/a[code=3D$code]"/>=20

This also works put this way:
<xsl:value-of select="$lookup/a[@code=$code]"/>

though it seems to me the angular brackets should already indicate that 'code'
is an attribute. But without the @ it didn't work.


Thanks again.
CJ

Current Thread