RE: [xsl] About source-attributes in result-attributes

Subject: RE: [xsl] About source-attributes in result-attributes
From: "Martinez, Brian" <brian.martinez@xxxxxxxxxxx>
Date: Fri, 9 Jan 2004 09:07:10 -0700
> From: Robert A. van Ginkel [mailto:robert@xxxxxxxxxxxxx]
> Sent: Friday, January 09, 2004 1:32 AM
> Subject: Re: [xsl] About source-attributes in result-attributes
> 
> 
> Thanx,
> 
> Sorry, for the HTML shell I thought it was filtered at mulberry's...

I think the list only filters attachments due to virus concerns.

> What I think is strange in:
> <input class="button" onclick="lgotoent('report.php?view={@idx}')"/>
> is that @idx doesn't have a x-path/namespace ref.
> So you create a new element and within the attribute of that 
> new element u
> use data from the source xml by using a direct assignment of 
> a variable.

It doesn't have to be a variable--it can be any valid XPath expression.  An
AVT is simply a parameter whose value is computed at run-time.  They can be
used within attributes of any literal result elements, and within attributes
of a limited number of XSLT elements.  See the XSLT 1.0 spec at
http://www.w3.org/TR/xslt#attribute-value-templates for more information.

> but if i really really wanted to print
> <input class="button" onclick="lgotoent('report.php?view={@idx}')"/>
> litterary to the target document what would be the syntax of that.

Enclose the AVT within another set of curly braces:

<input class="button" onclick="lgotoent('report.php?view={{@idx}}')"/>

cheers,
b.

| brian martinez                           brian.martinez@xxxxxxxxxxx |
| lead gui programmer                                    303.357.3548 |
| cheap tickets, part of trip network                fax 303.357.3380 |
| 6560 greenwood plaza blvd., suite 400           englewood, co 80111 |
| cendant travel distribution services   http://www.cheaptickets.com/ |

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread