Hi Wiard,


But what if I want what is in the 'idno' ? <idno type="jlb">012</idno>
Or : <vg:placeLet>London</vg:placeLet>

This should work:
declare namespace ns = "http://www.tei-c.org/ns/1.0";
//ns:idno

... and this:
declare namespace ns = "http://www.vangoghletters.org/ns/";
//ns:placeLet


Concerning your last email I guess you already figured it out yourself,
right? Otherwise, just let me know.


Have a nice day, regards,
Lukas


On Fri, May 20, 2011 at 10:26 AM, Wiard Vasen <wiard.vasen@gmail.com> wrote:
Hi Lukas,

//*:fileDesc works, and gives the whole content of the file back.
Starting with the term fileDesc in 'brackets'.

When I use //*:sourceDesc or note I get a bit the same result.

But what if I want what is in the 'idno' ? <idno type="jlb">012</idno>

Or : <vg:placeLet>London</vg:placeLet>

How do I get these results?

Thanks in advance.

Regards,

Wiard


2011/5/20 Wiard Vasen <wiard.vasen@gmail.com>
Hey Lucas,

thanks a lot for your help!
I have a look at your example.

Regards,

Wiard



2011/5/20 Lukas Kircher <lukaskircher1@googlemail.com>
Hi Wiard,


being neither Christian nor Andreas, I nevertheless take a
shot :)

It's kinda hard to give a hint knowing that little about your
case, but I think you problem might be related to
namespaces.

As the root element 'TEI' declares a namespace, all descendants
lie in this namespace (unless they declare another one or are
linked to a prefix).

Short example - if you want to query a letDesc element you have
to specify the namespace it is linked to. Just declare the prefix
at the beginning of your query.

declare namespace ns = "http://www.vangoghletters.org/ns/";
//ns:letDesc

You can also use namespace wildcards to access nodes without
a specific prefix, for example the 'fileDesc' element:

//*:fileDesc

Hope this helps you a little - don't hesitate to ask for more.

I also included a link to a short discussion [1]. I'm afraid I can't
provide with a better tutorial about namespaces - it's a rare thing.

Regards,
Lukas

[1] http://www.stylusstudio.com/xquerytalk/200608/001654.html







2011/5/20 Wiard Vasen <wiard.vasen@gmail.com>
Dear Christian, Andreas, 

I have trouble querying the following text.
Could you have a look at it and show me how I can pose different queries on the file?

I would be grateful if you did!

Thanks in advance.

Kind regards,

Wiard



_______________________________________________
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk