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

Re: Re: [xslt transform & grouping] Using the Muenchia

Subject: Re: Re: [xslt transform & grouping] Using the Muenchian Method?
From: "Ragulf Pickaxe" <jawxml@xxxxxxxxxxx>
Date: Tue, 05 Oct 2004 14:42:57 +0000
xsl param filter
Hi Michael,

I think I see the problem.
When you use:
<xsl:param name="filter" select="food"></xsl:param> no elements are mached (you have no food elements at top level).
This means that in this expression:
<xsl:for-each select="Document[@filter=$filter]/Article[count(.|key('by-info',@info)[1])=1]">
you predicate (filter) evaluates to false, that is [@filter=$filter] is false.
I think therefore that your processor stops there and does not evaluate the second predicate
[count(.|key('by-info',@info)[1])=1].
Net result of this is that no elements are chosen in your for-each and therefore there is no output between <document> and </document>


When you did, as David Carlisle suggested, change your top-level param to:
<xsl:param name="filter" select="'food'"></xsl:param> the first predicate returns true (at least for some of the elements).
Then the second predicate _will_ be evaluated (in those case where the first is true). As you have not defined the key (by-info), the processor chokes on this [count(.|key('by-info',@info)[1])=1].


Therefore you need to both change your top-level param to <xsl:param name="filter" select="'food'"></xsl:param> and add a definition of your key at your top-level (see earlier post from DC).

I hope that this helps.

Regards,
Ragulf Pickaxe :-)

Listen,

I think that we're going back and forth here.


when this line is used:


<xsl:param name="filter" select="'food'"></xsl:param>

this error is generated:

"Exception Details: System.NullReferenceException: Object reference not set to an instance of an object."

but when i use

<xsl:param name="filter" select="food"></xsl:param>

there is no error.

OK ?

Now,

When everything works without errors, generated XML output is:

<Documents></Documents>

instead of the required elements.

THat is, some expression must be wrong.

[snip]

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail


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.