hi Alberto
I do not fill it. XQilla do it somehow in the writer Object:
memtarget = new MemBufFormatTarget(0,dynamic_context->getMemoryManager());
EventSerializer writer("UTF-8", "1.1", memtarget,
dynamic_context->getMemoryManager());
writer.addNewlines(true);
NSFixupFilter nsfilter(&writer, dynamic_context->getMemoryManager());
query->execute(&nsfilter, dynamic_context.get()); //XQQuery
sorry for not explaining every object. I guess the filling happens in
EventSerializer ('writer' object in my code respectively), i found the
constructor in the source of xqilla:
EventSerializer::EventSerializer(char *encoding, char *xmlVersion,
XMLFormatTarget *target, MemoryManager *mm)
: formatter_(encoding, xmlVersion, target, XMLFormatter::CharEscapes,
XMLFormatter::UnRep_CharRef, mm),
elementStarted_(false),
level_(0),
addNewlines_(false)
{
}
formatter is defined as:
XERCES_CPP_NAMESPACE_QUALIFIER XMLFormatter formatter_;
The filling happens, i guess over this method:
void EventSerializer::piEvent(const XMLCh *target, const XMLCh *value)
{
formatter_ << XMLFormatter::NoEscapes << XMLFormatter::UnRep_Fail;
if(elementStarted_) {
elementStarted_ = false;
formatter_ << elem_end;
}
formatter_ << pi_start;
formatter_ << target;
formatter_ << space;
formatter_ << value;
formatter_ << pi_end;
if(addNewlines_ && level_ == 0) {
formatter_ << newline;
}
}
greetings
Affe
-------- Original-Nachricht --------
> Datum: Wed, 09 Apr 2008 10:20:19 +0200
> Von: Alberto Massari <[EMAIL PROTECTED]>
> An: [email protected]
> Betreff: Re: MemBufFormatTarget possible bug
> Affe,
> could you show us how are you filling the MemBufFormatTarget?
>
> Alberto
>
> [EMAIL PROTECTED] wrote:
> > There are still problems with the Constructor initializing. The Buffer
> seems not dependent on the length i am initializing.
> >
> > I am working with XQilla libraries on top of Xercesc. When i initialize
> the Constructor with the memory manager and with 0 length, then it
> functions (hopefully stable now, the buffer is ok for different queries). But
> i do
> not know why there is corrupt buffer if the length is big like 1024 or
> without the second parameter MemoryManager. Maybe someone has the same
> problem.
> >
> > memtarget = new
> MemBufFormatTarget(0,dynamic_context->getMemoryManager());
> >
> > greetings
> > Affe
> >
>
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger