ccikara Absent Member.
Absent Member.
269 views

XPath and NodeSet question...


Lets say I want to check the value of a user's group membership, but the
user belongs to more than 1 group.
(This is just an example so I can get to understand the concept
better...)

I will not be able to do a simple if group membership = group correct?
As there is more than 1 value.

I will need to use the built-in variables node-set and current-node
etc. correct?

This is what I have created so far using examples I have found:

set local variable = ("GroupValue",Nodeset(XPath("empty")))
-- This will create an empty array correct?
for each
Source Attribute("Group Membership")
do
set local variable("GroupValue",nodeset(Local
Variable("GroupValue")+???)

Where I have the "???" I am confused... I know I must get the value of
the current "node" of the Group Membership attribute, just how I am
unsure...

After that, I want to check the value of each "node" to see if it
equals the value of a Group...

For this I will need to do something like:

for each
Local Variable("GroupValue")
do
???

And again I am stuck...

Any help will be appreciated, I want to develop my XPath skills further
hence the request for assistance.

Regards,
Craig Cikara


--
ccikara
------------------------------------------------------------------------
ccikara's Profile: http://forums.novell.com/member.php?userid=86966
View this thread: http://forums.novell.com/showthread.php?t=448548

Labels (1)
0 Likes
4 Replies
Knowledge Partner
Knowledge Partner

Re: XPath and NodeSet question...

On 22.11.2011 12:06, ccikara wrote:
>
> Lets say I want to check the value of a user's group membership, but the
> user belongs to more than 1 group.
> (This is just an example so I can get to understand the concept
> better...)
>
> I will not be able to do a simple if group membership = group correct?
> As there is more than 1 value.


The default behaviour of the if group membership = group will return
true when that group is in the list (node set) of groups the user is a
member of.

I don't really understand what you are trying to achieve with the
for-each / xpath logic you outline. Are you trying to compile a list of
groups that the user is a member of?
Alex McHugh - Knowledge Partner - Stavanger, Norway
Who are the Knowledge Partners
If you appreciate my comments, please click the Like button.
If I have resolved your issue, please click the Accept as Solution button.
0 Likes
ccikara Absent Member.
Absent Member.

Re: XPath and NodeSet question...


Thanks for the reply.

Maybe it was a bad example... And this is just an example so I can try
understand IDM better.

I guess using the example of trying to compile a list is fine, but I
want to do it using the built-in variables / XPath so I can better
understand it...
Maybe you have a better example where you have previously used it?


--
ccikara
------------------------------------------------------------------------
ccikara's Profile: http://forums.novell.com/member.php?userid=86966
View this thread: http://forums.novell.com/showthread.php?t=448548

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: XPath and NodeSet question...

ccikara wrote:

> Where I have the "???" I am confused... I know I must get the value of
> the current "node" of the Group Membership attribute, just how I am
> unsure...


the current node wheniterating a for-each loop is accessible through a
predefinded variable named "current-node" that you can reference as
<token-local-variable name="current-node"/> (dirxmlscript token),
$current-node$ (dynamic string expansion) or $current-node (xpath variable
reference)

(there's a simlar variable avalable for the do-reformat-op-attr token with is
called "current-value", btw. Make sure you use the right one)

Read
http://www.novell.com/communities/node/13053/common-mistakes-newcomers-idm-make-
part-1 for more details.

0 Likes
ccikara Absent Member.
Absent Member.

Re: XPath and NodeSet question...


Thanks!

I am getting there... Just been testing some stuff and trying to get
the hang of things...


--
ccikara
------------------------------------------------------------------------
ccikara's Profile: http://forums.novell.com/member.php?userid=86966
View this thread: http://forums.novell.com/showthread.php?t=448548

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.