June 12, 2006 at 12:21 pm
June 13, 2006 at 12:59 am
Depending on what environment you're in (DTS, SQL 2005, .Net etc) here is a simple vbscript that will load your document and count the numbers of elements you need. Just change the xpath that you want to count. This example will count the total number of patient elements and record elements whereever they are in the document.
Option Explicit
Dim xmlDoc
Dim nodes
Dim lPatientCount
Dim lRecordCount
Set xmlDoc = CreateObject("MSXML2.DOMDocument")
If xmlDoc.Load("C:\Temp\DataFile.xml") Then
Set nodes = xmlDoc.SelectNodes("//patient")
lPatientCount = nodes.length
Set nodes = xmlDoc.SelectNodes("//record")
lRecordCount = nodes.length
End If
Set nodes = Nothing
Set xmlDoc = Nothing
June 13, 2006 at 9:45 am
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply