You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But this only gets the current element namespace which is prov, because it's in the <prov:entity> element.
Therefore, prov is registered as default namespace and the identfier of entity corresponds to IRI http://www.w3.org/ns/prov#/e.
However it should be https://default.org/e.
So, I think a better solution would be to use the following:
xmlParser.getStaxReader().getNamespaceURI("");
The statement above returns the default namespace. The correct namespace is registered as a default instead of the prov namespace being registered as default one.
The text was updated successfully, but these errors were encountered:
mf-16
changed the title
Issue when deserializing XML with defualt namespace in ProvToolbox
Issue when deserializing XML with default namespace in ProvToolbox
Feb 25, 2024
I found an issue in the newest version of ProvToolbox, 2.0.4, when handling the default namespace in XML.
Let me demonstrate the issue with this XML file:
When deserializing the identifier using the CustomQualifiedNameDeserializer#deserialize() method, it uses the DeserializerUtil#getAttributeValue() method.
On line 46 in DeserializerUtil#getAttributeValue() , when the identfier does not have a prefix, you used following:
xmlParser.getStaxReader().getNamespaceURI();
But this only gets the current element namespace which is prov, because it's in the
<prov:entity>
element.Therefore, prov is registered as default namespace and the identfier of entity corresponds to IRI
http://www.w3.org/ns/prov#/e
.However it should be
https://default.org/e
.So, I think a better solution would be to use the following:
xmlParser.getStaxReader().getNamespaceURI("");
The statement above returns the default namespace. The correct namespace is registered as a default instead of the prov namespace being registered as default one.
The text was updated successfully, but these errors were encountered: