XSLT xpath call-template problem with double quotes - Framework and Interface Programming
This is a discussion on XSLT xpath call-template problem with double quotes - Framework and Interface Programming ; Hey boys and girls,
I ran into a bit of a piccle with the mapper. I''m writing a custom xslt
fuctoid and taking in an xpath as a parameter.
The problem is that when I connect the functoid with an ...
-
-
Re: XSLT xpath call-template problem with double quotes
Nik schrieb:
> Hey boys and girls,
>
>
>
> I ran into a bit of a piccle with the mapper. I''m writing a custom xslt
> fuctoid and taking in an xpath as a parameter.
>
> The problem is that when I connect the functoid with an element in the
> mapper, it generates double quotes around the
> ...
XSLT is a compiled language. You can't put XPath expressions into
strings and let them be evaluated (in absence of extension functions for
that purpose, but those are not part of the spec).
Best regards, Julian
-
Re: XSLT xpath call-template problem with double quotes
I'm not sure that's the problem Julian, xsl:with-param's select attribute
accepts an XPath expression. The trouble is the expression being passed has
an spurious pair of quotes:
<xsl:with-param name="targetnodename" select=""Name2"" />
I haven't done any custom functoids in BizTalk, perhaps someone on one of
the BizTalk groups may be able to help.
--
Joe Fawcett (MVP - XML)
http://joe.fawcett.name
"Julian F. Reschke" <julian.reschke@nospam-greenbytes.de> wrote in message
news:%23FJP4BCJHHA.1248@TK2MSFTNGP02.phx.gbl...
> Nik schrieb:
>> Hey boys and girls,
>>
>>
>>
>> I ran into a bit of a piccle with the mapper. I''m writing a custom xslt
>> fuctoid and taking in an xpath as a parameter.
>>
>> The problem is that when I connect the functoid with an element in the
>> mapper, it generates double quotes around the
>> ...
>
> XSLT is a compiled language. You can't put XPath expressions into strings
> and let them be evaluated (in absence of extension functions for that
> purpose, but those are not part of the spec).
>
> Best regards, Julian
-
Re: XSLT xpath call-template problem with double quotes
Hi Julian,
The sample does work without the extra quote. Good ol value-of select works
fine on xpath statements stored in variables. The thing is that something
seems to happen with the string when it is surrounded by the double quotes.
I've been shaking the box all kinds of ways but it seems like the string
gets saved in another datatype or something under the hood. It really feels
like there is something fishy going on down in the cellar here...
"Julian F. Reschke" <julian.reschke@nospam-greenbytes.de> wrote in message
news:%23FJP4BCJHHA.1248@TK2MSFTNGP02.phx.gbl...
> Nik schrieb:
>> Hey boys and girls,
>>
>>
>>
>> I ran into a bit of a piccle with the mapper. I''m writing a custom xslt
>> fuctoid and taking in an xpath as a parameter.
>>
>> The problem is that when I connect the functoid with an element in the
>> mapper, it generates double quotes around the
>> ...
>
> XSLT is a compiled language. You can't put XPath expressions into strings
> and let them be evaluated (in absence of extension functions for that
> purpose, but those are not part of the spec).
>
> Best regards, Julian
"Julian F. Reschke" <julian.reschke@nospam-greenbytes.de> wrote in message
news:%23FJP4BCJHHA.1248@TK2MSFTNGP02.phx.gbl...
> Nik schrieb:
>> Hey boys and girls,
>>
>>
>>
>> I ran into a bit of a piccle with the mapper. I''m writing a custom xslt
>> fuctoid and taking in an xpath as a parameter.
>>
>> The problem is that when I connect the functoid with an element in the
>> mapper, it generates double quotes around the
>> ...
>
> XSLT is a compiled language. You can't put XPath expressions into strings
> and let them be evaluated (in absence of extension functions for that
> purpose, but those are not part of the spec).
>
> Best regards, Julian
-
Re: XSLT xpath call-template problem with double quotes
Hi Joe, Yepp that it. Withouth the double quotes it works fine. It seems
like the result of passing in the double quoted string seems to result in a
different datatype under the hood. Ive been trying all kinds of tricks
including translate but it's no good. I wonder if it could be that the
string gets turned into an array or something down in the cellar... Odd
thing this...
"Joe Fawcett" <joefawcett@newsgroup.nospam> wrote in message
news:%23ThhDUCJHHA.3952@TK2MSFTNGP02.phx.gbl...
> I'm not sure that's the problem Julian, xsl:with-param's select attribute
> accepts an XPath expression. The trouble is the expression being passed
> has an spurious pair of quotes:
> <xsl:with-param name="targetnodename" select=""Name2"" />
>
> I haven't done any custom functoids in BizTalk, perhaps someone on one of
> the BizTalk groups may be able to help.
>
>
> --
>
> Joe Fawcett (MVP - XML)
>
> http://joe.fawcett.name
>
>
> "Julian F. Reschke" <julian.reschke@nospam-greenbytes.de> wrote in message
> news:%23FJP4BCJHHA.1248@TK2MSFTNGP02.phx.gbl...
>> Nik schrieb:
>>> Hey boys and girls,
>>>
>>>
>>>
>>> I ran into a bit of a piccle with the mapper. I''m writing a custom xslt
>>> fuctoid and taking in an xpath as a parameter.
>>>
>>> The problem is that when I connect the functoid with an element in the
>>> mapper, it generates double quotes around the
>>> ...
>>
>> XSLT is a compiled language. You can't put XPath expressions into strings
>> and let them be evaluated (in absence of extension functions for that
>> purpose, but those are not part of the spec).
>>
>> Best regards, Julian
>
>
-
Re: XSLT xpath call-template problem with double quotes
Nik wrote:
> Hi Joe, Yepp that it. Withouth the double quotes it works fine. It seems
> like the result of passing in the double quoted string seems to result in a
> different datatype under the hood.
Not under the hood, for XPath it is a string literal if you put
something in double or single quotes. So the result is a string value.
And as Julian has pointed out there is no dynamic evaluation of strings
as an XPath expression in XSLT. So you need to get rid of the quotes.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
-
Re: XSLT xpath call-template problem with double quotes
A good nights sleep and a session in the debugger was what I needed to see
your point Julian and Martin. When I use the single quotes the result stored
in the parameter is a node set. With the double quotes it becomes a string.
And that's what the value-of cant evaluate as xpath. What I need is an xslt
funtion of type exec(string).
I feel pretty dense not realizing this from the start but better later than
never. Back to the drawing board... Thanks for the pointer boys.
/Niklas Pettersson
"Nik" <n1@tecnik.se> wrote in message
news:uXU52fEJHHA.3936@TK2MSFTNGP02.phx.gbl...
> Hi Julian,
> The sample does work without the extra quote. Good ol value-of select
> works fine on xpath statements stored in variables. The thing is that
> something seems to happen with the string when it is surrounded by the
> double quotes. I've been shaking the box all kinds of ways but it seems
> like the string gets saved in another datatype or something under the
> hood. It really feels like there is something fishy going on down in the
> cellar here...
>
>
> "Julian F. Reschke" <julian.reschke@nospam-greenbytes.de> wrote in message
> news:%23FJP4BCJHHA.1248@TK2MSFTNGP02.phx.gbl...
>> Nik schrieb:
>>> Hey boys and girls,
>>>
>>>
>>>
>>> I ran into a bit of a piccle with the mapper. I''m writing a custom xslt
>>> fuctoid and taking in an xpath as a parameter.
>>>
>>> The problem is that when I connect the functoid with an element in the
>>> mapper, it generates double quotes around the
>>> ...
>>
>> XSLT is a compiled language. You can't put XPath expressions into strings
>> and let them be evaluated (in absence of extension functions for that
>> purpose, but those are not part of the spec).
>>
>> Best regards, Julian
> "Julian F. Reschke" <julian.reschke@nospam-greenbytes.de> wrote in message
> news:%23FJP4BCJHHA.1248@TK2MSFTNGP02.phx.gbl...
>> Nik schrieb:
>>> Hey boys and girls,
>>>
>>>
>>>
>>> I ran into a bit of a piccle with the mapper. I''m writing a custom xslt
>>> fuctoid and taking in an xpath as a parameter.
>>>
>>> The problem is that when I connect the functoid with an element in the
>>> mapper, it generates double quotes around the
>>> ...
>>
>> XSLT is a compiled language. You can't put XPath expressions into strings
>> and let them be evaluated (in absence of extension functions for that
>> purpose, but those are not part of the spec).
>>
>> Best regards, Julian
>
>
-
-
-
Similar Threads
-
By Application Development in forum Javascript
Replies: 24
Last Post: 12-15-2007, 03:05 PM
-
By Application Development in forum DOTNET
Replies: 1
Last Post: 12-11-2007, 06:12 AM
-
By Application Development in forum Javascript
Replies: 0
Last Post: 12-11-2007, 05:37 AM
-
By Application Development in forum PHP
Replies: 15
Last Post: 07-17-2007, 08:07 AM
-
By Application Development in forum Perl
Replies: 2
Last Post: 02-10-2004, 01:11 PM