[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: FW: key, generate-id, ignoring my template

Subject: RE: FW: key, generate-id, ignoring my template
From: "Laura Madonna" <Laura.Madonna@xxxxxxxxx>
Date: Mon, 22 Mar 2004 17:15:42 -0700
key generate
That did help, but now I am having trouble getting the children <covrg_desc> to print for each key row-plan_desc-page.
I am only getting the first instance of <covrg_desc> to print for each vBenePlan.
Thank you.
Laura

-----Original Message-----
From: Andreas L. Delmelle [mailto:a_l.delmelle@xxxxxxxxxx]
Sent: Monday, March 22, 2004 3:57 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  FW: key, generate-id, ignoring my template


> -----Original Message-----
> From: Laura Madonna [mailto:Laura.Madonna@xxxxxxxxx]
>
> (I have cut down the xsl and xml).
> The problem is, I don't think the template to match on "page" is working:
>
>

Hi,

No, actually, I believe your problem is the variable definitions.
They return you nodes from the whole document, instead of just the context
node...

It's ok (even obligatory) to have the *key* definitions as children of the
xsl:stylesheet, but you probably want to move the variable declarations into
the matching template, and while you're at it, go for compound keys, like

<xsl:key name="row-plan_desc-page" match="row"
         use="concat(ancestor::page/@name,
           ' ', plan_desc)" />
<xsl:key name="row-heading-page" match="row"
         use="concat(ancestor::page/@name,
           ' ', heading)" />

In combination with:

<xsl:template match="/form/page/pcp">
  <xsl:variable name="vBenePlan"
                select="row[generate-id() = generate-id(
                  key('row-plan_desc-page', concat(
                    ancestor::page/@name,' ',plan_desc)))]" />
  <xsl:variable name="vHeading"
                select="row[generate-id() = generate-id(
                  key('row-heading-page', concat(
                    ancestor::page/@name,' ',heading)))]" />
...

Hope this helps!

Cheers,

Andreas

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.