<data>
<manufacture_date="2013-06-05 T 19:40:50. 88463 7 Z">
<java_package>
<author>tom</author>
<year>2013</year>
<price>29.99</price>
</java_package>
</manufacture>
<manufacture_date="2015-06-05T19:40:50.884637Z">
<java_package_2>
<author>tom</author>
<year>2015</year>
<price>39.95</price>
</java_package_2>
</manufacture>
<manufacture_date="2014-06-05T19:40:50.884637Z">
<java_package_3>
<author>tom</author>
<year>2003</year>
<price>39.95</price>
</java_package_3>
</manufacture>
</data>
Root element is DATA, with Manufacture as the element content. In this XML data, we're trying to fetch the most recent manufacture based on date.
The latest manufacture has a date of "2015-06-05 T 19 : 40 : 50 . 88463 7 Z"
This date is an attribute of the manufacture element.
Currently working in ASP.NET and C# for this task.
Below is the code I've attempted:
XmlDocument xdoc = new XmlDocument();
xdoc.LoadXml("bc.xml");
XmlNode root = xdoc.DocumentElement;
XmlNodeList nodeList = root.SelectNodes("//manufacture");
foreach (XmlNode node1 in nodeList)
{
Label1.Text += node.Attributes["DATE"].Value.ToString() + "\n <br>";
}