[Bug 29785] [FO31] 17.5.4 fn:xml-to-json

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29785

--- Comment #1 from Michael Kay <mike@saxonica.com> ---
"Wouldn't stripping "all attributes (at any depth) in namespaces other than
http://www.w3.org/2005/xpath-functions" remove the attributes with no
namespace, such as "escaped", "key" and "escaped-key"."

No, those attributes are not in a namespace, therefore they are not in a
"namespace other than XXX".

I know this requires the reader to have a very precise understanding of the
terminology of the namespaces rec. But I think it's reasonable for us to
require this. After all, XSD expects ordinary users to know what
<xs:anyAttribute namespace="##other"/> means.

"in what situations will (2) match where (1) would not (and vice versa)?"

As originally written, rule (1) was for typed nodes, and rule (2) was for
untyped nodes. More recently, rule (2) changed to delete the phrase "whose type
annotation is xs:untyped", which means it also applies to nodes that have been
validated against a different schema, provided that validation against the
"true" schema would succeed.

Certainly (2) includes many instances where (1) does not apply (e.g. any
untyped node), but it's more difficult to find cases where (2) applies and (1)
does not.

My recollection from when we last reviewed this is that someone did identify a
corner case where this happened. It might have involved something like

<j:array>
  <j:array xsi:type="my-extended-json">
    <j:number/>
    <my:date/>
  </j:array>
</j:array>

where my-extended-json is a type derived by extension from j:arrayType that
allows additional child elements. (Perhaps we should have a test for that... Or
perhaps the schema should block extension?)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 19 August 2016 08:11:48 UTC