Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - XSLT xpath call-template problem with double quotes [Thread Next] RE: XSLT xpath call-template problem with double quotesTo: NULL Date: 3/3/2007 10:27:00 AM
> 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
>
> parameters. Then, when I run a value-of statement on the xpath parameter I
> get the xpath statement, not the value of the evaluation! The problem turns
> out to be the double quotes. I created an exampel that runs in xmlspy and it
> works the same way. It works with single quotes but not with double. I can't
> do anything about the call unfortunately, what I can effect is the
> XpathLookupFunctoid template below.
>
> What I need is a way to convince the value-of statement to evalutate the
> statement instead of just outputting the xpath statemenat by itself.
>
> I tryed all kinds of tricks that I could emagine including substrings and
> variables. It seems that the string becomes a totally different animal once
> it gets double quoted.
>
> Below is the xmlspy sample you can run in xmlspy. If the extra quote sight
> on the xpath parameter in the call-template statement is removed it works
> fine. But since that's generated by Biztalk I cant do anything about it so
> the
> manipulation needs to be done in XpathLookupFunctoid:
>
> Below is the xmlspy compatible example:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
>
>
>
> <xsl:template match="/">
> <xsl:call-template name="XpathLookupFunctoid">
> <xsl:with-param name="searchparam" select="9" />
> <xsl:with-param name="targetnodename"
> select=""Name2"" />
> <xsl:with-param name="xpath"
> select=""(//*[local-name()='dtParParty' and
> PartyTypeCode=9]/Shortname)[1]"" />
> <xsl:with-param name="defaultvalue" select=""NPs
> Default value"" />
> </xsl:call-template>
>
> </xsl:template>
>
> <xsl:template name="XpathLookupFunctoid">
> <xsl:param name="searchparam" />
> <xsl:param name="targetnodename" />
> <xsl:param name="xpath" />
> <xsl:param name="defaultvalue" />
>
> <xsl:variable name="ren" select="$xpath"/>
>
> <xsl:element name="{$targetnodename}">
> Resultat: <xsl:value-of select="$ren"/>
> </xsl:element>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
>
> Greatfull for all ideas
>
>
> Niklas Pettersson
> Karlstad, Sweden
>
>
>
>
>
>
Ich besichtige deinen Aufstellungsort wieder bald fur sicheres! http://www.2ire17.org/pokemon-porn
BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
