Here’s a basic question that I can’t seem to figure out: I need to import a schema (specifically OFX schema) into .NET and I’m trying to do this with XSD. The schema files are broken up into linked schema files (ie. other schemas are included into the ‘main’ schema file). The schemas work fine when I load them up the into Visual Studio for display. The designer properly shows the schema and all of the related included types.

 

However when I run XSD.EXE against the schema it complains that all the imported schema types are missing and ultimately fails to generate the class(es) for the schema.

 

Looking at XSD.EXE I don’t see anyway to specify the whole lot of files to import and apparently XSD.EXE doesn’t look at the includes which look something like this:

 

<xsd:schema targetNamespace="http://ofx.net/types/2003/04" xmlns:ofx="http://ofx.net/types/2003/04" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

      <xsd:include schemaLocation="OFX_Banking_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_BillPay_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_BillerDelivery_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_BillerDirectory_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_CreditCard_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_Email_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_Image_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_InterTransfer_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_Investment_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_Loan_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_Profile_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_SecuritiesList_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_Signon_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_Signup_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_Tax1098_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_Tax1099_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_TaxW2_Message_Wrappers.xsd"/>

      <xsd:include schemaLocation="OFX_WireTransfer_Message_Wrappers.xsd"/>

      <xsd:complexType name="OFXRequestType">

 

 

Anybody have any idea how I can do this?

 

Also I seem to remember that there’s some way to do the type generation from within Visual Studio without explicitly running XSD. It sure would be nice that once the schema is loaded in VS, to right click generate classes/dataset right out of the designer…