From: Elliotte Rusty Harold <elharo@me...> - 2002-08-16 14:43:31
In the LexicalHandler interface the comment() method is declared thusly:
public void *comment*(char ch,
throws SAXException <http://www.saxproject.org/apidoc/org/xml/sax/SAXException.html>
Analogy with the characters() method in ContentHandler suggests that a
very long comment might be split up into multiple calls to comment().
However, the JavaDoc is unclear on this point. The most it says is:
|ch| - An array holding the characters in the comment.|start| - The
starting position in the array.|length| - The number of characters
to use from the array.
The words "the characters in the comment" at least imply that they're
all present in a single call. Still, I'd be more comfortable with a
statement to that effect. In any case, this raises some questions:
1. Do any parsers currently use multiple calls to comment() to report
the content of a single comment?
2. Was there ever a clear intention on this point?
Personally, I find it a lot more convenient to receive the complete
contents of the comment at once, and I've written most of my code under
that assumption. However, I can see that this might cause problems for
some implementers when faced with very long comments.
Either way this is resolved, I think the JavaDoc needs a clearer
statement of what the expected behavior is.
Elliotte Rusty Harold
From: Jeff Rafter <jeffrafter@de...> - 2002-08-16 15:44:19
> Analogy with the characters() method in ContentHandler suggests that a
> very long comment might be split up into multiple calls to comment().
> However, the JavaDoc is unclear on this point. The most it says is:
I remember there being discussion about this point back around the beginning
of 2.1 discussions but I think the outcome was to leave it as is . I know
that AElfred2 does not chunk the comment calls. Also, because there is no
startComment, endComment most serilaizers I can think of would divide the
"chunks" in to separate comments anyway upon serialization. This happens
with characters too but there are no observable boundaries.
XML Development and Developer Web Hosting