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

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

Subject: Re: Digest Issue 664 - How to adress ... and Assebling Variable names
From: "cavecatem@xxxxxxxxxxxxx" <cavecatem@xxxxxxxxxxxxx>
Date: Thu, 19 Jan 2006 18:10:53
xslt2 string lookup
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

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.