MySQL Forums
Forum List  »  Connector/Node.js

Re: Help with ExtractValue
Posted by: Jonathan Stephens
Date: February 18, 2009 02:07AM

Well, you *can* select <WORK/> and <HOME/> but they're empty. ExtractValue() gets the *content* of the tag, and empty tags have no content.

Let's look at your example again:


Here's a tree representation:

   |             |
  ADR           ADR
   |             |
 -------      -------
 |     |      |     |

WORK and REGION are both children of the first ADR element; WORK and REGION are siblings. REGION is not a child of WORK.

Similarly, HOME and REGION are both children of the second ADR element. REGION is not a child of HOME.

Actually, a better XML representation of this information might be:


or this:

<ADR type="work"><REGION>Dorset</REGION></ADR>
<ADR type="home"><REGION>London</REGION></ADR>

Either of these gives the ADR element consistent structure throughout the XML document, making it heaps easier to work with. :)

Jon Stephens
MySQL Documentation Team @ Oracle

MySQL Dev Zone
MySQL Server Documentation

Options: ReplyQuote

Written By
January 18, 2009 10:54AM
January 18, 2009 03:37PM
Re: Help with ExtractValue
February 18, 2009 02:07AM

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.