xsl-list
[Top] [All Lists]

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

2006-01-19 17: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[(_at_)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



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>