MySQL Forums
Forum List  »  Connector/Node.js

Suggestion on XML syntax
Posted by: mike bond
Date: February 09, 2007 06:44PM

I don't know if this is the best place to suggest this, if not, maybe you all can point me in the right direction.

I suggest using a notation to extract values from XML in SQL similar to other programing languages use of arrays. An example would be "Select Document[//Article/Title] from Library", Using the square brackets [] to indicate the xpath value to extract from the Document field. Likewise angle brackets <> can be used in place of the square brackets, as angle brackets <> reference xml. Using the above example becomes "Select Document<//Article/Title> from Library". This syntax is more concise and is similar to the use of square brackets to extract elements from arrays such as array[2].

SELECT EXTRACTVALUE(address, '//City') FROM Customer;
SELECT address[//City] FROM Customer;
SELECT address<//City> FROM Customer;

Options: ReplyQuote

Written By
Suggestion on XML syntax
February 09, 2007 06:44PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.