Make namespace check for decode-xml optional
https://metafacture.org/playground/?flux=inputFile%0A%7C+open-file%0A%7Cdecode-xml%0A%7Chandle-generic-xml%0A%7Cencode-yaml%0A%7Cprint%0A%3B&data=%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Crecord%3E%0A++++%3Cmets%3Afield%3Ea%3C/mets%3Afield%3E%0A++++%3Cfield%3Eb%3C/field%3E%0A%3C/record%3E
When reading a xml with namespaces but no corresponding namespace definition MF breaks. This should be optional.
Why do you think this is a bug? The problem relies in the using of a namespace without defining one. I.e. the error lies in the input data.
Why do you think this is a bug? The problem relies in the using of a namespace without defining one. I.e. the error lies in the input data.
You are right, but you cannot handle this data at all with MF. I would not say this is a bug, but to make this optional would be a feature. This would be similar to the option ignoreId from handle-marcxml
There is always a way - until it isn't. Could you not filter the whole input first (treat it as a string) and use a regex that would remove the erroneous namespace?
This is a way: https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cmatch%28pattern%3D%22mets%3A%22%2C+replacement%3D%22%22%29%0A%7Cread-string%0A%7Cdecode-xml%0A%7Chandle-generic-xml%0A%7Cencode-yaml%0A%7Cprint%0A%3B&data=%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3Crecord%3E%0A++++%3Cmets%3Afield%3Ea%3C/mets%3Afield%3E%0A++++%3Cfield%3Eb%3C/field%3E%0A%3C/record%3E
Won't fix . Use workaround like shown in https://github.com/metafacture/metafacture-core/issues/545#issuecomment-2310083714.