From nikita_visnevski at hotmail.com Tue Sep 10 16:04:24 2013 From: nikita_visnevski at hotmail.com (Nikita Visnevski) Date: Wed Sep 11 05:52:22 2013 Subject: [xsde-users] XSDE binding for Google Earth KML Message-ID: Hi folks, I am just wondering if anyone succeeded in compiling an XSDE binding for Google Earth kml21.xsd? When I attempt it, I get the following output: kml\kml21.xsd: warning H003: generating aggregate types for 40 global elements kml\kml21.xsd: info: use --root-element-* options to specify document root(s) kml\kml21.xsd:3:203: error: unable to map XML Schema namespace 'http://earth.google.com/kml/2.1' to C++ namespace kml\kml21.xsd:3:203: info: use the --namespace-map or --namespace-regex option to provide custom mapping The first couple I have seen before, except in this case I am not sure which KML element is better suited to be declared as a root. The second problem I am unfamiliar with. Anybody can advise? I am attaching the kml schema and my xsde options file. This is the command I am using to build: C:\src\xml>"%XSDE_ROOT%\bin\xsde.exe" cxx-hybrid --options-file xsde.build.options kml21.xsd Thanks a bunch Nikita -------------- next part -------------- A non-text attachment was scrubbed... Name: kml21.xsd Type: application/octet-stream Size: 31705 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20130910/a65807af/kml21-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: xsde.build.options Type: application/octet-stream Size: 346 bytes Desc: not available Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20130910/a65807af/xsde.build-0001.obj From boris at codesynthesis.com Wed Sep 11 06:10:23 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Sep 11 06:12:00 2013 Subject: [xsde-users] XSDE binding for Google Earth KML In-Reply-To: References: Message-ID: Hi Nikita, Nikita Visnevski writes: > The first couple I have seen before, except in this case I am not sure > which KML element is better suited to be declared as a root. It looks like the root element of all KML documents is called 'kml': --root-element kml > The second problem I am unfamiliar with. Anybody can advise? You need to map the XML namespace to C++ namespace with the help of the --namespace-map, just like suggested by the diagnostics: --namespace-map http://earth.google.com/kml/2.1=kml_2_1 You will also want to turn on polymorphism support with --generate-polymorphic since this schema uses polymorphism. Boris From nikita_visnevski at hotmail.com Wed Sep 11 11:03:00 2013 From: nikita_visnevski at hotmail.com (Nikita Visnevski) Date: Wed Sep 11 11:03:08 2013 Subject: [xsde-users] XSDE binding for Google Earth KML In-Reply-To: References: , Message-ID: Works like a charm. Thanks, Boris. Nikita > Date: Wed, 11 Sep 2013 12:10:23 +0200 > From: boris@codesynthesis.com > To: nikita_visnevski@hotmail.com > CC: xsde-users@codesynthesis.com > Subject: Re: [xsde-users] XSDE binding for Google Earth KML > > Hi Nikita, > > Nikita Visnevski writes: > > > The first couple I have seen before, except in this case I am not sure > > which KML element is better suited to be declared as a root. > > It looks like the root element of all KML documents is called 'kml': > > --root-element kml > > > > The second problem I am unfamiliar with. Anybody can advise? > > You need to map the XML namespace to C++ namespace with the help > of the --namespace-map, just like suggested by the diagnostics: > > --namespace-map http://earth.google.com/kml/2.1=kml_2_1 > > You will also want to turn on polymorphism support with > --generate-polymorphic since this schema uses polymorphism. > > Boris From nikita_visnevski at hotmail.com Wed Sep 11 11:16:42 2013 From: nikita_visnevski at hotmail.com (Nikita Visnevski) Date: Wed Sep 11 11:16:49 2013 Subject: [xsde-users] XSDE binding for Google Earth KML In-Reply-To: References: , Message-ID: Actually I have another problem now trying to compile the generated code in Visual Studio 2010. Never seen this one before: kml21-simpl.cxx 1>c:\oasim\src\cpp\googleearthbridge\datamodel\kml21-simpl.hxx(2837): error C2259: 'kml_2_1::MetadataType_simpl' : cannot instantiate abstract class 1> due to following members: 1> 'void kml_2_1::MetadataType_sskel::any(std::string &,std::string &)' : is abstract 1> c:\oasim\src\cpp\googleearthbridge\datamodel\kml21-sskel.hxx(647) : see declaration of 'kml_2_1::MetadataType_sskel::any' 1> 'void kml_2_1::MetadataType_sskel::serialize_any(void)' : is abstract 1> c:\oasim\src\cpp\googleearthbridge\datamodel\kml21-sskel.hxx(650) : see declaration of 'kml_2_1::MetadataType_sskel::serialize_any' I am trying to figure it out, but so far it does not make any sense. Is the code being generated correctly? Any suggestion is appreciated. Thanks Nikita > Date: Wed, 11 Sep 2013 12:10:23 +0200 > From: boris@codesynthesis.com > To: nikita_visnevski@hotmail.com > CC: xsde-users@codesynthesis.com > Subject: Re: [xsde-users] XSDE binding for Google Earth KML > > Hi Nikita, > > Nikita Visnevski writes: > > > The first couple I have seen before, except in this case I am not sure > > which KML element is better suited to be declared as a root. > > It looks like the root element of all KML documents is called 'kml': > > --root-element kml > > > > The second problem I am unfamiliar with. Anybody can advise? > > You need to map the XML namespace to C++ namespace with the help > of the --namespace-map, just like suggested by the diagnostics: > > --namespace-map http://earth.google.com/kml/2.1=kml_2_1 > > You will also want to turn on polymorphism support with > --generate-polymorphic since this schema uses polymorphism. > > Boris From boris at codesynthesis.com Thu Sep 12 05:11:08 2013 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Sep 12 05:12:45 2013 Subject: [xsde-users] XSDE binding for Google Earth KML In-Reply-To: References: Message-ID: Hi Nikita, Nikita Visnevski writes: > 'void kml_2_1::MetadataType_sskel::any(std::string &,std::string &)' : is abstract You schema contains a wildcard (xs:any) which requires extra handling. Take a look at the 'wildcard' examples in the examples/cxx/hybrid/ and examples/cxx/hybrid/custom/ directories. They show how to deal with xs:any in XSD/e. Boris From nikita_visnevski at hotmail.com Thu Sep 12 11:46:53 2013 From: nikita_visnevski at hotmail.com (Nikita Visnevski) Date: Thu Sep 12 11:47:00 2013 Subject: [xsde-users] XSDE binding for Google Earth KML In-Reply-To: References: , , , Message-ID: Awesome, thanks, Boris. It makes good sense. Nikita > Date: Thu, 12 Sep 2013 11:11:08 +0200 > From: boris@codesynthesis.com > To: nikita_visnevski@hotmail.com > CC: xsde-users@codesynthesis.com > Subject: Re: [xsde-users] XSDE binding for Google Earth KML > > Hi Nikita, > > Nikita Visnevski writes: > > > 'void kml_2_1::MetadataType_sskel::any(std::string &,std::string &)' : is abstract > > You schema contains a wildcard (xs:any) which requires extra handling. > Take a look at the 'wildcard' examples in the examples/cxx/hybrid/ > and examples/cxx/hybrid/custom/ directories. They show how to deal > with xs:any in XSD/e. > > Boris