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

Re: replacement example , help

Subject: Re: replacement example , help
From: omprakash.v@xxxxxxxxxxxxx
Date: Tue, 29 Mar 2005 17:10:21 +0530
Re:   replacement example
Hi,
         You have a named template and you have the call to the template
inside the named template.

What you shoud be doing is something like:

<xsl:template match="/">
     <xsl:apply-templates/>
</xsl:template>

<xsl:template match="part1">
<xsl:call-template name="part1"/>
     <xsl:with-param ... etc
</xsl:template>

You may want to rename your named-template to something other than part1
though.

Cheers,
Omprakash.V




                                                                                                                   
                    henry human                                                                                    
                    <henry_human@        To:     xsl-list@xxxxxxxxxxxxxxxxxxxxxx                                   
                    yahoo.de>            cc:     (bcc: omprakash.v/Polaris)                                        
                                         Subject:       replacement example , help                            
                    03/29/2005                                                                                     
                    04:31 PM                                                                                       
                    Please                                                                                         
                    respond to                                                                                     
                    xsl-list                                                                                       
                                                                                                                   
                                                                                                                   




hello,
In this xsl styesheet i will replace aa with the
string cc,
what do i wrong ,that
i dont get cc?
thank you to have a look on this stylesheet:


<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="replace.xsl"?>


<document>
<part1>
<name>uaabb</name>
</part1>
</document>

------------



<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>

<xsl:template name="part1">
<xsl:param name="name"/>
<xsl:param name="aa"/>
<xsl:param name="cc"/>
<xsl:choose>
<xsl:when test="contains($name,$aa)">
<xsl:value-of select="substring-before($name,$aa)"/>
<xsl:value-of select="$cc"/>

<xsl:call-template name="part1">
<xsl:with-param name="name"
select="substring-after($name,$aa)"/>
<xsl:with-param name="aa" select="$aa"/>
<xsl:with-param name="cc" select="$cc"/>
</xsl:call-template>

</xsl:when>

<xsl:otherwise>
<xsl:value-of select="$name"/>
</xsl:otherwise>

</xsl:choose>

</xsl:template>

</xsl:stylesheet>







___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 250MB Speicher kostenlos - Hier
anmelden: http://mail.yahoo.de






This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

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.