XmlDocument doc = new XmlDocument();
doc.Load(@"c:\work\test.xml");
XmlNodeList elemList = doc.GetElementsByTagName("germplasmName2", "http://germic.org/data/gms/gName2.xsd");
Console.WriteLine(elemList.Count);
Gets you the number of records for this XML if its contained in a file called test.xml.
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<4A**********************************@microsoft.co m>
Hi Richard,
This is the XML file i am receiving, sometimes there are 4 records as in
this one, sometimes more than that.
My question is how do i find out the number of records returned in this case.
Thanks!
<?xml version="1.0" encoding="UTF-8" ?>
- <array-list xsi:type="java:java.util.ArrayList"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <ns1:germplasmName2 xmlns:ns1="http://germic.org/data/gms/gName2.xsd">
<ns1:ngid>763777</ns1:ngid>
<ns1:ntype>4</ns1:ntype>
<ns1:nstat>1</ns1:nstat>
</ns1:germplasmName2>
- <ns2:germplasmName2 xmlns:ns2="http://germic.org/data/gms/gName2.xsd">
<ns2:ngid>679645</ns2:ngid>
<ns2:ntype>6</ns2:ntype>
<ns2:nstat>0</ns2:nstat>
</ns2:germplasmName2>
- <ns3:germplasmName2 xmlns:ns3="http://germic.org/data/gms/gName2.xsd">
<ns3:ngid>679644</ns3:ngid>
<ns3:ntype>4</ns3:ntype>
<ns3:nstat>1</ns3:nstat>
</ns3:germplasmName2>
- <ns4:germplasmName2 xmlns:ns4="http://germic.org/data/gms/gName2.xsd">
<ns4:ngid>679643</ns4:ngid>
<ns4:ntype>4</ns4:ntype>
<ns4:nstat>1</ns4:nstat>
</ns4:germplasmName2>
</array-list>
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.770 / Virus Database: 517 - Release Date: 27/09/2004
[microsoft.public.dotnet.languages.csharp]