When the parser expands an entity, the text node before the entity while
not be null-terminated. That's one I know of, but there are probably
others.
Why don't you test for null-termination and only copy when you have to?
Dave
|---------+--------------------------->
| | Marcus Ackermann|
| | <Marcus.Ackerman|
| | [EMAIL PROTECTED]> |
| | |
| | 04/23/2002 11:49|
| | PM |
| | Please respond |
| | to xerces-c-dev |
| | |
|---------+--------------------------->
>---------------------------------------------------------------------------------------------------------------------------|
|
|
| To: [EMAIL PROTECTED]
|
| cc: (bcc: David N Bertoni/Cambridge/IBM)
|
| Subject: null termination of DOMStrings
|
>---------------------------------------------------------------------------------------------------------------------------|
Hi,
the documentation of DOMString::rawBuffer() says that the returned buffer
is
not always null terminated. This implies that the buffer has to be copied
and a null character has to be appended to that copy of the buffer for
further use.
I would like to skip this copying for performance reasons. What does "not
always null terminated" mean? In which cases is the buffer definitely null
terminated?
I only want to use this to obtain the value and name from a DOM_Node using
the functions DOM_Node::getNodeValue() and DOM_Node::getNodeName(). Is the
rawBuffer() of the thus obtained DOMString always null terminated? I tested
this with a simple application, and the result was that all rawBuffers were
null terminated.
Example
DOM_Node xmlNode;
[...]
XMLCh* pStr = xmlNode.getNodeName().rawBuffer()
For each node of the tested XML strings pStr was null terminated.
Thanks
Marcus
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]