RESTful knowledge exchange
Post Reply
sirinech
Influencer
Posts: 23
Liked: 1 time
Joined: Mar 21, 2014 3:06 pm
Full Name: sirine chadly
Contact:

parse data from xml response

Post by sirinech »

Hello I would like to know how to get the info from an xml file when the tag contains more than one attribute like in this case: I send request to get backupSessions I get xml file with a lot of ref tags , how to select one ref and its link tags based on the name attribute in the ref tag:

<Ref Href="http://172.19.11.128:9399/api/backupSes ... f018ed5c3d" Type="BackupJobSessionReference" UID="urn:veeam:BackupJobSession:6fe627e2-59ad-4602-bd0c-2af018ed5c3d" Name="Backup Job 1@2014-04-10 12:11:04">

<Links>.....</Links>
</Ref>
hatari
Novice
Posts: 9
Liked: 3 times
Joined: Jun 18, 2013 10:06 am
Full Name: Alexey Rostovskiy
Contact:

Re: parse data from xml response

Post by hatari » 2 people like this post

Hello

Actually it depends on what you using are to parse data.
But typically you should choose node (first, last, all of them) and get attribute you need (Name, Href, UID, etc).
sirinech
Influencer
Posts: 23
Liked: 1 time
Joined: Mar 21, 2014 3:06 pm
Full Name: sirine chadly
Contact:

Re: parse data from xml response

Post by sirinech »

any example with php?
hatari
Novice
Posts: 9
Liked: 3 times
Joined: Jun 18, 2013 10:06 am
Full Name: Alexey Rostovskiy
Contact:

Re: parse data from xml response

Post by hatari »

hatari
Novice
Posts: 9
Liked: 3 times
Joined: Jun 18, 2013 10:06 am
Full Name: Alexey Rostovskiy
Contact:

Re: parse data from xml response

Post by hatari »

Sirine, you can also check examples with php in “(EM install dir)\samples" folder: there are 6 typical action like StartJob, AddVmToJob, etc, plus generated php classes from xsd.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests