Closed atomotic closed 12 years ago
i founded a solution for default namespaces reading: http://libxml.rubyforge.org/rdoc/classes/LibXML/XML/XPath.html
i added this two methods to my subclassed OAI::IdentifyResponse
def repositoryIdentifier
return doc.find('.//oai:repositoryIdentifier', "oai:http://www.openarchives.org/OAI/2.0/oai-identifier").first.content
end
def sampleIdentifier
return doc.find('.//oai:sampleIdentifier', "oai:http://www.openarchives.org/OAI/2.0/oai-identifier").first.content
end
i would subclass OAI::IdentifyResponse and add a new attr
@sampleIdentifier = xpath(doc, '..//sampleIdentifier')
to read sampleIdentifier from description, like:
this works only with REXML but no with libxml, i guess due to namespaces. hints to solve this?