[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Excluding Namespaces from the Result Tree

Subject: Re: [xsl] Excluding Namespaces from the Result Tree
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Jun 2015 11:19:57 -0000

> I do understand that for XSLT element or attribute values are just plain
> values/strings although they might be qualified names. Would a
> schema-aware processor solve this problem? I have never used one

Turns out that schema-awareness doesnt really help much here, apart from
giving better diagnostics when things are wrong.

Firstly, not all elements/attributes that have prefixes-in-content are marked
in the schema as QName type. For example, the attribute might hold an XPath
expression, for which there is no way of saying in XSD this is a string that
may contain namespace prefixes.

Secondly, we found it impossible to make namespace fixup conditional on
validation, that is, to say that namespace fixup should generate namespace
nodes for prefixes that are used in a node of type xs:QName, This is basically
because we dont know its an xs:QName until we validate, and we need the
namespace bindings to be in place before we validate, otherwise validation
will fail. The only way to do it would be to somehow inject namespace fixup
into the middle of the XSD-defined validation process, which was not something
we were prepared to contemplate.

Michael Kay

Current Thread