Try OpenEdge Now
skip to main content
ABL Reference
Handle Attributes and Methods Reference : XML-ENTITY-EXPANSION-LIMIT attribute
 

XML-ENTITY-EXPANSION-LIMIT attribute

(WebSpeed Only)
Indicates the maximum number of entity substitutions the XML parser (either DOM or SAX) will permit in a XML document sent as a WebSpeed request.
Data type: INTEGER
Access: Readable/Writeable
Applies to: WEB-CONTEXT system handle
By limiting the number of entity substitutions, use of this attribute prevents recursive entities from consuming system resources. The default value is 50,000. The attribute's value must be equal to or greater than 0; setting the attribute to a negative value will result in a runtime error. If the attribute is set to the Unknown value (?), the feature is off.
You can set this behavior globally by using the -entityExpansionLimit startup parameter. The default value of the attribute is set by the startup parameter, but you can change the attribute as needed to override the behavior set by the startup parameter. See the OpenEdge Deployment: Startup Command and Parameter Reference for more information.

What XML-ENTITY-EXPANSION-LIMIT avoids

In WebSpeed, the first time you access the X-document handle or any of its attributes, you trigger a load of the document, which precedes your access. For example, if you set the ENTITY-EXPANSION-LIMIT attribute of X-document (of WEB-CONTEXT) before accessing X-document (of WEB-CONTEXT) or any of its attributes, when the document arrives, WebSpeed first loads the document, then sets ENTITY-EXPANSION-LIMIT to your value. So at load time, ENTITY-EXPANSION-LIMIT might not contain your value, which might cause WebSpeed not to observe the entity expansion limit when resolving entities.
By contrast, if you set XML-ENTITY-EXPANSION-LIMIT instead of ENTITY-EXPANSION-LIMIT, when the document arrives, WebSpeed assigns the value of XML-ENTITY-EXPANSION-LIMIT to ENTITY-EXPANSION-LIMIT before doing anything else. As a result, WebSpeed correctly observes the entity expansion limit.

How to use XML-ENTITY-EXPANSION-LIMIT

In WebSpeed, instead of accessing the ENTITY-EXPANSION-LIMIT attribute of an X-document (of WEB-CONTEXT), access XML-ENTITY-EXPANSION-LIMIT. For example, if you want a WebSpeed application to limit the number of entity expansions for the WEB-CONTEXT:X-DOCUMENT, have the application set the WEB-CONTEXT:XML- ENTITY-EXPANSION-LIMIT attribute before accessing the WEB-CONTEXT:X-DOCUMENT.