From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Jim Jones <jim(dot)jones(at)uni-muenster(dot)de> |
Cc: | Umar Hayat <postgresql(dot)wizard(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Add XMLNamespaces to XMLElement |
Date: | 2025-01-16 07:36:52 |
Message-ID: | CAFj8pRBf+fdsdBmtM6R2OS4vWDSy6BkgKOJ8ve-Ae1JAyQpF7Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi
st 15. 1. 2025 v 21:35 odesílatel Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
napsal:
> Hi Umar, Hi Pavel,
>
> On 26.12.24 14:46, Jim Jones wrote:
> > The idea of NO DEFAULT is pretty much to free an element (and its
> > children) from a previous DEFAULT in the same scope.
> >
> > SELECT
> > xmlserialize(DOCUMENT
> > xmlelement(NAME "root",
> > xmlnamespaces(DEFAULT 'http:/x.y/ns1'),
> > xmlelement(NAME "foo",
> > xmlnamespaces(NO DEFAULT))
> > ) AS text INDENT);
> >
> > xmlserialize
> > ------------------------------
> > <root xmlns="http:/x.y/ns1">+
> > <foo xmlns=""/> +
> > </root>
> > (1 row)
>
> v3 is attached, now using xmlTextWriterWriteAttributeNS from libxml2 for
> managing XML namespaces, instead of using xmlTextWriterWriteAttribute.
> Libxml2 is quite lenient, allowing the duplication of default namespaces
> within the same scope and even permitting NO DEFAULT namespaces when no
> previous DEFAULT declaration has been made - both are semantically valid.
>
> The crux now is finding the appropriate balance between accuracy and
> user intent. In the context of PostgreSQL's xmlelement and
> xmlnamespaces, I would argue that explicitly declared namespaces,
> redundant or not, ought to be preserved. A user who intentionally
> repeats a namespace declaration might have sound reasons for doing so,
> like ensuring clarity, preserving compatibility with external XML
> processors, or sticking to a specific schema. Silently omitting these
> declarations could lead to confusion.
>
>
Now, I have not any objections against the code
The patch has doc and enough regress tests
The patching and compilation without problems
make check-world passed
I'll mark this patch as ready for committer
> Pavel has tidied up the parser modifications - it's looking much neater
> now. Many thanks for that!
>
It was a pleasure
Regards
Pavel
>
> Best, Jim
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Alena Rybakina | 2025-01-16 07:45:57 | Re: Eagerly scan all-visible pages to amortize aggressive vacuum |
Previous Message | Michael Banck | 2025-01-16 07:35:32 | Re: [PATCH] New predefined role pg_manage_extensions |