Joost Miltenburg Posted June 22, 2010 Share Posted June 22, 2010 Hi ! I have this xml-file 20100525 DJ2 inv_nr 20100525 trn_date {27-05-2010} sub_nr 242868 So... How do I get the of 242868 from the the tag when the 'sister'-tag when the value is 'sub_nr' ? I can kind of do a brute force /AVXML/EBUSMSGSRQ/EBUSTRNRQ/ROWADDRQ/FIELD/NAME to get to that level , but how do I go to the sister from here ? Maybe this is the wrong approach... Any ideas ? Link to comment Share on other sites More sharing options...
comment Posted June 22, 2010 Share Posted June 22, 2010 It would be helpful to know the context: what is a record, and what other data needs to be imported. Link to comment Share on other sites More sharing options...
Joost Miltenburg Posted June 22, 2010 Author Share Posted June 22, 2010 ah.... right... a record is enclosed by the tag a record has one or more and those have multiple fields a field has a and a , but you could read that yourself I guess. So what I am trying to do is select the tag where say the value is 'sub_nr' and then get the value of the tag of it's sibbling. So I have allready refined my brute force attack in doing something like this : first : then the bit. then : then : for instance to get to the invoice-number (inv_nr) this seams to work, but there should be a cleaner way. By matching the value of NAME to 'inv_nr' or something. Anyway, any help is greatly appreaciated. Link to comment Share on other sites More sharing options...
comment Posted June 22, 2010 Share Posted June 22, 2010 If you are in the context of: then: should fetch the desired value. However, that would make each ROWADDRQ a record, I think. Link to comment Share on other sites More sharing options...
Joost Miltenburg Posted June 22, 2010 Author Share Posted June 22, 2010 You are right that would make a record. but thnx : works, but could you explain why ? I am not quite getting the '"FIELD[NAME='sub_nr']' part. This is a way to get to a child without actually going to the child node ? Link to comment Share on other sites More sharing options...
comment Posted June 22, 2010 Share Posted June 22, 2010 "FIELD[NAME='sub_nr']" selects the first FIELD that has a child NAME whose value is 'sub_nr'. You could also do: but I think it's less elegant. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 5059 days old. Please don't post here. Open a new topic instead.
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