xsl-list
[Top] [All Lists]

RE: call-template returns nothing was [Newbie question]

2004-12-06 13:07:42

Sorry about that, sent before its time
As I was saying, you were right it was

        <xsl:if test="not(SecuritiesMovement/DebitCreditIndicator/node())">

I wanted.

It works beautifully now, to think I knew nothing about XSLT yesterday,
thanks for your help.

David

-----Original Message-----
From: David Wynter [mailto:david(_at_)stpenable(_dot_)com]
Sent: 06 December 2004 20:05
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] call-template returns nothing was [Newbie question]


Thanks George,

I am rapidly getting the hang of this, I had worked out the $ reference and
that to output you either use <xsl:value-of select="$name"/>, for test yuo
also need to refer to the $name.

I may have misinformed, it was


-----Original Message-----
From: George Cristian Bina [mailto:george(_at_)sync(_dot_)ro]
Sent: 06 December 2004 19:52
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] call-template returns nothing was [Newbie question]


Hi David,

If you want to refer to a parameter or to a variable you should use $
before the parameter or variable name:

So instead of

<xsl:template name="funcmsglookup">
     <xsl:param name="codef"/>
     <xsl:if test="codef=0">
         <xsl:text/>NEWM</xsl:if>
     <xsl:if test="codef=1">
         <xsl:text>REPL</xsl:text>
     </xsl:if>
     <xsl:if test="codef=2">
         <xsl:text>CANC</xsl:text>
     </xsl:if>
</xsl:template>

you should write:

<xsl:template name="funcmsglookup">
     <xsl:param name="codef"/>
     <xsl:if test="$codef=0">
         <xsl:text/>NEWM</xsl:if>
     <xsl:if test="$codef=1">
         <xsl:text>REPL</xsl:text>
     </xsl:if>
     <xsl:if test="$codef=2">
         <xsl:text>CANC</xsl:text>
     </xsl:if>
</xsl:template>

and change also all the the other places in your stylesheets where you
use parameters or variables.
Otherwise, codef=1 for instance will check if there is an element codef
  as child of the current element having its content 1.

To test for an empty element you can use not(element/node()) where
element should be replaced with the actual element you are checking, but
I'm not sure that you want this because there is no empty
SecuritiesMovement element in your sample.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


David at roamware wrote:
Hi,

I stripped out the namespace form th exml and it redners oputput, but none
of my xsl:call-template seems to work. I know th eselect for the param is
working as I tried outouting the select as a value-of and it output, so
assume therefore that the select content is being forwarded to the
template
being called. But as I put the name of the param on it's own in the
template
being called either as name or $name I get that literal output, not the
value of the select passed in?

A second problem I noticed. The first 4 apply-templates match to,
respectively 1 GeneralInformationBlock, 1 UnderlyingSecurities, 1
CorporateActionDetail and 2 CorporateActionOption. In the 2
CorporateActionOption I test for empty element using <xsl:if
test="t:SecuritiesMovement!=''"> and <xsl:if
test="t:CashPaymentDetails!=''">, but these do not seem to be working the
output inside the xsl:if is being called regardless.

Thx.

David

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>
  • RE: call-template returns nothing was [Newbie question], David at roamware <=