我正在尝试解析来自webservice的响应 - 响应似乎是有效的XML,但是,我只能解析属性,并且某些对象没有文本值的表示 - 这是一个例子:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<Product xmlns="http://com.etilize.spexlive" productId="1010043679">
<category parId="135" name="Transparent & Invisible Tapes" id="1009"/>
<descriptions>
<description type="1">Sparco Invisible Tape - 0.75" Width x 1000" Length - 1" Core - Premium Acetate - Writable Surface - 12 / Pack - Clear
</description>
<description type="2">Sparco Invisible Tape</description>
<description type="3">0.75" Width x 1000" Length - 1" Core - Premium Acetate - Writable Surface - 12 / Pack - Clear</description>
</descriptions>
</Product>
</soap:Body>
</soap:Envelope>
我可以获得categoryId,Name和parId就好了,但Text值似乎不存在 - 下面是我在soap对象上执行var_dump时看到的内容 - 请注意说明:
stdClass Object
(
[category] => stdClass Object
(
[id] => 1009
[name] => Transparent & Invisible Tapes
[parId] => 135
)
[descriptions] => stdClass Object
(
[description] => Array
(
[0] => stdClass Object
(
[type] => 1
)
[1] => stdClass Object
(
[type] => 2
)
[2] => stdClass Object
(
[type] => 3
)
)
)
在这方面的任何帮助将不胜感激
由于