Jos, XSLT processing and XSL-FO processing are two completely separate steps. FOP simply provides an XML/XSLT input as a convenience for feeding the result of an XSLT transformation that generates an XSL-FO document as its output directly into FOP. The group-by functionality that you're referencing is only available in an XSLT 2.0-capable processor. The only processor at this time that can do XSLT 2.0 is Saxon 8.x+. When running in XML Spy you must be running the Saxon processor while when running FOP you're likely running what ships with it by default - Xalan - which does not understand XSLT 2.0.
If you want to use XSLT 2.0 and want to use the FOP command-line script as your launcher then you'll need to change that script to put Saxon on the classpath instead of Xalan. Sean From: Jos van Roosmalen [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 09, 2008 8:34 AM To: fop-dev@xmlgraphics.apache.org Subject: [FOP0.95]"Group-by" not functioning Hello, I have a problem with FOP. Consider the stripped down minimal Input XML and XSL below. If I run this group.xsl on input.xml using XMLSpy 2005 I get the expected output: <?xml version="1.0" encoding="UTF-8"?> Group found: group1Key Group found: group2Key However if I run it using FOP 0.95 with: fop -xml input.xml -xsl group.xsl -foout test.fo It is complaining about the current-grouping-index(): SystemId Unknown; Line #6; Column #64; function token not found. If I remove that current-grouping-index(), and only print Group Found: <xsl:for-each-group select="item" group-by="[EMAIL PROTECTED]'48']"> Group found </xsl:for-each-group> I expect 2 times "Group found" but I end with an *empty* XML File: <?xml version="1.0" encoding="UTF-8"?> Questions: 1. Why is current-grouping-index() not working? 2. Why is even group-by not working? 3. How to get this working? Thanks you, Jos <?xml version="1.0" encoding="ISO-8859-1"?> <!-- group.xsl --> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:template match="items"> <xsl:for-each-group select="item" group-by="[EMAIL PROTECTED]'48']"> Group found: <xsl:value-of select="current-grouping-key()"/> </xsl:for-each-group> </xsl:template> </xsl:stylesheet> <!-- input.xml --> <items> <item><column index="48" name="mnemo">group1Key</column></item> <item><column index="48" name="mnemo">group1Key</column></item> <item><column index="48" name="mnemo">group2Key</column></item> </items> ---------------------------------------------------------------------- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.