I have an xml string (which I am fetching from a CSV) here from which I need to identify the values and names from it. The logic I thought is to extract all strings which are in between of >
and </
for values and then remove the extracted substring which contains <
or >
I am yet to think on how I can extract parameter name as well. I am using python.
Below is the xml string that I read from csv file.
<ServiceInstanceUpdateAck xmlns='http://www.loremipsum.com/'>
<Context>
<Attribute name='Atri1'>A1</Attribute>
<Attribute name='Atri2'>A2</Attribute>
<Attribute name='Atri3'>A3</Attribute>
</Context>
<Operation>DEPROVISION</Operation>
<Status>SUCCESS</Status>
<Error message='No Error' majorErrorCode='E_NONE' minorErrorCode='E_NONE'/>
<Service>
<Id>11233334</Id>
</Service>
</ServiceInstanceUpdateAck>
Any help is appreciated.
Note: This is not a whole xml. It is a post body data that I am fetching from a CSV file. It is a string basically when I fetch it. So I cannot use XML parser here.