code4lib / ruby-oai

a Ruby library for building OAI-PMH clients and servers
MIT License
62 stars 43 forks source link

Get Raw XML from Record (?) #41

Closed no-reply closed 9 years ago

no-reply commented 9 years ago

I am running ListRecords requests via the client and need to store the xml of the individual <record>s. Record stores the contents of the header, metadata, and about tags separately, which means that I have to rebuild the record from its parts.

Is there a better way I should be doing this? Should OAI::Record store the raw XML and build its parts on the fly?

dmolesUC commented 9 years ago

I haven't tried, but looking at ListRecordsResponse it seems like you ought to be able to get at the raw OAI response via the @doc attribute and make the same kind of XPath query as the each method to bypass Record and get directly at the <record>s.