This is starting to piss me off real bad. I have this XML code:
Updated with correct namespaces
<?xml version="1.0" encoding="utf-8"?>
<Infringement xsi:schemaLocation="http://www.movielabs.com/ACNS http://www.movielabs.com/ACNS/ACNS2v1.xsd" xmlns="http://www.movielabs.com/ACNS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Case>
<ID>...</ID>
<Status>Open</Status>
</Case>
<Complainant>
<Entity>...</Entity>
<Contact>...</Contact>
<Address>...</Address>
<Phone>...</Phone>
<Email>...</Email>
</Complainant>
<Service_Provider>
<Entity>...</Entity>
<Address></Address>
<Email>...</Email>
</Service_Provider>
<Source>
<TimeStamp>...</TimeStamp>
<IP_Address>...</IP_Address>
<Port>...</Port>
<DNS_Name></DNS_Name>
<Type>...</Type>
<UserName></UserName>
<Number_Files>1</Number_Files>
<Deja_Vu>No</Deja_Vu>
</Source>
<Content>
<Item>
<TimeStamp>...</TimeStamp>
<Title>...</Title>
<FileName>...</FileName>
<FileSize>...</FileSize>
<URL></URL>
</Item>
</Content>
</Infringement>
And this PHP code:
<?php
$data = urldecode($_POST["xml"]);
$newXML = simplexml_load_string($data);
var_dump($newXML->xpath("//ID"));
?>
I've dumped only $newXML and gotten tons of data, but the only xPath I've run that returned anything but an empty array was "*"
Isn't "//ID" supposed to find all ID nodes in the document? Why isn't it working?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…