xsl-list
[Top] [All Lists]

[xsl] XML attribute value to pattern match of the replace function

2010-02-20 09:29:35
Dear Team,

How can I assign the attribute value to pattern of the replace function,
kindly guide me.

Input XML:
<caseref party1="Drury" party2="Secretary of State for the Environment, Food
and Rural Affairs">Drury v Secretary of State for the Environment, Food and
Rural Affairs [2004] EWCA Civ 200; [2004] 1 W.L.R. 1906 </caseref>

XSL:
<hov:template match="caseref">
<hov:element name="caseref"><hov:value-of select="replace(.,
'(@party1(_dot_)*?(_at_)party2)', 
'&lt;cite&gt;$1&lt;/cite&gt;')"/></hov:element>
</hov:template>

Needed XML:
<caseref party1="Drury" party2="Secretary of State for the Environment, Food
and Rural Affairs"><cite>Drury v Secretary of State for the Environment,
Food and Rural Affairs</cite> [2004] EWCA Civ 200; [2004] 1 W.L.R. 1906
</caseref>

Note: I have defined in char-map for &lt; and &gt;

Thanks,
Selva


Confidentiality Notice:  This transmittal is a confidential communication.  If 
you are not the intended recipient, you are hereby notified that you have 
received this transmittal in error and that any review, dissemination, 
distribution or copying of this transmittal is strictly prohibited.  If you 
have received this communication in error, please notify this office 
immediately by reply and immediately delete this message and all of its 
attachments, if any.


--~------------------------------------------------------------------
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>