Re: [HACKERS] proposal - Default namespaces for XPath expressions (PostgreSQL 11)

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] proposal - Default namespaces for XPath expressions (PostgreSQL 11)
Date: 2018-11-30 18:32:27
Message-ID: CAFj8pRAoV8ntZU3cek6=pnvCjrYWzbDKNAa=W+NmY1GRPPB54g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pá 30. 11. 2018 v 9:26 odesílatel Kyotaro HORIGUCHI <
horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> napsal:

> Hello.
>
> At Fri, 30 Nov 2018 07:48:26 +0100, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote in <
> CAFj8pRD7Zg07t4NpZu09T4RgXz0bTvyYg2eMVoH+o_drNoiz6w(at)mail(dot)gmail(dot)com>
> > Hi
> >
> > čt 29. 11. 2018 v 14:44 odesílatel Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
> > napsal:
> >
> > > > On Fri, Sep 21, 2018 at 1:30 PM Pavel Stehule <
> pavel(dot)stehule(at)gmail(dot)com>
> > > wrote:
> > > >
> > > > Thank you for comments
> > > >
> > > > Attached updated patch
> > >
> > > Unfortunately, current version of the patch doesn't pass make check,
> > > something
> > > is missing for xml tests. Could you please rebase it?
> > >
> > > After that I hope someone from reviewers (Kyotaro?) can probably
> confirm if
> > > it's still in a good shape. For now I'm moving it to the next CF.
>
> Sure. Sorry for coming late. I reconfirmed this.
>
> The most significant change in this version is namespace name
> generaton.
>
> - We can remove strlen from mutate_name by mutating the string in
> reverse order. We don't need to mutate it in a human-affinity
> order. The name would be 1-letter in almost all cases.
>
> Concretely, the order in my mind is the follows:
>
> "" "a" "b" ..."z" "aa" "ba" "ca"... "za" "ab"..
>
>
done

> - Might the 'propriety' correctly be 'properties'?
>
> + /* register namespace if all propriety are available */
>
>
fixed

> - Is the "if" a mistake of "in"?
>
> + * collect ns names if ResTarget format for possible usage
> + * in getUniqNames function.
>
>
yup, fixed

> - I suppose the following should be like "register default
> namespace definition if any".
>
> + /* get default namespace name when it is required */
>
>
fixed

>
> Maybe the followings are not new. (Note that I'm not a naitive speaker.)
>

>
> - I cannot read this. (I might be to blame..)
>
> + * default namespace for XPath expressions. Because there are not any
> API
> + * how to transform or access to parsed XPath expression we have to
> parse
> + * XPath here.
>
> - This might need to explain "by what".
>
> + * Those functionalities are implemented with a simple XPath parser/
> + * preprocessor. This XPath parser transforms a XPath expression to
> another
> + * XPath expression that can be used by libxml2 XPath evaluation. It
> doesn't
> + * replace libxml2 XPath parser or libxml2 XPath expression evaluation.
>
> - "add" -> "adds", "def_namespace_name" seems to need to be
> replaced with something else.
>
> + * This transformation add def_namespace_name to any unqualified node
> name
> + * or attribute name of xpath expression.
>

I tried to formulate it better, but I am sorry, my English is not good.

>
> (Sorry, I'll look further later.)
>

I am sending a updated patch

Regards

Pavel

> regards.
>
> --
> Kyotaro Horiguchi
> NTT Open Source Software Center
>

Attachment Content-Type Size
default-namespaces-20181130-2.patch.gz application/gzip 9.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-11-30 18:33:26 Re: pgbench doc fix
Previous Message Peter Eisentraut 2018-11-30 18:24:07 Re: Support custom socket directory in pg_upgrade