load invalid xml
Sunday, 22 July 2018 · 3 messages · last reply 23 Jul 2018
ВВ
Ветошкин Владимир22 Jul 2018 09:44 #
Hi, everybody!
Is there any way to load invalid xml file to database?
I have attached an example of such a file.
--
С уважением,
Ветошкин Владимир Владимирович
CG
Christian Grün23 Jul 2018 10:49 #
Hi Vladimir (cc to the list),
Quoted text · Ветошкин Владимир · 5 lines
> That's what I thought. > I can't fix origin xml-files, because they come from external system. > And sometimes they're invalid. > About the file, that I have attached in the previous letter - there is a duplication of namespace in that file. > Maybe it is possible to ignore namespaces?
Sorry, I can just repeat what I’ve written in my last mail. XML parsers rely on well-formed input. Everything else would be a hack. And there are just too many possible error cases that would need to be considered by such “tweaks”.
Could you please tell me more about the external system?
Quoted text · Ветошкин Владимир · 1 line
> PS: I have to store data with querying it.
Did you then try to store the documents as raw data, as described in our docs?
Quoted text · Ветошкин Владимир · 27 lines
> 22.07.2018, 18:48, "Christian Grün" <christian.gruen at gmail.com>: > > One nice property of XML is that documents must be well-formed (i.e., syntactically valid) in order to be processed. If a document is not valid, there may be more than one way to interpret is contents – and this can get dangerous. > > If you have invalid XML, you should go back to the origins and find out what went wrong in the very beginning. > > If you only want to store data without querying it, you can store a document as binary (raw) data. Feel free to check out our documentation to find more details. > > > Ветошкин Владимир <en-trance at yandex.ru> schrieb am So., 22. Juli 2018, 09:44: > > Hi, everybody! > > Is there any way to load invalid xml file to database? > I have attached an example of such a file. > > -- > С уважением, > Ветошкин Владимир Владимирович > > > > > -- > С уважением, > Ветошкин Владимир Владимирович >
ВВ
Ветошкин Владимир23 Jul 2018 11:01 #
Quoted text · Christian Grün · 1 line
>> Could you please tell me more about the external system?
It is the customs. Maybe I'll try to fix malformed xml in PHP before importing, if there will be such a task.
Quoted text · Christian Grün · 1 line
>> Did you then try to store the documents as raw data, as described in our docs?
No. I move such files to the error folder.
Quoted text · Christian Grün · 52 lines
23.07.2018, 11:50, "Christian Grün" <christian.gruen at gmail.com>: > Hi Vladimir (cc to the list), > > > > That's what I thought. > > I can't fix origin xml-files, because they come from external system. > > And sometimes they're invalid. > > About the file, that I have attached in the previous letter - there is a duplication of namespace in that file. > > Maybe it is possible to ignore namespaces? > > Sorry, I can just repeat what I’ve written in my last mail. XML > parsers rely on well-formed input. Everything else would be a hack. > And there are just too many possible error cases that would need to be > considered by such “tweaks”. > > Could you please tell me more about the external system? > > > > PS: I have to store data with querying it. > > Did you then try to store the documents as raw data, as described in our docs? > > > > > > 22.07.2018, 18:48, "Christian Grün" <christian.gruen at gmail.com>: > > > > One nice property of XML is that documents must be well-formed (i.e., syntactically valid) in order to be processed. If a document is not valid, there may be more than one way to interpret is contents – and this can get dangerous. > > > > If you have invalid XML, you should go back to the origins and find out what went wrong in the very beginning. > > > > If you only want to store data without querying it, you can store a document as binary (raw) data. Feel free to check out our documentation to find more details. > > > > > > Ветошкин Владимир <en-trance at yandex.ru> schrieb am So., 22. Juli 2018, 09:44: > > > > Hi, everybody! > > > > Is there any way to load invalid xml file to database? > > I have attached an example of such a file. > > > > -- > > С уважением, > > Ветошкин Владимир Владимирович > > > > > > > > > > -- > > С уважением, > > Ветошкин Владимир Владимирович > >
--
С уважением,
Ветошкин Владимир Владимирович
Written for BaseX 9.0. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery