We are looking for a way to have C# autogenerate classes from an XSD and create C# namespaces using the namespace info in the XSD.
Doesnt seem like you can create a structured (xxxx.yyyy.zzzz) C# namespace from the XSD?
Is there a trick we're missing?
Thanks
Namespaces are a mechanism for breaking up your schemas. Up until now we have assumed that you only have a single schema file containing all your element definitions, but the XSD standard allows you to structure your XSD schemas by breaking them into multiple files.
So add targetNamespace="http://abcd.com" to your schema element. You want the children of that element (which are all declared as local to the anonymous complex type of the GetInboundResponseGetInboundSMS element) to be unqualified.
XSD is a schema language; you use it to define the possible structure and contents of an XML format. A validating parser can then check whether an XML instance document conforms to an XSD schema or a set of schemas.
targetNamespace defines the namespace for the XML document being defined-- which tags (elements) and which attributes can be used in the XML document being defined in "this" XSD. xmlns=http://www.w3schools.com/schema/schema_schema.asp.
Would this do the trick? the /n allows you to specify a namespace to put the generated class in.
xsd.exe /classes MyXSDInput.xsd /n:MyCsharpNamespace
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With