DOMDocument Size limit

This is a discussion on DOMDocument Size limit within the PHP General forums, part of the PHP Programming Forums category; When calling |->createElement($name, $value) My content is truncated to around 4k. If what is in $value is less ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-18-2006
Chris W
 
Posts: n/a
Default DOMDocument Size limit

When calling |->createElement($name, $value) My content is truncated to
around 4k. If what is in $value is less than 4000 bytes then it works
fine but if it is more, the data is truncated. Is there a setting I
don't know about that will change that limit? I need it to be more like
100k or maybe even more.|

--
Chris W
KE5GIX

"Protect your digital freedom and privacy, eliminate DRM,
learn more at http://www.defectivebydesign.org/what_is_drm"

Gift Giving Made Easy
Get the gifts you want &
give the gifts they want
One stop wish list for any gift,
from anywhere, for any occasion!
http://thewishzone.com
Reply With Quote
  #2 (permalink)  
Old 12-19-2006
Chris W
 
Posts: n/a
Default Re: [PHP] DOMDocument Size limit

Jochem Maas wrote:
> what version of php? what version of libxml?
>

php: 5.2.0
libxml: 2.6.26
> is the limit actually 4096 bytes per chance? (that seems more likely)


the limit is probably 4096 but I think it may be due to the length of
tags and other things not just the value.
> what happens when you create the element with an empty value then use
> something like this?:
>
> $el = $foo->createElement($name, '');
> $el->nodeValue = $yourBigString;
>


Same thing happened there
> also are you able to use $foo->createElementNS() ? does that suffer from the same limit?
>
>


I'm not familiar enough with the how this dom works to make that
modification. I didn't write this code I'm just trying to fix it.


> could it be a problem with the actual contents of your $value variable?
> what does it contain? (especially around the 4K bytes mark)
>


the variable contains htmlspecialchars encoded html. The next character
after it stops is either a space or a period.
> I tried in vain to find something in the php source that might
> point to your problem.. that's not to say there is nothing there, it's just my
> skills/understanding aren't up to the job.
>
>

I looked for something in the php.ini file but the only thing I found
was output_buffering = 4096 and that doesn't seem like it would be a
problem.

--
Chris W
KE5GIX

"Protect your digital freedom and privacy, eliminate DRM,
learn more at http://www.defectivebydesign.org/what_is_drm"

Gift Giving Made Easy
Get the gifts you want &
give the gifts they want
One stop wish list for any gift,
from anywhere, for any occasion!
http://thewishzone.com
Reply With Quote
  #3 (permalink)  
Old 12-19-2006
Jochem Maas
 
Posts: n/a
Default Re: [PHP] DOMDocument Size limit

Chris W wrote:
> Jochem Maas wrote:
>> what version of php? what version of libxml?
>>

> php: 5.2.0
> libxml: 2.6.26


nothing wrong there I believe, although I haven't yet played with php5.2 myself

>> is the limit actually 4096 bytes per chance? (that seems more likely)

>
> the limit is probably 4096 but I think it may be due to the length of
> tags and other things not just the value.
>> what happens when you create the element with an empty value then use
>> something like this?:
>>
>> $el = $foo->createElement($name, '');
>> $el->nodeValue = $yourBigString;
>>

>
> Same thing happened there
>> also are you able to use $foo->createElementNS() ? does that suffer
>> from the same limit?
>>
>>

>
> I'm not familiar enough with the how this dom works to make that
> modification. I didn't write this code I'm just trying to fix it.
>
>
>> could it be a problem with the actual contents of your $value variable?
>> what does it contain? (especially around the 4K bytes mark)
>>

>
> the variable contains htmlspecialchars encoded html. The next character


this last comment leads me to believe that the data in $value (your html)
should be contained in a CDATA node, in which case you should be
using the following to create a the CDATA node and add $value to that, after
which you can add the CDATA node to the node your are currently trying to
add $value to:

http://php.net/manual/en/function.do...atasection.php

> after it stops is either a space or a period.
>> I tried in vain to find something in the php source that might
>> point to your problem.. that's not to say there is nothing there, it's
>> just my
>> skills/understanding aren't up to the job.
>>
>>

> I looked for something in the php.ini file but the only thing I found
> was output_buffering = 4096 and that doesn't seem like it would be a
> problem.


agreed - but in the spirit of Murphy it's worth setting it to something
bigger to see if it has affect.

>

Reply With Quote
  #4 (permalink)  
Old 12-19-2006
Bernhard Zwischenbrugger
 
Posts: n/a
Default Re: [PHP] DOMDocument Size limit

Hi

> When calling |->createElement($name, $value) My content is truncated to
> around 4k. If what is in $value is less than 4000 bytes then it works
> fine but if it is more, the data is truncated. Is there a setting I
> don't know about that will change that limit? I need it to be more like
> 100k or maybe even more.|


I can't see a 4k limit.
Here an example:

http://lamp2.fh-stpoelten.ac.at/%7El...pport/test.php
http://lamp2.fh-stpoelten.ac.at/%
7Elbz/beispiele/ws2006/support/test.phps

Maybe you use GET Variables, GET Variables are limited to 4k

Bernhard
Reply With Quote
  #5 (permalink)  
Old 12-20-2006
tedd
 
Posts: n/a
Default Re: [PHP] DOMDocument Size limit

At 9:59 AM +0100 12/19/06, Bernhard Zwischenbrugger wrote:
>Hi
>
>> When calling |->createElement($name, $value) My content is truncated to
>> around 4k. If what is in $value is less than 4000 bytes then it works
>> fine but if it is more, the data is truncated. Is there a setting I
>> don't know about that will change that limit? I need it to be more like
>> 100k or maybe even more.|

>
>I can't see a 4k limit.
>Here an example:
>
>http://lamp2.fh-stpoelten.ac.at/%7El...pport/test.php
>http://lamp2.fh-stpoelten.ac.at/%
>7Elbz/beispiele/ws2006/support/test.phps
>
>Maybe you use GET Variables, GET Variables are limited to 4k
>
>Bernhard


Bernhard:

The limit depends upon the server. I did an experiment and my server
will take 7000 characters, but not 8000. So, for me the limit is
somewhere in between.

tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:18 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0