Project

Profile

Help

Bug #4996

closed

Namespace information missing from default XML Schema attribute added by validating XMLReader

Added by Philip Fearon almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
JAXP Java API
Sprint/Milestone:
-
Start date:
2021-05-20
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
10, trunk
Fix Committed on Branch:
10, trunk
Fixed in Maintenance Release:
Platforms:

Description

This issue is present in Saxon 10.5 but not in Saxon 9.8 or Saxon 9.9. It appears to be related to issue 4993

This case (source code/schema etc. attached in zip file) uses Java 1.8 with the default built-in Apache Xerces parser. The parser is configured to perform XML Schema validation. The notable feature of the XML Schema is that, for the 'html' element, it declares a default attribute in a specified namespace.

The result of an identity transform on the XML input using Saxon 10.5:

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="mini-xhtml-default-att.xsd"
      test="yes">
   <head>
      <title>hello world</title>
   </head>
</html>

Note that in the result shown above the test attribute is in the 'null' namespace. With Saxon 9.8 we get the test attribute output correctly with the given namespace. Saxon supplies an arbitrary prefix _2 for the prefix/namespace-uri binding for this test attribute. The result from Saxon 9.8 is shown below:

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:_2="http://com.deltaxml.test/namespace"
      xsi:noNamespaceSchemaLocation="mini-xhtml-default-att.xsd"
      _2:test="yes">
   <head>
      <title>hello world</title>
   </head>
</html>

Files

Saxon10Test.zip (8.08 KB) Saxon10Test.zip Philip Fearon, 2021-05-20 11:19

Related issues

Related to Saxon - Bug #4338: Prefixes for default attribute coming from associated XML Schema are no longer output in the output root elementClosedMichael Kay2019-10-11

Actions

Please register to edit this issue

Also available in: Atom PDF