Delphi Xe Read Xml File
HiI am trying to parse an XML file using TXMLDocument and Delphi XE2. I am new to XML with Delphi and having much trouble accessing the attribute values from this file:I have no trouble reaching the first level and can return an IXMLNode instance but I cannot get to anything below that ie. Second and third level child nodes (both ) and their attribute values.Basically I'm doing this, for example, to get the 'time' attribute value from the second level.StartingItemNode:= XMLDocument.DocumentElemen t.ChildNod es'Cube';aNode:= StartingItemNode;sDATE:= aNode.ChildNodes'Cube'.A ttributes 'time'. Line 1 is fine but sDATE in line 3 is always null.Please could anyone tell me where this is going wrong?thanks and best wishesRR. This is my example:uses ComObj, MSXML. What can I say.
Read Xml File In Vb
A thoroughly detailed, fully working solution. I am genuinely very grateful:-)I probably would have continued to struggle with TXMLDocument to parse this file and even now, I have still not found a way to do it. I believe that TXMLDocument is a 'wrapper' for MSXML and I applaud your ingenuity in employing MSXML directly. It seems to have methods which are more suitable for addressing the nodes in this case. With TXMLDocument I still have never been able to get beyond the first level of in this file.Once again, many thanks for your time and effort with this.RR.