Big comments
Elliotte Harold <[email protected]> Sun, 25 Apr 2004 14:06:38 -0400
| Newsgroups | gmane.text.xml.sax.devel |
|---|---|
| Message-ID | <[email protected]> |
In LexicalHandler, consider the comment() method:
public void *comment*(char[] ch,
int start,
int length)
throws SAXException <cid:[email protected]>
In Java, this char array can contain a theoretical maximum of 2.1
gigabytes of text, in practice probably somewhat less.
What is a parser to do if this limit is exceeded? The spec doesn't say
and it needs to. This is a real possibility in the not too distant
future, and perhaps today. Options are
1. Throw a SAXException
2. Truncate the comment
3. Call comment() multiple times in a row.
For comments, option 3 is probably the cleanest, but it does have the
potential to modify a doucment's infoset and I really don't like that.
There's no other way to get at comment boundaries. Unlike text nodes,
there are boundaries between comments in the document itself.
Any way we go, we should decide something and document it.
--
Elliotte Rusty Harold
-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
List: sax-devel, [email protected]
See: http://www.saxproject.org/
https://lists.sourceforge.net/lists/listinfo/sax-devel