Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find how length of inner tags

Status
Not open for further replies.

cat5ive

MIS
Dec 3, 2004
184
US
Hi,

Here is my xml
Code:
<data>
 <customername>522000 ABC CO</customername>
 <filelisting>
  <record>
   <problemblock>
   <problem>Arrival Notice Missing</problem>
   <probopn>01/08/07</probopn>
   <probcls>01/08/07</probcls>

   <problem>A/N Rec&apos;d after cargo arrival</problem>
   <probopn>01/12/07</probopn>
   <probcls>01/12/07</probcls>
  </problemblock>

  <vendorblock>
   <vendor>ZHENG YONG GARMENT FACTORY CO LTD</vendor>
  </vendorblock>
  </record>

  <record>
   <problemblock>
   <problem>Arrival Notice Missing</problem>
   <probopn>01/10/07</probopn>
   <probcls>01/10/07</probcls>
  </problemblock>

  <vendorblock>
   <vendor>CHU HSING GARMENT (CAMBODIA) CO LTD</vendor>
  </vendorblock>
  </record>

  <morerecords>YES</morerecords>
 </filelisting>
</data>

I want to know how many 'problem' within one <record></record>. Can someone please provide sample code?
In my first <record>, there are 2 problems. Here is what I try and it did not show 2.
Code:
 set nodelist3 = record.selectNodes("//record/problemblock/problem")	  
	  response.write(nodelist3.length)
	  response.end

Thanks.
 
>set nodelist3 = record.selectNodes("//record/problemblock/problem")
[tt]set nodelist3 = record.selectNodes("//problem")[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top