Closed nichtich closed 10 years ago
At the weekend I created XML::Struct that supports both, XML as key-value structures (like XML::Simple) and ordered XML. I am not sure about whether to also release Catmandu::XML or make it part of the Core Catmandu distribution.
Should be fixed now in Catmandu::SRU 0.032
Catmandu::SRU is not usable for data such as MARCXML and PICAXML because it corrupts the order of XML elements. The module should not use
XMLIn
fromXML::LibXML::Simple
butXML::LibXML::Reader
and emit a different object format for mapping XML.Mapping XML to record structures with irreversible order is common and useful for specific formats. See this summary for most common mapping rules. Whether this mapping as done by XML::Simple is suitable, however, depends on the data format.
I'd choose a format as sketched here. Catmandu::SRU should neither parse XML but only unpack the SRU response and direct XML records to a Catmandu::Importer::XML.