View Single Post
  #3 (permalink)  
Old August 14th, 2010, 09:49 AM
metinhoclam metinhoclam is offline
Authorized User
Join Date: Jul 2010
Posts: 27
Thanks: 6
Thanked 0 Times in 0 Posts
Default Check function

Dear Mr.mhkay

Is there any fuction to check whether element contain another element. In case of the <box> is not only as unique element inside <listbox>.
I've made the parent template with: <xsl:apply-templates select ="listcontainer/*". Could I do like <xsl:template match="*[numberofball]" ?

To get clearly, this is source document:
<?xml version="1.0" encoding="UTF-8"?>
	<box id="a1" size="24" status="saled">
	<box id="a2" size="64" status="instore">
	<box id="a3" size="36" status="instore">
	<box id="a4" size="42" status="instore"/>
	<box id="a5" size="43" status="saled"/>
	<bag id ="b1" sive="16x20" status="instore"><numberofbook>12</numberofbook></bag>
	<bag id ="b2" sive="10x10" status="instore"><numberofbook>8</numberofbook></bag>
	<bag id ="b3" sive="16x10" status="instore"><numberofbook>10</numberofbook></bag>
	<bag id ="b4" sive="16x20" status="saled"/ ></bag>
	<bag id ="b5" sive="16x20"><numberofbook>13</numberofbook></bag>
	<can id = "c1" size ="100m3" status="instore"><oil>3l</oil></can>
	<can id = "c2" size ="120m3" status="saled"><oil>4l</oil></can>
	<can id = "c3" size ="200m3" status="instore"></can>
	<can id = "c4" size ="210m3" status="saled"><oil>4l</oil></can>
	<can id = "c5" size ="220m3" status="instore"><oil>5l</oil></can>
	<can id = "c6" size ="300m3" status="saled" ><oil>13l</oil></can>

And this is the expectation xml document



Last edited by metinhoclam; August 14th, 2010 at 09:56 AM..
Reply With Quote