ropensci / oai

OAI-PMH R client
https://docs.ropensci.org/oai
Other
14 stars 4 forks source link

xpath or children #11

Closed mbojan closed 5 years ago

mbojan commented 8 years ago

Is there a reason why while_oai and other functions use nested xml_children calls to extract various elements from the result (like resumptionToken, errors, etc.)? I think the OAI-PMH specification does not specify the order of the tags so different services might return these in different order. Using XPath seems simpler.

One trouble with XPath is handling namespaces. This might be dodged with local-name() like here http://stackoverflow.com/questions/16717211/getting-elements-with-default-namespace-no-namespace-prefix-using-xpath

sckott commented 8 years ago

@mbojan no reason. plz do go with xpath, looks like you already are doing that in your branch

mbojan commented 8 years ago

I think this can be closed. I used xpath in new code, but perhaps it does not make sense to modify existing code that uses xml_children if it works...

sckott commented 8 years ago

I'll at least try with other fxns