caseyamcl / phpoaipmh

OAI-PMH client/harvester library for PHP
MIT License
75 stars 35 forks source link

Support alternative XML parsers besides `SimpleXMLElement` #44

Open caseyamcl opened 7 years ago

caseyamcl commented 7 years ago

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.

caseyamcl commented 6 years ago

Since we are going to model the PHP OAI-PMH responses in v4, we'll push this to v4.

rudolfbyker commented 4 years ago

Would be great to have an iterator returning XML strings instead of SimpleXMLElements.

mr-infinity commented 3 years ago

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?

tacman commented 1 year ago

FWIW, I've found the sabre xml parser to be easy to work with: https://sabre.io/xml/

jonasraoni commented 1 year ago

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.