I am also using xerces to parse the xml. But now i need the xml contents
to be as std::string
I have trying to compile this code i found somewhere else:
std::ifstream ifs("file.xml");
std::string file_string( std::istreambuf_iterator<char>(ifs),
std::istreambuf_iterator<char>() );
but get this error:
: error C2664: '__thiscall std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char>[color=blue]
>::std::basic_string<char,struct std:[/color]
:char_traits<char>,class std::allocator<char> >(const char *,unsigned
int,const class std::allocator<char> &)' : cannot convert parameter 1
from 'class std::istreambuf_iterator<char,struct std::char_traits<char>[color=blue]
>' to 'const char *'[/color]
No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called
I am using VC6.0 compiler
Thx in advance.
sat wrote:[color=blue]
> The most preferred method is to use Xerces library..
>
> check the tutorial at..
>
>
http://www-128.ibm.com/developerwork...brary/x-xercc/
>
>
> bye
> sat
>
>
> "Khuong Dinh Pham" <khuongdp@gmail.com> wrote in message
> news:434b8d8e$0$84028$edfadb0f@dtext01.news.tele.d k...
>[color=green]
>>How do i read the contents of a xml file and output it to a std::string.
>>
>>Thx in advance[/color]
>
>
>[/color]