From mscaramuzzino at gmail.com Thu Jun 4 03:26:24 2020 From: mscaramuzzino at gmail.com (Mario Scaramuzzino) Date: Thu Jun 4 03:38:53 2020 Subject: [xsd-users] Namespace Problem Message-ID: Dear all, I am trying to generate code from a certain number of XSDs which include other base XSDs. For example: File1.xsd includes base.xsd File2.xsd includes base.xsd FileN.xsd includes base.xsd And I also need to use the file-per-type option. For each File.xsd I have to use a proper namespaces and I do it using the --namespace-map, for example getting different namespaces: File1.xsd -> ns1 FileN.xsd -> nsN To avoid code repetition (the File.xsd are many and also the base.xsd are many files) I would like to generate the base code just one time with a proper namespace (ex. nsBase). Is there a way to generate File.xsd code with the option that the base code already exists with its own namespace? Thanks for the support. From boris at codesynthesis.com Mon Jun 8 09:54:39 2020 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jun 8 10:07:04 2020 Subject: [xsd-users] Namespace Problem In-Reply-To: References: Message-ID: Mario Scaramuzzino writes: > I am trying to generate code from a certain number of XSDs which include > other base XSDs. > > For example: > File1.xsd includes base.xsd > File2.xsd includes base.xsd > FileN.xsd includes base.xsd > > And I also need to use the file-per-type option. > > For each File.xsd I have to use a proper namespaces and I do it using the > --namespace-map, for example getting different namespaces: > File1.xsd -> ns1 > FileN.xsd -> nsN > > To avoid code repetition (the File.xsd are many and also the base.xsd are > many files) I would like to generate the base code just one time with a > proper namespace (ex. nsBase). Is there a way to generate File.xsd code > with the option that the base code already exists with its own namespace? I assume you are using "chameleon inclusion" where base.xsd does not have a namespace and is included into FileN.xsd which do have namespaces. In this case, per the XML Schema spec, all the base.xsd declarations take on the namespace of FileN.xsd. This does result in the generated code bloat and the only way to get rid of it is to change base.xsd to have its own namespace (and import it in FileN.xsd) Note, however, that this may not be semantically equivalent to the original, for example if base.xsd has namespace- qualified elements (and which is the reason why the XSD compiler cannot do this for your automagically). You can search the xsd-users archives for "chameleon" for more information on this topic. From badari.hp at gmail.com Mon Jun 29 05:13:10 2020 From: badari.hp at gmail.com (Badari Prasad) Date: Mon Jun 29 05:27:13 2020 Subject: [xsd-users] Looking for some serializing examples with ##other Message-ID: Hi , I need to serialize a xml , where XSD contains ##other and I need to add another xml defined by an XSD into this xml any. xml any needs to be replaced with *X1Extensions*. I did go through examples in xsd-4.0.0-x86_64-linux-gnu/examples/cxx/tree/order/element/, but could not figure out the right way to add xml data into xml any. Can you kindly provide me with some more info and examples. Thanks Badari From boris at codesynthesis.com Mon Jun 29 09:40:42 2020 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jun 29 09:54:12 2020 Subject: [xsd-users] Looking for some serializing examples with ##other In-Reply-To: References: Message-ID: Badari Prasad writes: > I need to serialize a xml , where XSD contains ##other and I need to > add another xml defined by an XSD into this xml any. See the `wildcard` example in the examples/cxx/tree/ subdirectory of the XSD distribution.