xerces-c-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BRM <bm_witn...@yahoo.com>
Subject Re: XMLString Class and ordinary C-strings
Date Thu, 30 Jul 2009 12:59:58 GMT
See XMLString::transcode(). Works boths ways. Just remember to use XMLString::release() as
well.

char* myCString = "some string";
XMLCh* myXMLString = XMLString::transcode(myCString);
// use it
...
if (myXMLString != NULL) XMLString::release(&myXMLString);

or

...
const XMLCh* myXMLString = someNode->getTagName();
char* myCString = XMLString::transcode(myXMLString);

// use it
...
if (myCString != NULL) XMLString::release(&myCString);

Ben


----- Original Message ----
From: "Rackl, Robert G" <robert.g.rackl@boeing.com>
To: c-users@xerces.apache.org
Sent: Wednesday, July 29, 2009 6:41:26 PM
Subject: XMLString Class and ordinary C-strings

Using the DOMCount sample as a guide, I am developing a module with a
bunch of subroutines to parse and validate an XML file, and then to
extract data from it. The subroutines are to be called from Fortran, and
all output to cerr is to be converted to go to status strings in the
calls from Fortran. I can parse/validate the document by a call from
Fortran. I am stuck at converting ordinary plain ASCII null-terminated
C-strings to XMLStrings and vice versa. How is that done, please?

  -_r4_\.
___`o-#^o`__


Mime
View raw message