LibreCat / Catmandu

Catmandu - a data processing toolkit
https://librecat.org
177 stars 31 forks source link

Catmandu::SRU corrupts XML data - choose another mapping of XML #33

Closed nichtich closed 10 years ago

nichtich commented 11 years ago

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 from XML::LibXML::Simple but XML::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.

nichtich commented 11 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.

phochste commented 10 years ago

Should be fixed now in Catmandu::SRU 0.032