Hi

I am looking to accomplish the following using XSLT code.

When a user gets added, I store a number of results as part of a
structured "Postal Address" attribute in the following format:
a. COMPONENT 1 - Alias ID:
b. COMPONENT 2 - <the Alias ID>
c. COMPONENT 3 - Alias:
d. COMPONENT 4 - <the alais>
e. COMPONENT 5 - Aliaspool:
f. COMPONENT 6 - <the alias pool>

IDM is authoritative for d and f while the application is authoritative
for b. b is more like a GUID which need to be referenced whenver any
follow up operations are performed for (d) for any user.

Here is the XSLT code I have which looks for any (d) being removed and
accordingly tries to get the (b) for the corresponding (d) and (f). All
I want this code to do is get the corresponding (b) for the combination
of (d) and (f) being modified. I am able to read the values from the
source and the values also show up on the trace. However, when I try to
for-each through the result set, it just doesnt get into the loop. I
have also posted the trace after the XSLT. Any help is much
appreciated.

XSLT:

<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet
exclude-result-prefixes="query cmd dncv" version="1.0"
xmlns:cmd="http://www.novell.com/nxsl/java/com.novell.nds.dirxml.driver.XdsCommandProcessor"
xmlns:dncv="http://www.novell.com/nxsl/java/com.novell.nds.dirxml.driver.DNConverter"
xmlns:query="http://www.novell.com/nxsl/java/com.novell.nds.dirxml.driver.XdsQueryProcessor"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><!-- parameters passed
in from the DirXML engine -->
<xslaram name="srcQueryProcessor"/>
<xslaram name="destQueryProcessor"/>
<xslaram name="srcCommandProcessor"/>
<xslaram name="destCommandProcessor"/>
<xslaram name="dnConverter"/>
<xslaram name="fromNds"/>
<!-- identity transformation template -->
<!-- in the absence of any other templates this will cause -->
<!-- the stylesheet to copy the input through unchanged to the output
-->
<xsl:template match="modify">

<xsl:if test="modify-attr[@attr-name = 'hqNPI']/remove-value or
modfiy-attr[@attr-name = 'workforceID']/remove-value or
modify-attr[@attr-name = 'hqNDHPhysicianID']/remove-value or
modify-attr[@attr-name = 'hqPHCPhysicianID']/remove-value or
modify-attr[@attr-name = 'hqVBMCPhysicianID']/remove-value">
<xsl:variable name="hqNPI"
select="'~hqNPI.Custom.Alias.Pool~'"/>
<xsl:variable name="workforceID"
select="'~workforceID.Custom.Alias.Pool~'"/>
<xsl:variable name="hqPHCPhysicianID"
select="'~hqPHCPhysicianID.Custom.Alias.Pool~'"/>
<xsl:variable name="hqNDHPhysicianID"
select="'~hqNDHPhysicianID.Custom.Alias.Pool~'"/>
<xsl:variable name="hqVBMCPhysicianID"
select="'~hqVBMCPhysicianID.Custom.Alias.Pool~'"/>
<xsl:variable name="query-doc">
<query dest-dn="{@src-dn}" scope="entry">
<read-attr attr-name="customAliasRef"/>
</query>
</xsl:variable>

<!-- Instruct the Query Processor to send our Query to the
srcQueryProcessor -->
<xsl:variable name="result"
select="query:query($srcQueryProcessor,$query-doc)"/>
<xsl:message><xsl:value-of select="$result"/></xsl:message>
<xsl:message><xsl:value-of select="$result[1]"/></xsl:message>
<xsl:message><xsl:value-of select="$result[2]"/></xsl:message>
<xsl:message><xsl:value-of select="$result/attr[1]"/></xsl:message>
<xsl:message><xsl:value-of
select="$result/attr/value[1]"/></xsl:message>
<xsl:message><xsl:value-of
select="$result/attr/value/component[1]"/></xsl:message>




<xsl:for-each select="modify-attr[@attr-name = 'hqNPI' or @attr-name =
'workforceID' or @attr-name = 'hqNDHPhysicianID' or @attr-name =
'hqPHCPhysicianID' or @attr-name = 'hqVBMCPhysicianID']">
<xsl:variable name="attrname" select="@attr-name"/>
<xsl:for-each select="remove-value">
<xsl:for-each select="value">
<xsl:variable name="value" select="string(.)"/>
<xsl:message>Values Being Removed</xsl:message>
<xsl:message>Printing Value being removed</xsl:message>
<xsl:message><xsl:value-of select="string(.)"/></xsl:message>
<xsl:for-each
select="$result/attr[@attr-name='customAliasRef']">
<xsl:message><xsl:value-of select="string(.)"/></xsl:message>
<xsl:message>PrintingComponents</xsl:message>
<xsl:message><xsl:value-of select="component[1]"/></xsl:message>
<xsl:message><xsl:value-of
select="component[4]/text()"/></xsl:message>
<xsl:if test="(component[4]/text()=$value) and
(component[6]/text()=$hqVBMCPhysicianID)">
<xsl:variable name="aliasID" select="component[2]/text()"/>
<xsl:message><xsl:value-of select="$aliasID"/></xsl:message>
</xsl:if>
</xsl:for-each>


</xsl:for-each>
</xsl:for-each>
</xsl:for-each>

</xsl:if>


<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>

</xsl:template>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<!-- add your custom templates here -->
</xsl:stylesheet>


--
knagaraj
------------------------------------------------------------------------
knagaraj's Profile: http://forums.novell.com/member.php?userid=44692
View this thread: http://forums.novell.com/showthread.php?t=390510