Awesome. Both work! Thank you. On 1 March 2017 at 10:30, Fabrice ETANCHAUD <[email protected]> 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")/MzIdentML/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:MzIdentML/mz:SequenceCollection/mz:Peptide > > Best regards, > Fabrice Etanchaud > > -----Message d'origine----- > De : [email protected] > [mailto:[email protected]] De la part de Witold E > Wolski > Envoyé : mercredi 1 mars 2017 10:18 > À : [email protected] > 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")/*:MzIdentML/*: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-xpath > > 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

