Troubleshooting
Problem
A user encounters an error message: "XPath expression contains '101' operators which exceeds a limit of '100'" while executing an SDF (Service Definition Framework) service that includes an XSL Translator. This error indicates a failure due to "Extra illegal tokens" within the XPath expression, specifically related to an operator limit.
Symptom
This error arises because the XPath expression being processed by the XSLT transformation exceeds a defined limit for the number of operators within a single XPath expression. The Java Development Kit (JDK) enforces these limits to prevent excessively complex or potentially malicious XPath expressions from consuming excessive resources.
The properties that control these limits for XPath expressions in Java (JDK) are:
yfs.jdk.xml.xpathExprGrpLimit: This property defines the maximum number of groups (e.g., expressions enclosed in parentheses) allowed within a single XPath expression.yfs.jdk.xml.xpathExprOpLimit: This property, directly relevant to the observed error, sets the maximum number of operators (e.g.,+,-,*,and,or,=,|,not(), etc.) permitted in a single XPath expression. The default limit is often 100.yfs.jdk.xml.xpathTotalOpLimit: This property specifies the maximum number of operators across all XPath expressions within a single XSLT stylesheet or an entire XML transformation process.
Even if these properties are adjusted to higher values, the persistence of the error suggests that the issue might not solely be related to the limit values, but rather to how the XPath expressions are constructed.
A key indicator in such errors is the presence of the "nullnullnullnullnullnullnullnull" token. This token strongly suggests that the XPath expression is attempting to access a value that is missing, empty, or an element/attribute that does not exist in the input XML at the specified path. This can occur if:
- The input XML data contains missing elements or attributes that the XPath expression expects.
- The XPath expressions are referencing elements or attributes that do not exist in the provided XML structure.
- The XSLT transformation itself is concatenating null or empty values, leading to unexpected tokens.
Resolving The Problem
To resolve this issue, the user to perform the following checks and apply necessary adjustments:
-
Review Input XML Data:
- Thoroughly examine the input XML data being fed into the XSL translator.
- Verify if any expected fields, elements, or attributes that the XPath expressions are attempting to access are missing or are present with unexpected empty values.
-
Implement Null Checks in XSLT:
- Modify the XSLT stylesheet to include explicit null checks (or checks for empty nodes/attributes) for elements or attributes that might occasionally be missing from the input XML.
- Using XSLT functions like
string(),not(),count(), or conditional logic (<xsl:if test="...">,<xsl:choose>) can help gracefully handle missing data and prevent XPath expressions from failing due to attempts to operate on non-existent nodes. - For example, instead of directly accessing
$element/subElement, User might use<xsl:if test="$element/subElement">...</xsl:if>or<xsl:value-of select="string($element/subElement)"/>to convert a potentially missing node to an empty string rather than causing an error.
-
The user can set the following properties in the customer.overrides.properties file.
-
yfs.jdk.xml.xpathExprGrpLimit =<limit needed>
-
yfs.jdk.xml.xpathExprOpLimit =<limit needed>
-
yfs.jdk.xml.xpathTotalOpLimit =<limit needed>
-
Note: To resolve the issue, user can try setting the "yfs.jdk.xml.xpathExprOpLimit = 150 Or value that needed". Setting the value to 0 is not recommended as it will disable the validation.
-
-
Document Location
Worldwide
Product Synonym
IBM Sterling Order Management; oms;
Was this topic helpful?
Document Information
Modified date:
16 July 2025
UID
ibm17236057