Querying the Wikipedia XML dump
Dear Jason,
Quoted text · Jason Priem · 6 lines
> I set up a database in BaseX with the Wikipedia articles dump (all 25 GB of > it). I'm able to access individual articles though the treemap display (by > clicking on them), but I get null responses for every xpath query run, even > really basic stuff like "//title." I'm sorry if this is a very obvious > question; I'm a beginner to XML databases. Any ideas as the problem, or > what to do to find out more? Thanks!
You need to specify the namespace of the Wikipedia document in the prolog of your query:
declare default element namespace "http://www.mediawiki.org/xml/export-0.3/";
//titleIf you prefer short expressions, just add a prefix wildcard in front of the tag names:
//*:title
Hope this helps, Christian ___________________________
Christian Gruen Universitaet Konstanz Department of Computer & Information Science D-78457 Konstanz, Germany Tel: +49 (0)7531/88-4449, Fax: +49 (0)7531/88-3577 http://www.inf.uni-konstanz.de/~gruen
Hi, I set up a database in BaseX with the Wikipedia articles dump (all 25 GB of it). I'm able to access individual articles though the treemap display (by clicking on them), but I get null responses for every xpath query run, even really basic stuff like "//title." I'm sorry if this is a very obvious question; I'm a beginner to XML databases. Any ideas as the problem, or what to do to find out more? Thanks! j
Written for BaseX 6. BaseX may have changed since: please check the current documentation.