[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl-call template problem

Subject: Re: xsl-call template problem
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Wed, 14 Aug 2002 19:59:14 +0200
xsl call template context
<xsl:template name="test" match='dxl:document[@form="frmTask"]'>

Even if you add a match-attribute to this template (what's absolutely valid), the context is not changed when you use <xsl:call-template/>. The noden the transformer processes at the moment, is still <dxl:database/>. If you use <xsl:apply-templates/> the context changes to <dxl:document/> if the template above is applied.

Is <dxl:document/> a a child of <dxl:database/>?? Then you can test it with

<xsl:value-of select='dxl:document/dxl:item[@name="ContentProviderInfo"]/dxl:text'/>

in your named template.

Regards,

Joerg


Christer Nordvik wrote:
Hi.

I have a problem with <xsl:call-template>. When I use:

<xsl:template match='dxl:database'><xsl:text/>
 <xsl:element name='Message'> <xsl:text>&#10;</xsl:text>
   <xsl:apply-templates/>
 </xsl:element>
</xsl:template>

<xsl:template name="test" match='dxl:document[@form="frmTask"]'>
<xsl:element name="ContentProviderInfo"> <xsl:value-of select='dxl:item[@name="ContentProviderInfo"]/dxl:text'
/> </xsl:element>
</xsl:template>


Everything works great, but if I want to use the call template tag like:

<xsl:template match='dxl:database'><xsl:text/>
<xsl:element name='Message'> <xsl:call-template name = "test" />
</xsl:element>
</xsl:template>


<xsl:template name="test" match='dxl:document[@form="frmTask"]'>
<xsl:element name="ContentProviderInfo"> <xsl:value-of select='dxl:item[@name="ContentProviderInfo"]/dxl:text'
/> </xsl:element>
</xsl:template>


Then it won't work(doesn't find the data). I know there is some
difference here in context node and nodelist from what I have been
reading, but I can't understand the difference. I haven't seen any
examples of xsl:call-template calling a template that iterates through
the current XML document.

Any help would be greatly appreciated!

Best Regards,
Christer Nordvik


--

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@xxxxxxxxx
www.virbus.de


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.