>>>>> Christian Grün <christian.gr...@gmail.com>:

>> Could it be something to do with the namespacing in the document?
> If your document has namespaces, you can use a wildcard for your prefix…

> • count(//*:A/*), count(//*:B/*)
> • for $c in /*:Top/* return count($c/*)

> or define the prefix in the query prolog:

>   declare namespace abc = 'http:...';
>   /abc:Top

Yup, I found this out at work today (without access to the email I'm
using on this list).

The document has a default namespace, and this worked fine:
 declare default element namespace 
"http://www.kith.no/xmlstds/eresept/m30/2013-10-08";;
 for $c in /FEST/* return count($c/*)

> If you use count(), the result will be a number, which will be
> displayed in the textual result view. If you return nodes, they will
> also be highlighted in the visualizations.

I wanted the element names together with their child counts, so I
improved the query to this (which made for easily paste-able org-mode
and Jira comment tables):
 declare default element namespace 
"http://www.kith.no/xmlstds/eresept/m30/2013-10-08";;
 for $c in /FEST/* return concat("|", node-name($c), "|", count($c/*), "|")

>> The actual documents I'm working on, are of the same type as the one in
>> this zip file http://goo.gl/ULH089

> Google tells me that your "goo.gl shortlink has been disabled. It was
> found to be violating our Terms of Service."…

So I also found out at work today, goo.gl shortlinks can't be used to
link to zip files.

Hopefully dropbox doesn't have this limitation:
 https://www.dropbox.com/s/p0gy01j0mfsp7ne/M30_Fest250Rekvirent_20151015.zip

Thanks for your help!

And thanks for BaseX!  The more I use it, the more I like it! :-)

Reply via email to