Hi Tobias,
This has always been a problem. Originally, I wanted to define a very
minimal interface for a string class, call it XalanDOMString, and use that
class. The problem was I could not really get anyone to agree on what the
minimal interface should be. For example, making the characters available
as a null-terminated array of characters, like std::basic_string::c_str()
is almost a necessity, because we are forced to interoperate with the
Xerces-C SAX classes, which use null-terminated arrays of characters.
Unfortunately, I don't think that's a very good design principle for an
abtract base class. Also, I'm a little concerned about performance
problems with lots of extra virtual function class on XalanDOMString.
Unfortunately, I don't believe there's any way we can move to just using a
null-terminated array of characters, like the Xerces-C DOM interfaces use.
However, if you would like to make a proposal for a minimal string class,
we can certainly have a discussion about that class, and, if we can come to
a consensus, we could move to a new set of interfaces in Xalan-C 2.0.
Dave
Tobias Sch�tte
<[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>
cc: (bcc: David N
Bertoni/Cambridge/IBM)
12/22/2003 06:11 Subject: Xalan-C: Overriding XalanDOM -
XalanDOMString
PM
Please respond
to xalan-dev
hi,
the whole Xalan-C XalanDOM classes are abstract and implemented for
example by the XalanSourceTree classes except XalanDOMString surely
because of performance.
But if the node data must be wrapped by an underlying in-memory
representation to XalanDOMString references, for example the conversion
from const XMLCh* to const XalanDOMString& in XercesParserLiaison done
by XercesDocumentBridge's XalanDOMStringPool, in worst case the data
must be copied each time to fit into the XalanDOMString vector model,
often there are many equal strings like names, etc. that can be cached
and reused, but double memory allocation or a cache lookup/string
compare overhead is always there.
I found a discussion about overriding the XalanDOM Tree structures at
http://marc.theaimsgroup.com/?l=xalan-dev&m=98403644905890&w=2, but my
question is how to effectively override the XalanDOM's String class, any
suggestion?? to do this, i think the data representation of the string
class must virtual.
mfg/regards
Tobias