MySQL Forums
Forum List  »  Connector/Node.js

Re: extractvalue issue
Posted by: Jonathan Stephens
Date: February 18, 2009 01:08AM

Hi Anoop,

The problem is that your XML is not valid because it doesn't use the actual quote character:

jon@tonfisk:~> ./ximkeys ”
<Multi_key> <greater> <quotedbl>        : "”"   U201d # RIGHT DOUBLE QUOTATION MARK
<Multi_key> <quotedbl> <greater>        : "”"   U201d # RIGHT DOUBLE QUOTATION MARK

(In fact, trying to select just the value of the variable containing the XML returned a big blank.)

When I replaced the right-double-quotes with standard double-quote characters and tried your example again, it worked perfectly:

mysql> SELECT @xml\G
*************************** 1. row ***************************
@xml: <section>
<title>Choosing an Install Package</title>
<para>...three different packages...</para>
<listitem id="1">
<para><literal></literal>: ...Zip archive....</para>
<listitem id="full">
<para><literal></literal>: ...full installation with all optional packages...</para>
<listitem id="essential">
<para><literal></literal>: ...minimum components...</para>
<para> is recommended...because of its smaller size.</para>
1 row in set (0.00 sec)

mysql> SELECT ExtractValue(@xml, '/section/itemizedlist/listitem[@id="1"]/para/literal');                                                                                                      
| ExtractValue(@xml, '/section/itemizedlist/listitem[@id="1"]/para/literal') |
|                                                          | 
1 row in set (0.00 sec)

Hope this helps!

Jon Stephens
MySQL Documentation Team @ Oracle
Orlando, Florida, USA

MySQL Dev Zone
MySQL Server Documentation

Options: ReplyQuote

Written By
January 24, 2009 01:32AM
Re: extractvalue issue
February 18, 2009 01:08AM

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.