Open caseyamcl opened 7 years ago
Since we are going to model the PHP OAI-PMH responses in v4, we'll push this to v4.
Would be great to have an iterator returning XML strings instead of SimpleXMLElement
s.
I have also a similair question. We are importing an RDF formatted and the $xml is not returning the full metadata. How can we solve this problem?
FWIW, I've found the sabre xml parser to be easy to work with: https://sabre.io/xml/
Just sharing one problem that I had, which is somehow related to this issue, at this point: https://github.com/caseyamcl/phpoaipmh/blob/89b38d8c0564b10b12c65c07634cc8faca07100c/src/RecordIterator.php#L198
A single node is being cloned and retrieved, but the whole XML context is kept alive/carried on. Therefore, a generic XPath
query such as //dc:date
will bring nodes from all records.
There are other ways of parsing XML responses from service providers. Make the response item handler optional (use raw output), or allow specifying a callback / handler interface to handle each record.