Carl Christianson wrote:
> I figured I hit a buffer issue and it was just clearing out the buffer. It
> just seemed to me that you would clear the buffer for character data between
> the end of an element and the beginning of the next. I was concerned I
> couldn't discern any pattern to the buffer clearing. i.e. every X records I
> see this happen. It was fairly random.
hi,
when i used SAX first time i found it also not intuitive (so then when i worked on my
parser i have
made sure to get all element content in one event - i think that in 99% case the
argument that it is
better for memory processing is not holding as element content typically are processed
in memory so you
need to reconstruct element content anyway unless you are doing external filtering
such as writing to
file).
if you have entity references (even predefined such as &) or CDATA sections then
those also will
be reported separately, for example using this document:
<test>
Mickey & Mouse <![CDATA[ and Mini ]]>
</test>
i get this as expected:
java sax.DocumentTracer test_misc_content.xml
setDocumentLocator(locator=org.apache.xerces.parsers.AbstractSAXParser$LocatorProxy@867e89)
startDocument()
startElement(uri="",localName="test",qname="test",attributes={})
characters(text="\n Mickey ")
characters(text="&")
characters(text=" Mouse ")
startCDATA()
characters(text=" and Mini ")
endCDATA()
characters(text="\n")
endElement(uri="",localName="test",qname="test")
endDocument()
best,
alek
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]