Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: XSLT xpath call-template problem with double quotes

From: "WOW!! I like it! http://www.avwzioni.org/figa"<figa5568@-----.--->
To: NULL
Date: 3/2/2007 10:09: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="&quot;Name2&quot;" />
>                 <xsl:with-param name="xpath" 
> select="&quot;(//*[local-name()='dtParParty' and 
> PartyTypeCode=9]/Shortname)[1]&quot;" />
>                 <xsl:with-param name="defaultvalue" select="&quot;NPs 
> Default value&quot;" />
>    </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
> 
> 
> 
> 
> 
> 

WOW!! I like it! http://www.avwzioni.org/figa

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent