ramandeep1980 Posted August 30, 2013 Share Posted August 30, 2013 Hi Everyone,I am able to read XML attributes from XML file but not able to read XML elements.In below example,I am able to read comment , entered,center etc by giving xPath till Event tag and giving description of fields as @comment, @entered and @center etc but not able to read aReason by giving xPath till Reasons tag and using @aReason as a field decription, the reason i understand is that comment, entered etc are atrribute of XML where as aReason are XML elements. <Event comment="Coll" entered="Se" Center="ET" appro="1" age="3" <Reasons> <aReason>Missing</aReason> <aReason>Missing1</aReason> <aReason>Missing2/aReason> </Reasons></Event>Can you please tell me wat xPath and wat field description i need to use to read aReason , XML elements.Regards,Raman Link to comment Share on other sites More sharing options...
Thomas Zimmer Posted August 31, 2013 Share Posted August 31, 2013 Without getting deeper, I would say your problem is that you have no well-formed xml; a tag "<aReason>" must be closed with "</aReason> and not with "</approvedReason>". Changed that and you will be able to read the elements with xpath:/Event/Reasons/aReasonCheers, Thomashttp://www.ThomasZimmer.net Link to comment Share on other sites More sharing options...
ramandeep1980 Posted September 2, 2013 Author Share Posted September 2, 2013 Done that too Thomas. That was a wrioting error.Still I am not able to read XML elements though XML attributes can be read easily.Can anyone reply to this.Regards,Raman Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now