Re: [xsl] selecting elements with param

Subject: Re: [xsl] selecting elements with param
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Mon, 22 Feb 2010 18:03:53 +0100
ivanmacculi@xxxxxxxxx wrote:
Hi all, i've problem of selecting elements that corresponds to some characteristics:

xml elements that i want to select are like this:

<mets:techMD ID="TMD_DRV1_IMG_Scan00020_techMD">

so, i need to select all mets:techMD that have ID="TMD_DRV1_IMG_Scan#####_techMD".
my problem is to cover all the numbers.

<xsl:apply-templates
select="mets:techMD[matches(@ID, 'TMD_DRV1_IMG_Scan[0-9]{5}_techMD')]"/>



That assumes there will always be 5 digits but you could also use e.g.


<xsl:apply-templates
select="mets:techMD[matches(@ID, 'TMD_DRV1_IMG_Scan[0-9]{1,5}_techMD')]"/>


to allow one to five digits.


--


	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

Current Thread