Hi all,
I updated the FLIP with the points from the recent discussion. The main
changes:

- force_array option: PARSE_XML and TRY_PARSE_XML now take an optional
boolean (default false). When true, every element maps to an array even if
it appears once, so the shape stays stable. The compact format is still the
default.
- # field: dropped when there is only a single distinct key. A single
repeated tag already keeps its order in its array, so # carries no
information there.
- xsi / namespaces: added the round-trip behavior and spelled out the
literal-prefix limitation in both directions (thanks Sai for pointing out
the second one).

On namespaces: we match xsi:nil and xsi:type by the literal xsi: prefix,
not by the resolved namespace. In real documents these attributes might
appear without a proper xmlns:xsi declaration, and literal matching still
handles them. A namespace-aware parser would need the prefix declared and
would reject those.
The tradeoff is that we rely on the xsi convention. If you bind xsi to a
non-standard namespace, or use a different prefix for the schema-instance
namespace, it won't be handled correctly. However, that's unusual in
practice.

Please have another look and let me know if anything is still unclear. If
there are no more concerns, we can start a vote soon.

Best,
Moritz

On Tue, 22 Sept 2026 at 15:25, Timo Walther <[email protected]> wrote:

> Hi Moritz,
>
> thanks for considering my feedback. +1 for a compact representation by
> default but an additional parameter that enables consistent structure
> across multiple XML document.
>
> +1 for voting from my side, modulo the remaining comment from Sai.
>
> Thanks,
> Timo
>
>
> On 22.09.26 07:22, Krishna Sai wrote:
> > Hi Moritz,
> >
> > That answers it, thanks. Since PARSE_XML consumes xmlns:xsi and
> XML_STRING
> > is the only thing that emits it, the duplicate can't happen.
> >
> > On the note you're adding, the other direction might be worth a line too.
> > The FLIP already records a different prefix bound to the XSD-instance
> > namespace. The opposite case is xsi bound to something else:
> >
> >    <root xmlns:xsi="urn:my-app"><a xsi:nil="true"/></root>
> >
> > A namespace-aware parser reads that attribute as {urn:my-app}nil, an
> > ordinary application attribute. PARSE_XML would take it as a null,
> consume
> > the declaration, and XML_STRING would emit the XSD-instance one, so the
> > prefix comes back bound to a different namespace than it went in. Unlike
> > the unused-declaration case, that one changes meaning rather than bytes.
> >
> > Best,
> > Sai Krishna Sepuri
>
>

Reply via email to