=== modified file 'src/com/goldencode/p2j/xml/SaxReaderImpl.java'
--- old/src/com/goldencode/p2j/xml/SaxReaderImpl.java	2024-04-04 14:25:42 +0000
+++ new/src/com/goldencode/p2j/xml/SaxReaderImpl.java	2025-02-20 12:55:20 +0000
@@ -147,6 +147,11 @@
 
    /** Flag indicating if the parser had a prolog error. */
    private boolean prologError = false;
+
+   /**
+    * Entity expansion limit variable
+    */
+   private integer entityExpansionLimit = new integer(50000);
    
    /**
     * Default constructor.
@@ -457,8 +462,7 @@
    @Override
    public integer getEntityExpansionLimit()
    {
-      // TODO
-      return new integer();
+      return new integer(entityExpansionLimit);
    }
 
    /**
@@ -470,8 +474,8 @@
    @Override
    public void setEntityExpansionLimit(int64 limit)
    {
-      // TODO
-   }   
+      setEntityExpansionLimit(new integer(limit));
+   }
 
    /**
     * Set the entity expansion limit.
@@ -482,8 +486,24 @@
    @Override
    public void setEntityExpansionLimit(long limit)
    {
-      setEntityExpansionLimit(new int64(limit));
-   }
+      setEntityExpansionLimit(new integer(limit));
+   }
+
+   @Override
+   public void setEntityExpansionLimit(integer limit)
+   {
+      if (!limit.isUnknown() && limit.intValue() < 0)
+      {
+         String msg = String.format("Attribute ENTITY-EXPANSION-LIMIT must be greater than or equal to" +
+                                    " 0 on %s widget", type());
+         ErrorManager.recordOrShowError(4082, msg, false, true, false);
+         return;
+      }
+
+      this.entityExpansionLimit = limit;
+   }
+
+
    
    /**
     * Indicates if the parser validates the XML document against DTD or not.

=== modified file 'src/com/goldencode/p2j/xml/XDocumentImpl.java'
--- old/src/com/goldencode/p2j/xml/XDocumentImpl.java	2025-02-20 07:54:12 +0000
+++ new/src/com/goldencode/p2j/xml/XDocumentImpl.java	2025-02-20 12:55:20 +0000
@@ -150,6 +150,11 @@
    /** The value of the NONAMESPACE-SCHEMA-LOCATION attribute. */
    private String noNamespaceSchemaLocation = null;
 
+   /**
+    * Entity expansion limit variable
+    */
+   private integer entityExpansionLimit = new integer(50000);
+
    /** The added schema locations, per namespace URI. */
    private Map<String, String> schemaLocations = new HashMap<>();
    
@@ -1747,8 +1752,7 @@
    @Override
    public integer getEntityExpansionLimit()
    {
-      // TODO
-      return new integer();
+      return new integer(entityExpansionLimit);
    }
 
    /**
@@ -1760,8 +1764,28 @@
    @Override
    public void setEntityExpansionLimit(int64 limit)
    {
-      // TODO
-   }   
+      setEntityExpansionLimit(new integer(limit));
+   }
+
+   /**
+    * Set the entity expansion limit.
+    *
+    * @param    limit
+    *           The new value for the attribute.
+    */
+   @Override
+   public void setEntityExpansionLimit(integer limit)
+   {
+      if (!limit.isUnknown() && limit.intValue() < 0)
+      {
+         String msg = String.format("Attribute ENTITY-EXPANSION-LIMIT must be greater than or equal to" +
+                                    " 0 on %s widget", type());
+         ErrorManager.recordOrShowError(4082, msg, false, true, false);
+         return;
+      }
+
+      this.entityExpansionLimit = limit;
+   }
 
    /**
     * Set the entity expansion limit.
@@ -1772,7 +1796,7 @@
    @Override
    public void setEntityExpansionLimit(long limit)
    {
-      setEntityExpansionLimit(new int64(limit));
+      setEntityExpansionLimit(new integer(limit));
    }
 
    /**

=== modified file 'src/com/goldencode/p2j/xml/XmlSchema.java'
--- old/src/com/goldencode/p2j/xml/XmlSchema.java	2021-02-24 16:03:59 +0000
+++ new/src/com/goldencode/p2j/xml/XmlSchema.java	2025-02-20 09:51:08 +0000
@@ -194,4 +194,13 @@
     */
    @LegacyAttribute(name = "ENTITY-EXPANSION-LIMIT", setter = true)
    public void setEntityExpansionLimit(long limit);
+
+   /**
+    * Set the entity expansion limit.
+    *
+    * @param    limit
+    *           The new value for the attribute.
+    */
+   @LegacyAttribute(name = "ENTITY-EXPANSION-LIMIT", setter = true)
+   public void setEntityExpansionLimit(integer limit);
 }
\ No newline at end of file

