From: Date: April 2 2009 5:42am Subject: Re: load XML data List-Archive: http://lists.mysql.com/internals/36489 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Erik - This is interesting stuff ... How about doing the paper work required before review can progress: http://forge.mysql.com/wiki/Contributing_Code#Paperwork Even if the contribution doesn't make it into the code, it can get some attention and review and something may transpire based on it. (I believe there has already been some development in a similar area. Experts can pursue, based on plans and what exists already.) Best regards, Masood On Sun, Dec 10, 2006 at 6:45 AM, mailbox@stripped wrote: > Hi, > A first version of the LOAD XML is now available. It is based on the > LOAD DATA command, and has the following syntax: > =A0 LOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name' > =A0 =A0[REPLACE | IGNORE] > =A0 =A0INTO TABLE tbl_name > =A0 =A0ROWS IDENTIFIED BY 'row_tag' > =A0 =A0[IGNORE number LINES] > =A0 =A0[(col_name_or_user_var,...)] > =A0 =A0[SET col_name =3D expr,...)] > Basically this is the same syntax as LOAD DATA, and the xml import > also works the same way. The main difference is that the LINES and > FIELDS clauses are not supported. > > Instead a ROWS IDENTIFIED BY clause is used. For every tag with this > tag name the command will try to create a record. It will match all > tags and attributes inside the row tag and all tags and attributes on a > higher level with the columns in the target table and fill in values > accordingly. > > The command supports three different xml formats: > field values as attributes: =93= =94 > field values as tags: > valuevalue2 > the format used by other MySQL tools, where the field name is an > attribute, and the value is in the tag: > =A0 value > > The three formats can be used in the same xml file, the import will > automatically detect them. The tags are matched based on tag/attribute > name and column name. > > Changes are in attached patch file. Four files are affected: > lex.h (only add symbol XML_SYM) > sql_class.h (add enum_filetype and use in sql_exchange) > sql_yacc.yy (definition of command LOAD XML) > sql_load.cc(the implementation) > > Erik Wetterberg > > > -- > MySQL Internals Mailing List > For list archives: http://lists.mysql.com/internals > To unsubscribe: =A0 =A0http://lists.mysql.com/internals?unsub=3Dlenz@mysq= l.com > >