Closed StefanOltmann closed 1 year ago
This was a nasty one. When writing attributes from events this would drop the prefix (but not the namespace). Combine that with a dom implementation that doesn't add the applicable prefix it breaks stuff. I've fixed it.
@pdvrieze Thank you for promptly investigating this issue. I truly appreciate your efforts. :)
I'm eager to try the fix, but it seems that the publish task was unsuccessful.
@StefanOltmann It should now be fixed. Gets me for not running the full test suite first. The fixes exposed a but in the serialization code for attributes.
Thank you! :) It's fixed and works for JVM. I will now check the other platforms.
@pdvrieze It looks like that there is a very similar problem for the native/macOS implementation.
My code complains that about=""
has no namespace.
I've looked at things further. While that error is not in the system I found various edge cases with attribute handling. It will now correctly force a prefix for a qualified attribute (attributes without prefix always map to the null namespace). This pushed a lot of edge cases in the code (most people don't seem to use this stuff, or don't file bugs).
Thank you for investigating this. Personally I ignored things like that before, too. In my case itβs Adobes XMP Core library that seems to be quite strict about the input and requires namespaces and prefixes for everything.
Do you know when time is due for a new stable release?
I checked the current 0.86.1-SNAPSOT and on my side it looks all good now. π
If you could publish a new stable version to Maven Central I would like to depend on that with my new lib. :)
The release should be on its way
@pdvrieze Thank you so much! I conducted extensive tests on multiple XMP files in my test set across various platforms, and I'm happy to report that I didn't encounter any issues.
As a result, I have integrated your library into the recently released https://github.com/Ashampoo/xmpcore, which is now an integral part of my company's photo organization app, Ashampoo Photos.
I am truly grateful for your prompt fixes, as they enabled me to deliver this feature on schedule. π
I try to figure out why the code I have at hand stops working if I switch from
org.xml.sax
to XmlUtils.This is the code that is used to create the Document using SAX:
This is the code that is used to create the Document using XmlUtils:
Everything else is identical by now.
So I figured that the differences must be in the produced Document.
I found this helpful code to write DOM Document back to a String representation:
This is the original: original_xmp.txt This is produced by the SAX parser: sample_1_sax.txt This is produced by XmlUtils: sample_1_xmlutil.txt
Between the original and the SAX version double quotes changed to single quotes and a additional header was added. Everything else is identical.
But in the XmlUtils version namespaces to attributes are lost.
In this sample
rdf:about
changed toabout
,rdf:parseType
toparseType
andxml:lang
changed tolang
.Is this a bug or intentional? Can this be configured?