This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
what is wrong when separating Muenchian method into two parts?
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] what is wrong when separating Muenchian method into two parts?
- From: "Yang" <sfyang at unisvr dot net dot tw>
- Date: Tue, 27 Mar 2001 08:38:20 +0800
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi,
Please someone help me out of the following problem;
1. I use Muenchian method to get the a unique set of product codes
and save it into the node-set of'"ppcodes".
<xsl:param name="OrderLine" select="//z:row"/>
<xsl:variable name="ppcodes">
<xsl:for-each
select="$OrderLine[generate-id(.)=generate-id(key('prodCode',(@ProductCode))
[1])]">
<pp> <xsl:value-of select="@ProductCode"/></pp>
</xsl:for-each>
</xsl:variable>
2. Then read back each product code from the node-set ($ppcodes) and pass it
to
key('prodCode',.) funtion to access the data.
<xsl:for-each select="msxsl:node-set($ppcodes)/pp">
<xsl:value-of select="."/>
<xsl:value-of select="key('prodCode',.)/@ProductName"/>
</xsl:for-each>
However this plot seems not workable, i.e. I can not get correct
information
from key function. I wonder I have misused Muenchian method somehow?
3. To verify the point I have directed following tests by giving a specific
data
in the key function with following codes,
<xsl:for-each select="msxsl:node-set($ppcodes)/pp">
<xsl:value-of select="."/>
<xsl:value-of select="key('prodCode','000001')/@ProductName"/>
</xsl:for-each>
and found out that;
3-1. when removing out
<xsl:for-each select="msxsl:node-set($ppcodes)/pp">
the key function works normally.
3-2. But when including xsl:value-of, the following key function is
completely ignored.
To me, I am only separating a regular Muenchian method routine into
two parts. However I may get lost
somewhere in basic principle of using this method.
Thanks your helpful input in advance.
Sun-fu Yang,
sfyang@unisvr.net.tw
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list