-
Bug
-
Resolution: Done
-
Major
-
2.8.3.Final, 3.1.1.Final
-
None
When importing a XML file (using the Session.importXML() method) that declares a default namespace (xmlns="URI"), you get the following error:
javax.jcr.RepositoryException: Prefix is already permanently mapped
This makes sense since JCR always creates a JCR namespace identified by the empty prefix. And according to the JCR specs:
For each XML namespace declaration with prefix P and URI U:
a. If the namespace registry already contains a mapping of some prefix P' to U (where P' may or may not be equal to P) then the namespace registry is left unchanged."
The code should discover that the default namespace does not match a registered namespace and it should therefore register it and use this for the XML default namespace rather than throw the exception.