xPath finds nothing but *

keeriAppess

New Member
This is starting to piss me off real bad. I have this XML code: Updated with correct namespaces\[code\]<?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>\[/code\]And this PHP code:\[code\]<?php $data = http://stackoverflow.com/questions/3719616/urldecode($_POST["xml"]); $newXML = simplexml_load_string($data); var_dump($newXML->xpath("//ID"));?>\[/code\]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
 
Back
Top