Help with XPATH

S

Shaun

Hi,

Sorry for as many questions in days. I need a way to count the total number
of rows with a unique attribute. I have been working at it for some time and
have came up with a rather ugly XPATH statement. I think it should work but
it is not counting the number of unique rows, instead it gives the same
answer as if i just took at the preceding-sibling path. Any clues?

Shaun

===

count(
.../../dfs:dataFields/d:comSystemList/d:radioVeh/d:deficencyVeh/@defVehRad[
not(. =
preceding-sibling::dfs:dataFields/d:comSystemList/d:radioVeh/d:deficencyVeh/@defVehRad)

and

(../../d:Vehicles/@BN_ID = ../../../../../my:Stats/my:BN and
.../../d:Vehicles/@CO_ID = ../../../../../my:Stats/my:CO)

])
 
G

Greg Collins [InfoPath MVP]

You are prefixing the root node with 'preceding-sibling'. That won't work because the node you are trying to compare is d:deficiencyVeh.

Try something like:

count(../../dfs:dataFields/d:comSystemList/d:radioVeh/d:deficencyVeh[not(@defVehRad = preceding-sibling::d:deficencyVeh/@defVehRad)])
 
S

Shaun

wow, thanks!

I'm making a lot more progress after about a week of learning. I keep
wanting to throw sql statements at the thing until I realize it's just a
different way of looking at the problem.

Shaun
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top