my xml file is like this:
I would like to count how many titles in my xml file. for this I used code like this: and It works fine.
var count = XDocument.Load(path).XPathSelectElements("//title").Count();
It means that it goes to each tag and counts. No I do not want o give more burden on my tool. just use the xpath query to get last title id value.
I tried like this. But it is giving me exception.
var count = XDocument.Load(path).XPathSelectElement("title[last()]/@id").Value;
Thanks,
Darma
VulpesPosted Apr 5, 2013, 7:16 AM