|
Subject: [xsl] Problem Tagging Several Words in a Given String From: UlyLee <ulyleeka@xxxxxxxxx> Date: Wed, 19 Oct 2005 03:52:14 -0700 (PDT) |
Hi list! I know this problem was solved last week by
the function given by Michael Kay, unfortunately i
encountered a problem with this string:
"Image Mater amabilis P. Trigard"
The function is (i made some modification so that it
will fit the our requirements):
<xsl:function name="f:replace-all">
<xsl:param name="input" as="xs:string"/>
<xsl:param name="words-to-replace" as="xs:string*"/>
<xsl:param name="replacement" as="xs:string*"/>
<xsl:sequence select="if (exists($words-to-replace))
then f:replace-all(replace($input,
replace($words-to-replace[1], '[.\\?*+{}()\[\]^$]',
'\\$0'),
concat('<AUT_DEST>',$replacement[1],'</AUT_DEST>')),remove($words-to-replace,1),remove($replacement,1))
else $input"/>
</xsl:function>
$input = "Image Mater amabilis P. Trigard"
$words-to-replace = ("P. Trigard","Trigard")
$replacement = ("Trigard, Louis, s.j.","Trigard,
Louis, s.j.")
running the current funtion would result to:
"Image Mater amabilis <AUT_DEST><AUT_DEST>Trigard,
Louis, s.j.</AUT_DEST>, Louis, s.j.</AUT_DEST>"
But my desired output is:
"Image Mater amabilis <AUT_DEST>Trigard, Louis,
s.j.</AUT_DEST>"
what should i do to the function to achieve that?
-- UlyLee
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
| Current Thread |
|---|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Fernando Dos-Santos/BASF-IT-S, fernando . dos-santo | Thread | Re: [xsl] Problem Tagging Several W, UlyLee |
| Re: [xsl] Up-conversion using XSLT , Manfred Staudinger | Date | [xsl] String evaluation problem, Fadi Qutaishat |
| Month |