https://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2021-05-22T22:53:06ZSaxonica Developer CommunitySaxon - Bug #4996: Namespace information missing from default XML Schema attribute added by validating XMLReaderhttps://saxonica.plan.io/issues/4996?journal_id=179792021-05-22T22:53:06ZMichael Kaymike@saxonica.com
<ul></ul><p>Xerces is passing to the SAX ContentHandler interface a startElement event containing an attribute with local-name test, raw-name test, and URI <a href="http://com.deltaxml.test/namespace" class="external">http://com.deltaxml.test/namespace</a>. There has been no startPrefixMapping call for this namespace.</p>
<p>This event clearly does not represent a valid XDM instance: it is not permissible in XDM for an attribute to have a namespace URI but no prefix, or for a namespace URI used in an attribute or element name to have not been declared using a startPrefixMapping() call.</p>
<p>Xerces is getting this wrong; the question is what Saxon should do about it.</p>
<p>If the Saxon schema validator is used in place of Xerces, the schema validator allocates a prefix and declares it, passing a valid XDM representation across to the transformer.</p>
<p>I guess that in earlier releases Saxon repaired the event stream by inserting a NamespaceReducer, which essentially performs the task of namespace fixup. The way in which namespace fixup is done has changed in 10.0, to reduce the amount of unnecessary and duplicated checking that goes on.</p> Saxon - Bug #4996: Namespace information missing from default XML Schema attribute added by validating XMLReaderhttps://saxonica.plan.io/issues/4996?journal_id=179812021-05-22T22:58:10ZMichael Kaymike@saxonica.com
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-3 priority-1 priority-lowest closed" href="/issues/4338">Bug #4338</a>: Prefixes for default attribute coming from associated XML Schema are no longer output in the output root element</i> added</li></ul> Saxon - Bug #4996: Namespace information missing from default XML Schema attribute added by validating XMLReaderhttps://saxonica.plan.io/issues/4996?journal_id=179822021-05-24T10:31:10ZMichael Kaymike@saxonica.com
<ul><li><strong>Category</strong> set to <i>JAXP Java API</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> set to <i>Michael Kay</i></li><li><strong>Priority</strong> changed from <i>Low</i> to <i>Normal</i></li><li><strong>Applies to branch</strong> <i>trunk</i> added</li><li><strong>Fix Committed on Branch</strong> <i>10, trunk</i> added</li></ul><p>I have added code to <code>ReceivingContentHandler.makeAttributeMap()</code> to detect and repair this situation: if a defaulted attribute (<code>isSpecified()==false</code>) is included in the startElement call having a namespace URI but no prefix, we invent and declare a prefix and change the attribute name.</p>
<p>Unit tests added to <code>s9apitest/TestXMLParserOptions</code>.</p> Saxon - Bug #4996: Namespace information missing from default XML Schema attribute added by validating XMLReaderhttps://saxonica.plan.io/issues/4996?journal_id=184402021-09-15T11:30:03ZNorm Tovey-Walsh
<ul></ul><p>Added a fix to make sure that the code doesn't attempt to generate a prefix for the empty namespace.</p> Saxon - Bug #4996: Namespace information missing from default XML Schema attribute added by validating XMLReaderhttps://saxonica.plan.io/issues/4996?journal_id=184752021-09-16T13:59:50ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Fixed in Maintenance Release</strong> <i>10.6</i> added</li></ul><p>Bug fix applied in the Saxon 10.6 maintenance release</p>