You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Nick Bastin <nb...@opnet.com> on 2004/04/20 00:30:08 UTC

XMLString::fixURI questions

I have two questions related to the use of fixURI:

1) Why does fixURI take a buffer, rather than return you one - how are 
you supposed to know how big the resultant URI is going to be?  I would 
*presume* (although I could be wrong) that fixURI also escapes out 
invalid characters, which means that it's not enough to allocate a few 
extra characters for file:/// (which I see some people doing).  If it 
is just enough to add 9 bytes, then I don't imagine that it actually 
'fixes' the URI completely.

2) How do you allocate a raw XMLCh * to pass in?  Obviously I can just 
malloc() myself some memory, but that didn't seem like the right thing 
- this being C++ and all.  Even pulling that out of allocator seems 
like it should be a mistake, but maybe that's the usage pattern.

Along those lines, is there any reason that XMLCh is a character array, 
and not something like std::string?  It seems like we have C++, so 
using it to avoid having to pass around character buffers seems like a 
good idea.

--
Nick


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org