...

View Full Version : problems with MySQL X-Path



Pesho
03-23-2007, 01:53 AM
Hello,

I have an X-Path problem here.
I have the following XML structure:


<OAI-PMH xsi:schemaLocation="blabla">
<ListRecords>
<record>
<metadata>
<oai_dc:dc xsi:schemaLocation="blabla">
<dc:title>Just take her seriously</dc:title>
<dc:creator>Weijmar Schultz, W.C.M.</dc:creator>
</oai_dc:dc>
</metadata>
</record>

<record>
<metadata>
<oai_dc:dc xsi:schemaLocation="blabla">
<dc:title>John's Book</dc:title>
<dc:creator>John</dc:creator>
</oai_dc:dc>
</metadata>
</record>
</ListRecords>
</OAI-PMH>


Having the name of the creator, I'd like to extract the title of the corresponding record. E.g. I want to know the title of the record, whose creator is John.

I'm running MySQL 5.1. The xml structure is stored in a column "xml_content" in a table "xml" and I use the following X-Path expression:

ExtractValue(xml_content, '/OAI-PMH/ListRecords/record/metadata/oai_dc:dc//*[dc:creator="John"]/dc:title/) from xml;
Unfortunately, it doesn't work. Would you tell me whether my X-Path expression is wrong or my mistake is in the use of ExtractValue().

Thanks in advance,
Pesho



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum