Re: [xsl] Looking Not Working for No Obvious Reason

Subject: Re: [xsl] Looking Not Working for No Obvious Reason
From: "Eliot Kimber" <ekimber@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 20 Jun 2007 15:10:29 -0500
Kimber, Eliot wrote:
David Carlisle wrote:
 >> I must be doing something wrong but I can't figure out what it might
 >> be--the fact that some input values work and others don't is odd.

It must be my bug somewhere in my calling sequence or function declarations.

I set up the key-based approach suggested by David and Mike and verified that the keys will return the right value for my data using this sort of debugging report:

Long to short title map:
<xsl:for-each-group select="$resolvedDoc//section/title" group-by=".">
<xsl:variable name="baseTitle" select="string(current-group()[1])"/>
<xsl:message> - "<xsl:sequence select="$baseTitle"/>" - "<xsl:sequence select="(key('sectionLongToShortTitleMap', $baseTitle, $sectionTitleMap)[1]/shorttitle, $baseTitle)[1]"/>"</xsl:message>

But my actual functions still refuse to return the correct values, so it must be something stupid on my end.

Thanks for the help: I did learn something new, namely the (x,y)[1] idiom for getting a fallback value for a check that might fail.



W. Eliot Kimber
Professional Services
Innodata Isogen
8500 N. Mopac, Suite 402
Austin, TX 78759
(214) 954-5198


Current Thread