[xsd-users] Error in compilation and question about parsing

Boris Kolpackov boris at codesynthesis.com
Tue May 20 19:09:16 EDT 2014


Hi Sabitha

sabitha reddy <sabitha.reddi at gmail.com> writes:

> We create Hosts object by sending xml file name as input[argv[1]. Instead
> is there a way I can do it by sending my xml data as char string and not by
> writing it to file and passing file name?

Yes, you can, for example, use std::istringstream. See Chapter 5, "Parsing"
in the C++/Tree Mapping Getting Started Guide:

http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#5


> And also, my test program worked only after I specified the XSD file
> path in input xml file as follows:
> 
> <hosts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xsi:noNamespaceSchemaLocation="hosts_file.xsd">
> 
> Is there any way I can avoid this?

Yes, see Section 5.1, "XML Schema Validation and Searching" in the
C++/Tree Mapping Getting Started Guide:

http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#5.1

As you can see, your questions are already answered in the documentation.
In the future, please consult it before posting questions to the mailing
list.

Boris



More information about the xsd-users mailing list