[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] AVT use and doc() function in xslt 2.0?


Subject: Re: [xsl] AVT use and doc() function in xslt 2.0?
From: dvint@xxxxxxxxx
Date: Thu, 18 Aug 2011 12:41:22 -0700

thanks, I don't think I ever tried the varaible version without quotes and
I thing the only way I tried the element selection without quotes and {}
was either the bare name or with ./modelic which I realize now was
selecting against an unknown element modelic in my lookup document.

..dan


> On Thu, August 18, 2011 8:19 pm, dvint@xxxxxxxxx wrote:
> ...
>> I have even gone as far as putting the value into a variable and then
>> referencing the variable:
>>
>> <xsl:variable select="'GAASIB0'" name="modelic"/>
>> <xsl:copy-of
>> select="doc('dmcmapping.xml')/searchReplace/smodelic[@val='{$modelic}']"/>
>>
>>
>> What am I missing?
>
> It's not so much what you're missing as what you have extra.  Try:
>
> <xsl:variable select="'GAASIB0'" name="modelic"/>
> <xsl:copy-of
> select="doc('dmcmapping.xml')/searchReplace/smodelic[@val=$modelic]"/>
>
> The XSLT spec (and, consequently, Mulberry's XSLT quick reference [1]) has
> '{' and '}' in the prototypes of attributes where AVTs are meaningful.
>
> Based on your example, you should also be able use 'current()' [2] to do:
>
> <xsl:copy-of
>
select="doc('dmcmapping.xml')/searchReplace/smodelic[@val=current()/modelic]"
/>
>
> Regards,
>
>
> Tony Graham                                   tgraham@xxxxxxxxxx
> Consultant                                 http://www.mentea.net
> Mentea       13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
>  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
>     XML, XSL FO and XSLT consulting, training and programming
>
> [1] http://www.mulberrytech.com/quickref/index.html
> [2] http://www.w3.org/TR/xslt20/#current-function


Current Thread
Keywords