I have searched high and low and I can't find a straight answer to my situation. I have the following XML:
<Tims xmlns="http://my.url.com/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://my.url.com/namespace http://my.url.com/xsd/Tims.xsd">
<Database xlink:href="http://my.url.com/xml/performance/database.svc">
<ProjectID xlink:href="http://my.url.com/xml/Tvq11p/project.svc" title="Title1">Tvq11p</ProjectID>
<ProjectID xlink:href="http://my.url.com/xml/Tvq10p/project.svc" title="Title2">Tvq10p</ProjectID>
<ProjectID xlink:href="http://my.url.com/xml/Tvq8p/project.svc" title="Title3">Tvq8p</ProjectID>
<ProjectID xlink:href="http://my.url.com/xml/Tvq9p/project.svc" title="Title4">Tvq9p</ProjectID>
<ProjectID xlink:href="http://my.url.com/xml/Tvq5p/project.svc" title="Title5">Tvq5p</ProjectID>
<ProjectID xlink:href="http://my.url.com/xml/Tvq15p/project.svc" title="Title6">Tvq15p</ProjectID>
<ProjectID xlink:href="http://my.url.com/xml/Tvq2p/project.svc" title="Title7>Tvq2p</ProjectID>
<ProjectID xlink:href="http://my.url.com/xml/Tvq3p/project.svc" title="Title8">Tvq3p</ProjectID>
<ProjectID xlink:href="http://my.url.com/xml/Tvq12p/project.svc" title="Title9">Tvq12p</ProjectID>
<ProjectID xlink:href="http://my.url.com/xml/Tvq13p/project.svc" title="Title10">Tvq13p</ProjectID>
<ProjectID xlink:href="http://my.url.com/xml/Tvq14p/project.svc" title="Title11">Tvq14p</ProjectID>
<ProjectID xlink:href="http://my.url.com/xml/Tvq1p/project.svc" title="Title12">Tvq1p</ProjectID>
<ProjectID xlink:href="http://my.url.com/xml/Tvq4p/project.svc" title="Title13">Tvq4p</ProjectID>
<ProjectID xlink:href="http://my.url.com/xml/Tvq6p/project.svc" title="Title14">Tvq6p</ProjectID>
<ProjectID xlink:href="http://my.url.com/xml/Tvq7p/project.svc" title="Title15">Tvq7p</ProjectID>
</Database>
<Timestamp>2012-08-03T09:47:06-04:00</Timestamp>
<ExecutionTime>0.01</ExecutionTime>
</Tims>
All I want to do is extract each ProjectID node's attributes and value..
I've tried DOM, SimpleXML, and XMLParser. This is all in PHP, however, I am actually open to alternative languages as long as they can be executed from a Unix command line.
Thanks!
UPDATE What I've tried: I've mostly deleted my attempts as I try and fail. My latest iteration is this:
$return = send_request($requestUri, TIMS_REQUEST_TIMEOUT); // returns SimpleXMLElement
$return->registerXPathNamespace('e', 'http://www.webex.com/schemas/2002/06/service/event');
foreach($return->xpath('//ProjectID') as $project) {
$project->registerXPathNamespace('xlink', 'http://www.w3.org/1999/xlink');
print_r($project);
}
My print_r never fires.
Timselement should be self-closing as well.title7is missing a close quote. If that wasn't from a bad copy/paste, that's likely your problem.