> I don't understand what you mean here but I suppose it is not important?
 
It's kind of important.  Basically, I learned that if you run into a StackOverflowError when serializing something, it's most likely due to recursion.  To solve the problem, don't do recursion.
 
They mention that this isn't really an implementation problem, but a problem with the serialization protocol, since it is not known what the data structure is before it is created.

> Yes, in serializeNode of BaseMarkupSerializer serializeNode is called
> recursively for the children of an element.
 
In that case, would it be beneficial to consider an additional implementation that is not recursive?

> In our product (not Xerces) we see people with very large documents, but
> never with a depth of 10.000, are you sure this is the most logical way
> to store the data (so is subelement A really 'a part' of parent B in all
> those 10.000 cases?).
 
Maybe, maybe not.  Personally, I wouldn't create such a document.  But I'm creating it for testing purposes. 
I see your point...and 10,000 is an extreme case.  However, this is a consequence of the testing I'm doing.
 
So, in short, would it be wise to consider a non-recursive pre-order traversal of a DOM tree?  (I'm assuming not since I'm probably the only one who has ever asked...)
 
Thanks,
 
Ryan
 

Reply via email to