Christian Grün christian.gruen@gmail.com:
And what I'm actually looking for in this case, is a list of the top level element names ("A" and "B" in my example) together with a count of their children.
Try e.g. one of these two queries:
• count(//A/*), count(//B/*)
Those queries give me lines containing 0, one line per count(), unfortunately.
• for $c in /Top/* return count($c/*)
Stuff happens in the visualization views when I run this (some things are selected or unselected), but I get no output in the Result window, and the "Query Info" window shows: Result: - Hit(s): 0 Items - Updated: 0 Items - Printed: 0 Bytes
Could it be something to do with the namespacing in the document? Ie. that the XPath expressions don't match, even though they would seem to match.
I was trying to simplify my example, and that may have been a bad idea...?
The actual documents I'm working on, are of the same type as the one in this zip file http://goo.gl/ULH089
The document element is <FEST>, and the counts I am interested in, are the count of the child elements of the direct children of <FEST>, with names starting with "Kat".
So the actual queries I've tried, have been: - count(//KatLegemiddeldose/*), count(//KatLegemiddelMerkevare/*) - for $c in /FEST/* return count($c/*)
Hm... I selected a second level element in the Map, filtered it, and typed "select *" in the command window, and the upper right corner shows "0 Results".
What do you mean with "command window"? "select *" doesn’t sounds valid to me, but the plain asterisk character (without "select") should do the job. It’s a valid query – a shortcut for child::element() –, and it’s gives you all child elements of the nodes in the current context.
Right! With just "*" I got "6728 results"... that was more like it! :-)