00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef XML_STRINGS_HH
00018 # define XML_STRINGS_HH
00019
00025 # include <string>
00026 # include <cassert>
00027 # include <xercesc/util/XMLUniDefs.hpp>
00028 # include <xercesc/util/XMLString.hpp>
00029
00030 namespace xml
00031 {
00033 inline std::string xml2str(const XMLCh* xmlstr)
00034 {
00035 assert(xmlstr != 0);
00036
00037 char* cstr = xercesc::XMLString::transcode(xmlstr);
00038 assert(cstr != 0);
00039
00040 std::string ret(cstr);
00041 xercesc::XMLString::release(&cstr);
00042
00043 return ret;
00044 }
00045
00047 inline std::ostream& operator<< (std::ostream& os, const XMLCh* xmlstr)
00048 {
00049 return os << xml2str(xmlstr);
00050 }
00051 }
00052
00053 #endif // ! VCSN_XML_STRINGS_HH