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

Here should go questions about transforming XML with XSLT and FOP.
bingley
Posts: 7
Joined: Sat Aug 18, 2012 2:12 am

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

Post 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
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

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

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply