Extra NS declaration added by transformer
<a xmlns='someNS' name='test'><b xmlns=''/></a>
is transformed into
<a xmlns='someNS' name='test'><b xmlns='' xmlns=''/></a>
which is not valid
org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 24; Attribute "xmlns" was already specified for element "b".
see test case attached. That works fine with 9.9 (HE, EE)
java -cp saxon9he.jar;. testSaxonTransformer
but fails with 10.0-10.3 (HE, EE) also tried with EE 10.4
java -cp saxon-he-10.3.jar;. testSaxonTransformer
but the transformed is correct when I add another NS. Like:
<a xmlns='someNS' xmlns:z='z' name='test'><b xmlns=''/></a>
#2 Updated by Michael Kay 3 months ago
The error appears to be when combining two namespace maps (
NamespaceMap.applyDifferences() -- which is not actually DOM-specific code, though it's probably used rather differently when handling DOM input.). This ends up incorrectly generating an empty namespace map for element b, rather than a map containing the single namespace binding (""=""). This error is then compounded: because the namespace map is empty, the scan of attributes on element b doesn't check whether any of the attributes are actually namespaces, so it's processing xmlns:"" a second time as if it were an ordinary attribute.
#4 Updated by Michael Kay 3 months ago
- Status changed from In Progress to Resolved
- Fix Committed on Branch 10, trunk added
It was working on the 11.x branch because my configuration settings meant I was picking up Xalan as the DOM identityTransformer. Fixed this, found the bug was still present, so I've applied the patch to both branches.
Please register to edit this issue