I have an OU which can contain thousands of user objects. I need to find
the number for which I am performing a query and calculating count with
xpath.

The query works right but the count returned is 0. Here's the trace


05/13/09 01:52:28.150]:GENERIC LOOPBACK ST: ACTION:
DO-SET-LOCAL-VARIABLE(\"USERS\",SCOPE=\"POLICY\",ARG-NODE-SET(TOKEN-QUERY(DATASTORE=\"SRC\",SCOPE=\"SUBORDINATES\",ARG-DN(\"O=CHWIDV\OU=USERS\"),\"CN\"))).
[05/13/09 01:52:28.152]:GENERIC LOOPBACK ST:
ARG-NODE-SET(TOKEN-QUERY(DATASTORE=\"SRC\",SCOPE=\"SUBORDINATES\",ARG-DN(\"O=CHWIDV\OU=USERS\"),\"CN\"))
[05/13/09 01:52:28.154]:GENERIC LOOPBACK ST:
TOKEN-QUERY(DATASTORE=\"SRC\",SCOPE=\"SUBORDINATES\",ARG-DN(\"O=CHWIDV\OU=USERS\"),\"CN\")
[05/13/09 01:52:28.155]:GENERIC LOOPBACK ST:
ARG-DN(\"O=CHWIDV\OU=USERS\")
[05/13/09 01:52:28.156]:GENERIC LOOPBACK ST:
TOKEN-TEXT(\"O=CHWIDV\OU=USERS\")
[05/13/09 01:52:28.156]:GENERIC LOOPBACK ST: ARG VALUE:
\"O=CHWIDV\OU=USERS\".
[05/13/09 01:52:28.157]:GENERIC LOOPBACK ST:
ARG-STRING(\"CN\")
[05/13/09 01:52:28.158]:GENERIC LOOPBACK ST:
TOKEN-TEXT(\"CN\")
[05/13/09 01:52:28.159]:GENERIC LOOPBACK ST: ARG VALUE:
\"CN\".
[05/13/09 01:52:28.161]:GENERIC LOOPBACK ST: QUERY FROM
POLICY
[05/13/09 01:52:28.162]:GENERIC LOOPBACK ST:
<NDS DTDVERSION=\"3.5\" NDSVERSION=\"8.X\">
<SOURCE>
<PRODUCT VERSION=\"3.6.0.4294\">DIRXML</PRODUCT>
<CONTACT>NOVELL, INC.</CONTACT>
</SOURCE>
<INPUT>
<QUERY DEST-DN=\"O=CHWIDV\OU=USERS\" SCOPE=\"SUBORDINATES\">
<READ-ATTR ATTR-NAME=\"CN\"/>
</QUERY>
</INPUT>
</NDS>
[05/13/09 01:52:28.167]:GENERIC LOOPBACK ST: PUMPING XDS TO
EDIRECTORY.
[05/13/09 01:52:28.169]:GENERIC LOOPBACK ST: PERFORMING
OPERATION QUERY FOR O=CHWIDV\OU=USERS.
[05/13/09 01:52:28.186]:GENERIC LOOPBACK ST: QUERY FROM
POLICY RESULT
[05/13/09 01:52:28.187]:GENERIC LOOPBACK ST:
<NDS DTDVERSION=\"3.5\" NDSVERSION=\"8.X\">
<SOURCE>
<PRODUCT VERSION=\"3.6.0.4294\">DIRXML</PRODUCT>
<CONTACT>NOVELL, INC.</CONTACT>
</SOURCE>
<OUTPUT>
<INSTANCE CLASS-NAME=\"USER\"
QUALIFIED-SRC-DN=\"O=CHWIDV\OU=USERS\CN=ASSOTEST\"
SRC-DN=\"\CHWIDVTREE\CHWIDV\USERS\ASSOTEST\" SRC-ENTRY-ID=\"41235\">
<ATTR ATTR-NAME=\"CN\">
<VALUE NAMING=\"TRUE\" TIMESTAMP=\"1241602400#23\"
TYPE=\"STRING\">ASSOTEST</VALUE>
</ATTR>
</INSTANCE>
<INSTANCE CLASS-NAME=\"USER\"
QUALIFIED-SRC-DN=\"O=CHWIDV\OU=USERS\CN=IMAGETEST\"
SRC-DN=\"\CHWIDVTREE\CHWIDV\USERS\IMAGETEST\" SRC-ENTRY-ID=\"41185\">
<ASSOCIATION STATE=\"MIGRATE\"></ASSOCIATION>
<ATTR ATTR-NAME=\"CN\">
<VALUE NAMING=\"TRUE\" TIMESTAMP=\"1241433552#23\"
TYPE=\"STRING\">IMAGETEST</VALUE>
</ATTR>
</INSTANCE>
<INSTANCE CLASS-NAME=\"USER\"
QUALIFIED-SRC-DN=\"O=CHWIDV\OU=USERS\CN=KHAN001\"
SRC-DN=\"\CHWIDVTREE\CHWIDV\USERS\KHAN001\" SRC-ENTRY-ID=\"41054\">
<ATTR ATTR-NAME=\"CN\">
<VALUE NAMING=\"TRUE\" TIMESTAMP=\"1240907594#4437\"
TYPE=\"STRING\">KHAN001</VALUE>
</ATTR>
</INSTANCE>
<INSTANCE CLASS-NAME=\"USER\"
QUALIFIED-SRC-DN=\"O=CHWIDV\OU=USERS\CN=PHSTEST\"
SRC-DN=\"\CHWIDVTREE\CHWIDV\USERS\PHSTEST\" SRC-ENTRY-ID=\"41175\">
<ATTR ATTR-NAME=\"CN\">
<VALUE NAMING=\"TRUE\" TIMESTAMP=\"1241088851#23\"
TYPE=\"STRING\">PHSTEST</VALUE>
</ATTR>
</INSTANCE>
<INSTANCE CLASS-NAME=\"USER\"
QUALIFIED-SRC-DN=\"O=CHWIDV\OU=USERS\CN=TESTUSERSMART\"
SRC-DN=\"\CHWIDVTREE\CHWIDV\USERS\TESTUSERSMART\"
SRC-ENTRY-ID=\"41112\">
<ATTR ATTR-NAME=\"CN\">
<VALUE NAMING=\"TRUE\" TIMESTAMP=\"1240918270#23\"
TYPE=\"STRING\">TESTUSERSMART</VALUE>
</ATTR>
</INSTANCE>
<INSTANCE CLASS-NAME=\"USER\"
QUALIFIED-SRC-DN=\"O=CHWIDV\OU=USERS\CN=TESTUSERSRC\"
SRC-DN=\"\CHWIDVTREE\CHWIDV\USERS\TESTUSERSRC\" SRC-ENTRY-ID=\"41133\">
<ATTR ATTR-NAME=\"CN\">
<VALUE NAMING=\"TRUE\" TIMESTAMP=\"1240923846#23\"
TYPE=\"STRING\">TESTUSERSRC</VALUE>
</ATTR>
</INSTANCE>
<INSTANCE CLASS-NAME=\"USER\"
QUALIFIED-SRC-DN=\"O=CHWIDV\OU=USERS\CN=TESTVHI\"
SRC-DN=\"\CHWIDVTREE\CHWIDV\USERS\TESTVHI\" SRC-ENTRY-ID=\"41899\">
<ATTR ATTR-NAME=\"CN\">
<VALUE NAMING=\"TRUE\" TIMESTAMP=\"1243176545#1381\"
TYPE=\"STRING\">TESTVHI</VALUE>
</ATTR>
</INSTANCE>
<STATUS LEVEL=\"SUCCESS\"></STATUS>
</OUTPUT>
</NDS>
[05/13/09 01:52:28.236]:GENERIC LOOPBACK ST: TOKEN VALUE:
{<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=ASSOTEST\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\ASSOTEST\" @SRC-ENTRY-ID =
\"41235\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=DAVHALL\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\DAVHALL\" @SRC-ENTRY-ID =
\"41052\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=FODAPPR\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\FODAPPR\" @SRC-ENTRY-ID =
\"38933\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=IMAGETEST\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\IMAGETEST\" @SRC-ENTRY-ID =
\"41185\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=KENZWEILER001\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\KENZWEILER001\" @SRC-ENTRY-ID =
\"41053\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=KHAN001\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\KHAN001\" @SRC-ENTRY-ID =
\"41054\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=PHSTEST\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\PHSTEST\" @SRC-ENTRY-ID =
\"41175\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=SJORDAN\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\SJORDAN\" @SRC-ENTRY-ID =
\"41055\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=TBODZIN\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\TBODZIN\" @SRC-ENTRY-ID =
\"41056\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=TESTUSERSMART\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\TESTUSERSMART\" @SRC-ENTRY-ID =
\"41112\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=TESTUSERSRC\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\TESTUSERSRC\" @SRC-ENTRY-ID =
\"41133\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=TESTVHI\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\TESTVHI\" @SRC-ENTRY-ID =
\"41899\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=TKNIGHT\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\TKNIGHT\" @SRC-ENTRY-ID = \"41057\"}.
[05/13/09 01:52:28.258]:GENERIC LOOPBACK ST: ARG VALUE:
{<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=ASSOTEST\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\ASSOTEST\" @SRC-ENTRY-ID =
\"41235\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=DAVHALL\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\DAVHALL\" @SRC-ENTRY-ID =
\"41052\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=FODAPPR\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\FODAPPR\" @SRC-ENTRY-ID =
\"38933\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=IMAGETEST\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\IMAGETEST\" @SRC-ENTRY-ID =
\"41185\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=KENZWEILER001\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\KENZWEILER001\" @SRC-ENTRY-ID =
\"41053\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=KHAN001\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\KHAN001\" @SRC-ENTRY-ID =
\"41054\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=PHSTEST\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\PHSTEST\" @SRC-ENTRY-ID =
\"41175\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=SJORDAN\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\SJORDAN\" @SRC-ENTRY-ID =
\"41055\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=TBODZIN\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\TBODZIN\" @SRC-ENTRY-ID =
\"41056\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=TESTUSERSMART\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\TESTUSERSMART\" @SRC-ENTRY-ID =
\"41112\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=TESTUSERSRC\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\TESTUSERSRC\" @SRC-ENTRY-ID =
\"41133\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=TESTVHI\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\TESTVHI\" @SRC-ENTRY-ID =
\"41899\",<INSTANCE> @CLASS-NAME = \"USER\" @QUALIFIED-SRC-DN =
\"O=CHWIDV\OU=USERS\CN=TKNIGHT\" @SRC-DN =
\"\CHWIDVTREE\CHWIDV\USERS\TKNIGHT\" @SRC-ENTRY-ID = \"41057\"}.
[05/13/09 01:52:28.285]:GENERIC LOOPBACK ST: ACTION:
DO-SET-LOCAL-VARIABLE(\"COUNT\",SCOPE=\"POLICY\",TOKEN-XPATH(\"COUNT($USERS//INSTANCE)\")).
[05/13/09 01:52:28.287]:GENERIC LOOPBACK ST:
ARG-STRING(TOKEN-XPATH(\"COUNT($USERS//INSTANCE)\"))
[05/13/09 01:52:28.289]:GENERIC LOOPBACK ST:
TOKEN-XPATH(\"COUNT($USERS//INSTANCE)\")
[05/13/09 01:52:28.292]:GENERIC LOOPBACK ST: TOKEN VALUE:
\"0\".
[05/13/09 01:52:28.293]:GENERIC LOOPBACK ST: ARG VALUE:
\"0\".
[05/13/09 01:52:28.294]:GENERIC LOOPBACK ST:POLICY RETURNED:


Wat am I missing??

Could there be a performance issue when I query for say 50000 users?


--
varunece
------------------------------------------------------------------------
varunece's Profile: http://forums.novell.com/member.php?userid=42999
View this thread: http://forums.novell.com/showthread.php?t=378368