Project

Profile

Help

Bug #3889

closed

No-namespace element copied without required xmlns="" declaration

Added by Frank Steimke over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT conformance
Sprint/Milestone:
-
Start date:
2018-08-31
Due date:
% Done:

100%

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

Description

FINAL RESOLUTION

When an element node is copied from a TinyTree, and the element is in a namespace but has a descendant that is in no namespace, and the node is copied to another tree where a default namespace is in scope, then no namespace undeclaration is added to the target tree and the no-namespace element therefore ends up incorrectly being in the default namespace of the target tree.

ORIGINAL REPORT

Hi, an xslt script pricuces a document which is invalid. This is not detected, although the template states validation='strict'. Pleas see attached files.

I have a schema a.xsd for targetNamespace a with elementFormDefault="unqualified". It defines a global type with a header element.

b.xsd is imported in an schema b.xsd with targetNamespace b.xsd. There is a global b:request element defined. Valid instance is a b:request element with header as a child element from the schema a. header is in no namespace.

There is another schema c.xsd in the c namespace which imports b.xsd. It has a global element form which may have an optional b:request child element. A valid instance is a form element with c as default namespace. `<form xmlns="test.com/c" DATA

`

There is a simple xstl script which takes a c:form Element and adds a valid b:request element. The result should b a valid c:form element. However, when i accidentialy ust xsl:sequence instead of xsl:copy-of, the result is an invalid document, because the header element is in the default namespace c

Bug report: the transformation script says validation=strict, so that this error should be detected. But it is not detected. Script runs without any problems, but the result is indeed invalid.

This Happens with Saxon EE 9.8.0.12 within Oxygen 20.1

Sincelery, Frank Steimke


Files

obug.zip (4.76 KB) obug.zip Frank Steimke, 2018-08-31 08:06

Please register to edit this issue

Also available in: Atom PDF