Hi Stuart

Thanks for the update.

I ended up using SimpleXmlElement to retrieve the url then tokenized the 
url to obtain the id.

         // get the actual id from the response id.
         if (isset($response->sac_id)) {
             $xml = new SimpleXMLElement($response->sac_id->saveXML());
             $array = $xml->xpath('/id');

             $idUrl = '';
             foreach($array as $node) {
                 $idUrl = $node;
             }

             $parts = explode('/', $idUrl);
             $pos = count($parts) - 1;
             $id = $parts[$pos];
         }

$response is an instance of SwordAppEntry.

I noticed that the response->sac_id is an SimpleXmlElement object but 
for some reason xpath would not retrieve anything.

I found passing the sac_id output to a new SimpleXMLElement fixed the 
problem. Not sure why.

Cheers


Hayden

On 17/04/12 18:09, LEWIS Stuart wrote:
> Hi Hayden,
>
> Unfortunately not - from a SWORD point of view, this is just a URL.  The 
> SWORD specification does not describe how URLs should encode item 
> identifiers, so this is an implementation choice for the repository.  
> Therefore the client library can't know how to extract the ID.
>
> Thanks,
>
>
> Stuart
>
>
>

-- 
Hayden Young
Managing Director
Wijiti Pty Ltd
p. +61 (0) 08 6398 5010
e. haydenyo...@wijiti.com
w. www.wijiti.com
vcard. www.wijiti.com/vcard/haydenyoung.vcf

NOTICE
This e-mail and any attachments are intended for the addressee(s) only and may 
be confidential. They may contain legally privileged or copyright material. You 
should not read, copy, use or disclose them without authorization. If you are 
not the intended recipient please contact the sender as soon as possible by 
return e-mail and then please delete both messages. This notice should not be 
removed.


------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
sword-app-tech mailing list
sword-app-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sword-app-tech

Reply via email to