Byron Campen wrote:
When trying to use the SAXParser::getSrcOffset() call, I'm getting a
runtime exception stating "The current transcoding service does not
support source offset information". I have set the
fgXercesCalculateSrcOfs bool to true, and a little googling seems to
indicate that source offsets are not supported in the
MacOSUnicodeConverter.
Is there some sort of workaround for this? If not, I need to find
another way to solve the following problem:
You can build Xerces-C with the ICU transcoding service, which supports
offsets. You'll need to build a copy of the ICU first, but that
shouldn't be difficult. However, do not build Xerces-C using the ICU as
a message loader, because newer versions of the ICU don't work with
Xerces-C.
When encountering a specific element, I want to be able get the raw
character buffer of everything inside that element (not just the
text-value of the element, the raw buffer containing all descendants and
such; stuff that the characters() callback doesn't give you). I /could/
assemble this buffer piecemeal from the callbacks I get from the parser,
but that would be a really hideous solution.
I have to warn you that source offsets are not well tested. There are
some known bugs in reporting offsets correctly in cases where there are
transcoding errors, but perhaps that won't affect your use case.
Dave