[xsde-users] hello example parser with std

maxim maxim look2006il at gmail.com
Sat Jul 27 13:33:33 EDT 2013


Thank you Boris. I create some xml file that appropriates to my schema
*.xsd on visual studio, the problem when I'm running it on xsde I see the
error in the above file with the same schema. I don't suceed to understand
why it's happening. My question is how I can compile xsd/e library if I
want to see the source code of library in debugging time?

BR,

Maxim

2013/7/24 Boris Kolpackov <boris at codesynthesis.com>

> Hi Maxim,
>
> maxim maxim <look2006il at gmail.com> writes:
>
> >  std::string contents;
> >  std::ifstream in("hello.xml", std::ios::in | std::ios::binary);
> >   if (in)
> >   {
> >     in.seekg(0, std::ios::end);
> >     contents.resize(in.tellg());
> >     in.seekg(0, std::ios::beg);
> >     in.read(&contents[0], contents.size());
> >     in.close();
> >   }
> > doc_p.parse (contents);
>
> If
>
> doc_p.parse ("hello.xml");
>
> treats its argument as a file name, what do you think this call will
> treat it as?
>
> std::string s;
> ...
> doc_p.parse (s);
>
> I think it is pretty clear it will still treat it as a file name
> (no, calling it 'contents' doesn't help).
>
> If you want to parse a chunk of memory, you can do something like
> this:
>
> std::string s;
> ...
> doc_p.parse (s.c_str (), s.size (), true);
>
> See documentation for more information.
>
> Boris
>


More information about the xsde-users mailing list