|
Subject: Re: [xsl] XML attribute value to pattern match of the replace function From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Sat, 20 Feb 2010 16:54:44 +0100 |
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.*?@party2)', '<cite>$1</cite>')"/></hov:element> </hov:template>
<hov:analyze-string select="." regex="({@party1}.*?{@party2})">
<hov:matching-substring>
<cite>
<xsl:value-of select="regex-group(1)"/>
</cite>
</hov:matching-substring>
<hov:non-matching-substring>
<xsl:value-of select="."/>
</hov:non-matching-substring>
</hov:analyze-string>Martin Honnen http://msmvps.com/blogs/martin_honnen/
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] XML attribute value to patter, Selvaganesh | Thread | RE: [xsl] XML attribute value to pa, Selvaganesh |
| [xsl] XML attribute value to patter, Selvaganesh | Date | Re: [xsl] XML attribute value to pa, Mukul Gandhi |
| Month |