RE: [PEAR-DEV] XML_Query2XML: ISO/IEC 9075-14:2005 mapping
| From: | Lukas Feiler | Date: | Fri, 21 Apr 2006 16:31:31 +0000 |
| Subject: | RE: [PEAR-DEV] XML_Query2XML: ISO/IEC 9075-14:2005 mapping | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-42309@lists.php.net to get a copy of this message | ||
Hi Jesus,
> Jesus M. Castagnetto wrote:
>
> Hi Lukas
>
> (Sorry I could not answer your message before, I was
> preparing some classes and talks)
>
> --- Lukas Feiler <lukas@empoweredmail.com> wrote:
>
> > Hi,
> >
> > as Justin and Jesus suggested, I implemented ISO/IEC
> 9075-14:2005 for
> > mapping SQL identifies to XML names within XML_Query2XML (voting in
> > progress).
> >
> > I have 2 questions regarding the implementation:
> >
> > 1) What do you think about (not) making
> XML_Query2XML_ISO9075Mapper the
> > default?
> > ISO 9075-mapping is quite complex as it also requires
> Unicode support.
> > Therefore my full implementation has 356 lines and on a
> PIII, 2.2 GHz it
> > does only about 1755 mappings per second. Considering this
> overhead, I'm not
> > sure if XML_Query2XML_ISO9075Mapper should be the default
> mapper. I guess a
> > lot of people only use [a-Z_0-9]* for SQL identifiers and
> don't need any
> > special mapping at all.
>
> Agree on this one. The extended mapping will be useful in the cases of
> accessing some legacy or foreign language named identifiers,
> thus it should not
> be the default but an option. I've dealt with some old dbs
> that included spaces
> and other random stuff in the names, just because of some
> internal standard
> that mandated a fixed number of chars, so the db admins got
> inventive in their
> naming schemes :-)
Not using ISO9075 mapping as the default also has the advantage that the
dependency on I18N_UnicodeString is only optional.
Users that don't do ISO9075 mapping won't even have to install
I18N_UnicodeString (which is currently only beta).
>
> > 2) Why do you think that Section 9.2 of ISO/IEC
> 9075-14:2005 is relevant?
> > XML_Query2XML only deals with column names but never with
> multiple SQL
> > identifiers that would have to be mapped to a single XML name.
>
> I would not implement that just yet. I am not sure what could
> be the exact
> applicability of that in most day to day work. Seems to me
> that the usual
> mapping of database names, tables and fields in a hierachical
> manner in XML
> should suffice for most purposes, no need to have a multipart
> fo!!.ba++r.bo1#ng
> mapping to a single element.
OK, I agree
>
> >
> > The source of ISO9075Mapper.php
> (XML_Query2XML_ISO9075Mapper) can be found
> > at:
> > http://query2xml.sourceforge.net/ISO9075Mapper.php.html
> >
> > Unit tests can be found at:
> >
> > http://query2xml.sourceforge.net/ISO9075MapperTest.php.html
> >
> > Note: currently XML_Query2XML_ISO9075Mapper has its own methods for
> > converting characters from UTF-8 to Unicode (and vice
> versa); as suggested
> > by Justin, I placed a feature request for the PEAR package
> > I18N_UnicodeString. This package actually contains the required
> > functionality but does not currently provide it via public
> static methods.
>
> I see that your request has been attended so you can now use
> the methods in the
> aforementioned package instead of the internally defined ones
> in your code.
>
> I am impressed with having implemented this, and that you had
> the stamina to
> waddle through that standard (which is not light reading at all).
>
> Cheers and keep the good work.
Thanks for making me implement ISO 9075 :) It's a great feature!
As soon as the PEPr voting process is over I'll make a new release that
includes all changes suggested during the voting process.
I already implemented and documented everything but I'd like to wait if
anything else turns up until tomorrow 08:00 UTC.
I just updated http://query2xml.sourceforge.net/ISO9075Mapper.php.html
so
you can have a look at the new implementation using I18N_UnicodeString.
Lukas