You are right,
BaseX and XQuery are awesome !
And one day you should take a look at REST-XQ and XForms (like Orbeon) to embrace the whole picture...
Best regards, Fabrice
-----Message d'origine----- De : Witold E Wolski [mailto:wewolski@gmail.com] Envoyé : mercredi 1 mars 2017 10:58 À : Fabrice ETANCHAUD fetanchaud@groupefbo.com Cc : basex-talk@mailman.uni-konstanz.de Objet : Re: [basex-talk] querying xml with namespaces.
Awesome. Both work! Thank you.
On 1 March 2017 at 10:30, Fabrice ETANCHAUD fetanchaud@groupefbo.com wrote:
Hi, from what I remember,
You can get rid of namespace wildcards if you just declare a default element namespace for your query :
declare default element namespace 'http://psidev.info/psi/pi/mzIdentML/1.1';
db:open("myrimatchSubset","20160312_17_B3_myrimatch_2_2_140.xml")/MzId entML/SequenceCollection/Peptide
Another way is to declare explicitly your namespace (here named mz but you could choose any other name) :
declare namespace mz = 'http://psidev.info/psi/pi/mzIdentML/1.1';
db:open("myrimatchSubset","20160312_17_B3_myrimatch_2_2_140.xml")/mz:M zIdentML/mz:SequenceCollection/mz:Peptide
Best regards, Fabrice Etanchaud
-----Message d'origine----- De : basex-talk-bounces@mailman.uni-konstanz.de [mailto:basex-talk-bounces@mailman.uni-konstanz.de] De la part de Witold E Wolski Envoyé : mercredi 1 mars 2017 10:18 À : basex-talk@mailman.uni-konstanz.de Objet : [basex-talk] querying xml with namespaces.
Apologies if I am hard to understand but I am new to the XML querying. I would like to query an XML with namespaces.
As I did learn, you can do it in BaseX by including an *: in your path, e.g.,
db:open("myrimatchSubset","20160312_17_B3_myrimatch_2_2_140.xml")/*:Mz IdentML/*:SequenceCollection/*:Peptide
But I would like to be more specific than *. I did search the schema for the XML and all I found related to the search term namespace is not brief name, but: targetNamespace="http://psidev.info/psi/pi/mzIdentML/1.1"
I did also found the following entry on stack overflow: http://stackoverflow.com/questions/5239685/xml-namespace-breaking-my-x path
And If I interpret the answer there correctly somehow one can register his own acronym for a namespace? Is this correct? So I am wondering if I could do the same somehow in BaseX?
Alternatively, I am wondering if I could tell BaseX to disable namespace checking?
Thank you a lot
-- Witold Eryk Wolski
-- Witold Eryk Wolski