XSL-1047: (Error) Invalid instantiation…

I was getting the following error: “XSL-1047: (Error) Invalid instantiation of ‘xsl:sort’ in ‘xsl:for-each-group’ context.” while trying to use an xslt stylesheet containing the following construction:

<xsl :for-each-group select="Employee" group-by="Department">
  <xsl :sort select="HireDate" order="ascending" />
  ...
</xsl>

It took me a while to figure out what was wrong. I need to use a newer version of the xml parser. The problem was gone after upgrading the xml parser from version 9.0.4 to version 10.1.0.4.2.

  • Teobond

    From Metalink:

    XML Report Erroring With “oracle.xml.parser.v2.XSLException Invalid instantiation of ‘xsl:variable’ in ‘xsl:for-each-group’ context ” [ID 562643.1]  Modified 13-JUL-2011     Type PROBLEM     Status ARCHIVED  In this Document  Symptoms  Cause  SolutionThis document is being delivered to you via Oracle Support’s Rapid Visibility (RaV) process, and therefore has not been subject to an independent technical review.Applies to:Oracle Application Object Library – Version: 11.5.10.2This problem can occur on any platform.SymptomsWhile trying to run a custom concurrent program (with XML output) it is “Completing With Warning” and request log shows:” Beginning post-processing of request XXXX on node at .Post-processing of request XXXX failed at with the error message:One or more post-processing actions failed. Consult the OPP service log for details.”The OPP log shows the below error:[UNEXPECTED]  oracle.xml.parser.v2.XSLException: :XSL-1047: (Error) Invalid instantiation of ‘xsl:variable’ in ‘xsl:for-each-group’ context.at oracle.xml.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:1376)at oracle.xml.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:483)……….CauseThis is an environment setup issue. The issue is caused by the following setup:AF_CLASSPATH in the autoconfig context file does not include the correct files.The setup causesthe issue because all files are needed for XML to process correctly.Solution– To implement the solution, please execute the following steps::1.Ensure that the AF_CLASSPATH entries in the autoconfig context file have correct references to: dt.jar , tools.jar , charsets.jar , appsborg2.zip etc. Incase these are missing please add them to the AF_CLASSPATH. A sample setting is as follows: AF_CLASSPATH=[JDK_TOP]/lib/dt.jar:[JDK_TOP]/lib/tools.jar:[JDK_TOP]/jre/lib/rt.jar:[JDK13_TOP]/jre/lib/i18n.jar:[JDK_TOP]/jre/lib/charsets.jar:$JAVA_TOP/apsborg2.zip:$ORACLE_HOME/forms60/Java:$JAVA_TOP where [JDK_TOP] is the full path to the JDK installation top directory on Unix. 2. Stop your Apps services. 3. Run autoconfig. 4. Restart the Apps services. 5. Test your custom concurrent programs now.  RelatedProductsOracle E-Business Suite > Applications Technology > Application Object Library > Oracle Application Object LibraryKeywordsAUTOCONFIG; JRE; ORACLE.XML.P