Answer the question
In order to leave comments, you need to log in
How to make a soap xml parser?
There is an xml file with sample content
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/>
<soap:Body>
<m:GetGroupResponse xmlns:m="http://www.test.ru">
<m:return xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Schedule>
<Name Name="fret">
<Groups>
<Group>
<Id>0</Id>
<Name>Name 1</Name>
<Code>C1</Code>
</Group>
<Group>
<Id>1</Id>
<Name>Name 2</Name>
<Code>C2</Code>
</Group>
</Groups>
</Name>
</Schedule>
<Schedule>
<Name Name="fret">
<Groups>
<Group>
<Id>0</Id>
<Name>Name 1</Name>
<Code>C1</Code>
</Group>
<Group>
<Id>1</Id>
<Name>Name 2</Name>
<Code>C2</Code>
</Group>
</Groups>
</Name>
</Schedule>
</m:return>
</m:GetGroupResponse>
</soap:Body>
</soap:Envelope>
Answer the question
In order to leave comments, you need to log in
1. you need to register namespaces. in this case, m and soap
php.net/manual/ru/simplexmlelement.registerxpathna...
2. if this is not required by the specification, you can omit intermediate elements with namespaces using xpath search - just by finding all occurrences of Group.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question