iQ xml 4mb limitation

Hi,
so far I have used iqxml and considering the limit of 4mb I need advice on which tool to take and which will replace it the easiest and there are no such limitations.
Of course, it would be great if it supports a similar structure, so I don’t have to change much.

Thanks

String & Cstrings have a max size of 4MB, so if iqXML is using a Cstring, then creating a larger Cstring using NEW(Cstring(StringSize)) becomes an option if you can edit the iqXML source.

CS &CSTRING
StringSize LONG
CODE
StringSize = 0FFFFFFh !16MB
CS &= NEW CSTRING(stringSize)

The problem is, you need to know what the StringSize needs to be first, which you can get by looking at the file size as a rough guide.

GetFileSize function (fileapi.h) - Win32 apps | Microsoft Learn

GetFileSizeEx function (fileapi.h) - Win32 apps | Microsoft Learn

Remarks
Windows Store apps: GetFileSizeEx is not supported. Use GetFileInformationByHandleEx.

Is the 4MB limit something you have run into in practice? It is not mentioned as a limit in the help…

Functionality and Limitations

Max Elements Deep 64
Max Element Name Length 128 characters (ISO)
Max Record Length to File Unlimited When using XML:CreateXMLFile()
Max XML File Size (reading) Unlimited When using XML:LoadFromFile()
Max XML String Size (reading) Unlimited When using XML:LoadFromString()
Max Attributes Per Tag Unlimited <tag attrib1=“1” attrib2=“2” …
Max Field Data Length 10K There are 10240 characters
Quotes Accepted double and single <tag attrib1=“1” or <tag attrib=‘1’
Max Length for Binary Files Unlimited Unlimted for Parsing and Writing

Hi,
I use XML:AddStringText because I need to encode more then one pdf on xml.
Liimitation described in documentation:
If writing to string (XML:CreateXMLString) and the 2nd parameter is False, the maximum string length is 4MB

No metter if I use CS &CSTRING ,and I use it , it write only on 4mb and then stop.

Best regards,

Not sure about iQXML, as I’ve not used it.

As far as a 4MB limit on STRING in Clarion, that limit is only for explicitly declared strings.

e.g.

MyString STRING(YourStringSize)

but if you dynamically create a string, you can go much much larger.

MyString &STRING

   CODE

  MyString &= NEW STRING(BiggerThan4MB)

The only limitation is the memory limit that a 32 bit process allows and whether you are using LARGE_ADDRESS to allow usage of more memory than 2GB.

EasyXML definitely has no such limitations.

I used IQ XML for a while but replaced it with Xfiles a few years back due to its limitations and lack of updates.

https://www.capesoft.com/accessories/xFilessp.htm

Hi Nikola

I have not used IQXML (like others I have used Capesoft’s XFiles for XML) however it would require a rewrite of all your code to change to some other product.

However IQXML is open source (released under MIT license) and available at :

so there is absolutely nothing stopping you from altering its code to meet your requirements.

if you look at XML:AddStringText:

XML:AddStringText    PROCEDURE (Instr,<FixUp>)             ! Declare Procedure

  CODE                                                     ! Begin processed code
      if mod:XMLStringInUse = 2
         if FixUp = True
            OutWriteString = OutWriteString & XML:ConvertToXML(InStr) & Mod:Interm
         elsif FixUp = 2
            OutWriteString = OutWriteString & InStr
         else
            OutWriteString = OutWriteString & InStr & Mod:Interm
         end
      else
         if FixUp = True
            TXT:STANDLINE = XML:ConvertToXML(Instr)
         end
         txt:standline = InStr
         xmll:AddToLastString(True)
      end 

you will see OutWriteString which is defined in the data pad as:

OutWriteString   CSTRING(4096000),THREAD,AUTO

so this is where the limit us coming in.

Rather than use a string of a set arbitrary size, I personally would use StringTheory instead (doing an st.append with ST is much more efficient and is limited only by available memory). But of course you could use SystemStringClass or DynaStringClass or write your own code to make the OutWriteString bigger as both Richard and Jeff have indicated (which is probably the easiest minimal approach requiring least effort).

No matter how you go about removing the 4MB limit, once done you could (if you want to) fork the product and publish the “new improved” version.

hth

Geoff R

1 Like

Just to let you know Nikola that out of interest I made those changes to get around the 4MB OutWriteString limit. It required about 50 or so changes to the code where OutWriteString was used. I replaced it with OutWriteST which is a StringTheory object.

I have not tested it at all as (as I mentioned before) I have never used IQXML. But if you use ST and would like to try this to see if it solves your problem then let me know and I will send it to you. The zipped app is about 250k.

Alternatively you could instead change your code to use one of the third party products that is supported (as Nardus mentioned he did a few years back).

cheers

Geoff R

Yeah, neither does CapeSoft xFiles.

Hi,
Sure I would like to test it. I use StringTheory in this code.

Best regards

see your private email. I have sent zipped app with changes as mentioned above.

cheers

Geoff R

Hi,
I compiled , and works !!! Great job Geoff.

No additional changes needed to implement in my app.

Tnx a lot.
Best regards,
Nikola

1 Like

great - glad it worked ok for you. As a bonus, it should also run a bit quicker.

since Nikola found it worked OK for him and solved his 4MB problem, I have decided to post it here just in case anyone else still uses the product and has the same problem in the future. The procedures changed were:

cheers again

Geoff R
iqxml with use of ST.zip (244.1 KB)

2 Likes