Import directive

Sep 1, 2009 at 10:47 AM

I use the <xs:import> "directive" to link one xsd to another. For example xsd2.xsd could "import" xsd1.xsd. The problem is that if I launch Xsd2Code for xsd1.xsd it will generate code for the classes xsd2.xsd classes that are used in xsd1.xsd but not for classes from xsd2.xsd that are not used. But I can't generate code for xsd2.xsd because otherwise I would get duplicated classes.

So for example lets say that xsd1.xsd exports the complextypes A and B and xsd2.xsd exports the complextype C that uses the complextype A, I can't generate the .cs for all the three complextypes.



Oct 12, 2009 at 7:34 PM

I'm having a similar problem with the xsd I received from a third party. They're importing xml encryption type and I can't see wwhy xsd2code isn't seeing it. I've placed the imported xsd's in the same folder as the too-be generated one but no tool including this one (it's reeeally awesome by the way) seems to be able to handle it. I keep getting an error message with "Error Type '' is not declared. SubType:Unspecified" message. I'm new to dealing directly with xsd's and dtd's because tools like this are really easy to work with.

Notably, the XML Schema Explorer tool is able to see the imported xmlenc.xsd

Did you have any luck xanatos?