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

Re: Spam: replacement more than one Tag in nod

Subject: Re: Spam: replacement more than one Tag in node
From: JBryant@xxxxxxxxx
Date: Tue, 29 Mar 2005 16:33:49 -0600
translate surname
Hi, Henry,

For single characters, the translate function works nicely.

translate(surname, '.', ':')

I read your post very quickly, so perhaps I have misunderstood. But I HTH.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)



henry human <henry_human@xxxxxxxx> 
03/29/2005 04:00 PM
Please respond to
xsl-list@xxxxxxxxxxxxxxxxxxxxxx


To
xsl-list@xxxxxxxxxxxxxxxxxxxxxx
cc

Subject
Spam:  replacement  more than one Tag in  node






hello,
this time i will to define a template to 
replace . with : in more than one Tags 
f.e replace in name, surname,aaa,bbb ...
how should the template rule be defined to do this??


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


<document>

<part1>
<ttt>u.bb</ttt>
<name>u.bb</name>
<surname>u.bb</surname>
<aaa>u.bb</aaa>
<bbb>u.bb</bbb>
</part1>

<part2>

<name>u.bb</name>

</part2>
</document>

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

<xsl:template match="document">

<xsl:apply-templates select="part1"/>
</xsl:template>

<xsl:template match="ptr1">
<xsl:call-template name="part1">
<xsl:with-param name="name" select="name"/>
<xsl:with-param name="search_for" select="'.'"/>
<xsl:with-param name="replace_out" select="':'"/>
</xsl:call-template>
</xsl:template>

 <xsl:template name="part1">


<xsl:param name="name"/>
<xsl:param name="search_for"/>
<xsl:param name="replace_out"/>



<xsl:choose>
<xsl:when test="contains($name,$search_for)">
<xsl:value-of
select="substring-before($name,$search_for)"/>
<xsl:value-of select="$replace_out"/>

<xsl:call-template name="part1">
<xsl:with-param name="name"
select="substring-after($name,$search_for)"/>
<xsl:with-param name="search_for"
select="$search_for"/>
<xsl:with-param name="replace_out"
select="$replace_out"/>
</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

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.