Page 1 of 1

Do element(s) sorted on need to be in the output?

Posted: Thu Aug 30, 2012 8:29 pm
by bingley
Greetings.

I was having no success sorting a large input document on a specific element's attribute -- until I added an xsl:value-of element to the stylesheet just to see if the XPath for the sort was correct. It worked. If the value of that element and attribute was included in the output document, the sort was launched.

Trouble is, I don't want the data I'm sorting on to actually appear in the output. I just want to sort on it. Must a node that is used for sorting be included in the output?

Thank you.

bingley

Re: Do element(s) sorted on need to be in the output?

Posted: Thu Sep 06, 2012 5:51 pm
by adrian
Hi,

So, what do you want to do with the sorted content, if you're not outputting it?
Do you somehow process it?
Note that some transformation engines (e.g. Saxon 9) ignore unused variables and parameters and never initialize them.

I guess you could use an xsl:message and it would be just the same.

Regards,
Adrian