just for further info. The XPATH of what i'm trying to do using the
point-click method is:
count(xdXDocument:GetDOM("Vehicles")/dfs:myFields/dfs:dataFields/d:Vehicles/d:radioVeh[@radioSystem
=
xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/d:comSystemList/d:Systems/@TOC_System])
and my version with my non-working usage of current is:
count(xdXDocument:GetDOM("Vehicles")/dfs:myFields/dfs:dataFields/d:Vehicles/d:radioVeh[@radioSystem = current()/my:TOC_System])
see, i think with the first version it is simply using the first instance in
the repeating table vs. the actual current one. My attempt at using the
current() function doesn't work but that's what i'm trying to do.
Shaun
you will have to experiment moving further up the data tree after the equals
sign.
EG
count(xdXDocument:GetDOM("Vehicles")/dfs:myFields/dfs:dataFields/d:Vehicles/d:radioVeh[@radioSystem = current()/@TOC_System])
OR
count(xdXDocument:GetDOM("Vehicles")/dfs:myFields/dfs:dataFields/d:Vehicles/d:radioVeh[@radioSystem = current()/d:systems/TOC_System])
And so on
At one point it will work and I THINK it is around the /d:comSystemList bit
but it is all a bit hazy. ONE of them will suddenly work and it is amazing
when it does, looks VERY slick.
Cheers Adam
> just for further info. The XPATH of what i'm trying to do using the
> point-click method is:
[quoted text clipped - 9 lines]
> the repeating table vs. the actual current one. My attempt at using the
> current() function doesn't work but that's what i'm trying to do.
Shaun - 11 May 2006 17:18 GMT
This isn't working, I guess i'm in over my head but this has to easy and i'm
just missing something so let me try asking it a different way.
In my repeating table I have a value (../@TOC_System) and I want to count
the rows in a secondary datastore where the key = that value. When I try and
count off the secondary datastore I guess it tried to look at only the first
../@TOC_System instead of the current rows ../@TOC_System. I've tried every
usage of the current() function that I can think of but I can't even get it
to return anything.
> Shaun
>
[quoted text clipped - 30 lines]
> > the repeating table vs. the actual current one. My attempt at using the
> > current() function doesn't work but that's what i'm trying to do.
Shaun - 11 May 2006 18:16 GMT
Just to further help. I'm trying this xpath
count(xdXDocument:GetDOM("Vehicles")/dfs:myFields/dfs:dataFields/d:Vehicles/d:radioVeh[(../@BN_ID
= xdXDocument:get-DOM()/dfs:myFields/dfs:queryFields/q:Systems/@BN_ID) and
(current()/dfs:myFields/dfs:dataFields/d:comSystemList/d:Systems/@TOC_System
= @radioSystem)])
and i've moved that current() all the way down with no results, always
completely blank. I tried to do some debuging and tried to set the field to
(current()/dfs:myFields/dfs:dataFields/d:comSystemList/d:Systems/@TOC_System)
and removing each of the folders one-by-one and it will never display
anything.
The original point-click query was:
count(xdXDocument:GetDOM("Vehicles")/dfs:myFields/dfs:dataFields/d:Vehicles/d:radioVeh[(../@BN_ID
= xdXDocument:get-DOM()/dfs:myFields/dfs:queryFields/q:Systems/@BN_ID) and
(@radioSystem =
xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/d:comSystemList/d:Systems/@TOC_System)])
I know i'm close but I just can't get there.
Shaun
Greg Collins [InfoPath MVP] - 12 May 2006 00:07 GMT
current() doesn't work the way you are trying to use it.
It can be very difficult at time to understand where current() actually places you in your XPath hierrarchy. But to use it as a root node, as in your first example, is just an invalid use.
I know this isn't fun, but you'll need to identify just which node in your schema structure that current() represents in your scenario. Then you build your XPath from current() in terms of that actual node it represents.
So, if current() represented d:Systems then all you would need is current()/@TOC_System.
Make sense?

Signature
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
Visit InfoPath Dev ( http://www.InfoPathDev.com )
Shaun - 12 May 2006 01:38 GMT
Thank you for your help. I understand what you are saying. to try and debug,
I 'walked' the current down the tree but it was always blank. then I decided
to try and just get it to display where it was so I did a name(current()) and
it reported the name of the textboz the function was in, not even close to
what I was shooting for. 3hen I tried getting to the 'parent' node but based
on the xpath examples I could find that wasn't working either. I just don't
understand why when I just do a ../@Toc_system it gets it right but then when
I try and use that in a filter on a secondary datastore it just refers to the
first entry. how can I refer to the current repeated row? thanks for your
patience; i'm learning quite a bit.