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>
<itemizedlist>
<listitem id="1">
<para><literal>....noinstall.zip</literal>: ...Zip archive....</para>
</listitem>
<listitem id="full">
<para><literal>...win.zip</literal>: ...full installation with all optional packages...</para>
</listitem>
<listitem id="essential">
<para><literal>...win.msi</literal>: ...minimum components...</para>
</listitem>
</itemizedlist>
<para>...win.msi...package is recommended...because of its smaller size.</para>
</section> 
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') |
+----------------------------------------------------------------------------+
| ....noinstall.zip                                                          | 
+----------------------------------------------------------------------------+
1 row in set (0.00 sec)

Hope this helps!

Jon Stephens
MySQL Documentation Team @ Oracle

MySQL Dev Zone
MySQL Server Documentation
Oracle

Options: ReplyQuote


Subject
Written By
Posted
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.