00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef VCSN_XML_STRINGS_HXX
00018 # define VCSN_XML_STRINGS_HXX
00019 
00020 # include <vaucanson/misc/contract.hh>
00021 
00022 namespace vcsn
00023 {
00024   namespace xml
00025   {
00026 
00027     
00028 
00029 
00030 
00031     
00032     inline
00033     XMLCh*
00034     transcode (const char* ccp)
00035     {
00036       return xercesc::XMLString::transcode(ccp);
00037     }
00038 
00039     
00040     inline
00041     XMLCh*
00042     transcode (const std::string& s)
00043     {
00044       return transcode (s.c_str());
00045     }
00046 
00047 
00048     inline
00049     std::string
00050     xmlstr(const XMLCh* xmlstr)
00051     {
00052       assertion(xmlstr != 0);
00053 
00054       char* cstr = xercesc::XMLString::transcode(xmlstr);
00055       assertion(cstr != 0);
00056 
00057       std::string ret (cstr);
00058       xercesc::XMLString::release(&cstr);
00059 
00060       return ret;
00061     }
00062 
00063   } 
00064 
00065 } 
00066 
00067 #endif // ! VCSN_XML_STRINGS_HXX