Re: xpath 3.1 fn:json-to-xml question

Hi Martin,
    Many thanks for your reply, and references to XPath 3.1 F&O spec
where the relevant points wrt my questions within this thread are
mentioned.

This helps me.

On Mon, Aug 11, 2025 at 1:28 AM Martin Honnen <martin.honnen@gmx.de> wrote:
> I would say the relevant section of the spec
> https://www.w3.org/TR/xpath-functions-31/#json-to-xml-mapping says:
>
>
> A JSON object is represented by an element named map. The content is a
> sequence of child elements each of which represents one of the
> name/value pairs in the object. The representation of the name/value
> pair N:V is obtained by taking the element that represents the value V
> (by applying these rules recursively) and adding an attribute with name
> key (in no namespace), whose value is N as an instance of xs:string. The
> functions fn:json-to-xml and fn:xml-to-json both retain the order of
> entries, subject to rules about how duplicate keys are handled.
>
>
> I would interpret that as retaining the order of the entries (name/value
> pairs) if all duplicates are retained, so based on that the result Xalan
> gives breaks the rule to retain the order of entries.
>
>
> I will try to check the existing XPath 3.1 test suite for test cases
> that perhaps cover that case.


-- 
Regards,
Mukul Gandhi

Received on Monday, 11 August 2025 16:48:17 UTC