How to fix the Oracle error LPX-00323: illegal apply-imports because of no current template: ~s?

In this post, you’ll learn more about the Oracle ErrorLPX-00323: illegal apply-imports because of no current template: ~s with the details on why you receive this error and the possible solution to fix it.

Oracle Error Description

LPX-00323: illegal apply-imports because of no current template: ~s

Reason for the Error LPX-00323: illegal apply-imports because of no current template: ~s

Cause: apply-imports was used even when there was no current template possibly with in for-each.

How to fix the Error LPX-00323: illegal apply-imports because of no current template: ~s ?

You can fix this error in Oracle by following the below steps

Action: Make sure that apply-imports are invoked only if there is a current template and it is not in a xsl:for-each.