[xsd-users] xsd cxx-tree

ss ak ssak22 at gmail.com
Thu Nov 5 14:47:51 EST 2009


Generated the code using the below command

xsd cxx-tree --generate-serialization --generate-ostream
--generate-default-ctor --root-element Event --generate-xml-schema
--generate-from-base-ctor c:\Event.xsd


this worked well..when i didnt have namespcae in xsd...now i have a seg
fault errors...
here is the code i m using to make an xml from object and back to xml as
string...

is there any other way i cna do it.....please let me know what is wrong
here...
when i use a debugger...b*reaks here
--->>>>>>>>>>\cxx\tree\serialization.txx
*

    printf("\n XML string ");
      bool validxml=true;
        string xsd = "Event.xsd";
          xml_schema::namespace_infomap map;
        map[""].name = "http://www.mycompany.com/event";
        map[""].schema = xsd.c_str();

        try
        {
        std::ostringstream oss;
        printf("\n inside try 000000 <%s> ",var.CustomerName()->c_str());
        DMPEvent_(oss, varevent, map);
        printf("\n inside try 11111");       *--------->I DONT GET THIS
PRINTF  *
        std::string xml(oss.str ());
       printf("\n inside try 222222");
       std::istringstream iss (xml);
        xml_schema::properties props;
        props.no_namespace_schema_location(xsd.c_str());
        Event_(iss, xml_schema::flags::keep_dom,props);
        printf("\n XML %s",xml.c_str());
        }
        catch (const xml_schema::exception& e)
        {
            //log(0,"PImer",strcat("XML INVALID ",e.what()));
            fail(strcat("XML INVALID ",e.what()));
            //exit(0);
        }

any help is great...

Thanks,ss


More information about the xsd-users mailing list