Are multiple calls to comment() possible for one comment?
Elliotte Rusty Harold <[email protected]>
| Newsgroups | gmane.text.xml.sax.devel |
|---|---|
| Message-ID | <[email protected]> |
In the LexicalHandler interface the comment() method is declared thusly:
public void *comment*(char[] ch,
int start,
int length)
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:
*Parameters:*
|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
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
List: sax-devel, [email protected]
See: http://www.saxproject.org/
https://lists.sourceforge.net/lists/listinfo/sax-devel