Open w1th0utnam3 opened 1 year ago
Thank you for this issue! Indeed officially the XML format doesn't support binary data, and this is actually what is blocking the 0.7 release currently. The plan is to upstream a feature into quick-xml
that allows one to implement a custom parser for the text in XML files. The example file you provided should be very helpful in addressing testing binary support.
Ah right. I missed that in the version 0.7 PR. I guess this is related to this quick-xml
PR then: https://github.com/tafia/quick-xml/pull/555
Hope the sample file helps!
Yes exactly! Thanks for linking that issue.
Has https://github.com/tafia/quick-xml/pull/783 managed to resolve blockers on the new release? Or is there more work required to support <AppendedData encoding="raw">
-containing vtk files?
Sadly not yet, because we use the serde API for dealing with XML files here, we also need to extend the serde API to support binary blobs in quick-xml. I started a PR here but don't have much time to finish it. Any help is appreciated of course! I am happy to help any efforts there.
That's unfortunate. I haven't got loads of time but I am willing to try, if I can be pointed in the right direction for what's needed to finish it. Is it a case of fixing the failing tests or is there more to it?
The attached file
fluid_1_91.vtu
cannot be loaded using v0.6.0 or therelease-0.7
branch and results in the errors:while Paraview is able to load the file.
The file uses a
<AppendedData encoding="raw">...</AppendedData>
raw binary block for all the data arrays and I suspect it happens to contain characters or sequences that confuse the XML parser.The file
fluid_1_91_encoded.vtu
can be read without problems after opening the original file in Paraview and re-exporting it to VTU with the option "Encode appended data" which I guess applies base64 encoding.I don't know if it is possible to somehow use different options for the XML parser to support the raw binary block or whether this is actually not allowed by the XML format and would require manual parsing.
fluid_1_91.zip