Google Groups no longer supports new usenet posts or subscriptions. Historical content remains viewable.
Dismiss

xsd.exe question

22 views
Skip to the first unread message

Schemer

unread,
19 Nov 2006, 08:44:5719/11/2006
to
Hello,

I am trying to use xsd.(Version 2.0.50727.42) exe to generate classes from a
schema. My schema begins like this:
<?xml version="1.0" encoding="utf-8"?>
<schema targetNamespace="http://www.myCorp.com/wfs"
xmlns:miwfs="http://www.myCorp.com/wfs"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:gml="http://www.opengis.net/gml"
elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://www.opengis.net/wfs"
schemaLocation="http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd" />
<xs:element name="USA" type="miwfs:USA_Type"
substitutionGroup="gml:_Feature" />
<xs:complexType name="USA_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">

When I run
xsd.exe -c -l:c# usa.xsd

I get these errors:
[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
Schema validation warning: Undefined complexType
'http://www.opengis.net/gml:Abstrac
tFeatureType' is used as a base for complex type extension. Line 9, position
14.
Schema validation warning: Reference to undeclared substitution group
affiliation. L
ine 6, position 6.

Warning: Schema could not be validated. Class generation may fail or may
produce inc
orrect results.

Error: Error generating classes for schema 'usa'.
- The datatype 'http://www.opengis.net/gml:AbstractFeatureType' is
missing.

Does the schema need to import the entire gml schema to fix this? Or is
there some other problem?

Thanks for any insight....


Kevin Yu [MSFT]

unread,
19 Nov 2006, 22:23:1019/11/2006
to
Hi Schemer,

In order to include the type in another namespace in another .xsd file, you
have to

1. Import the file using <import>
2. add the source file in the xsd.exe command line, like

xsd importedAttribute.xsd attributeRef.xsd /classes /language:CS

For more information, please check the following links:

http://msdn2.microsoft.com/en-us/library/ew6ts9yw.aspx
http://www.mgbrown.com/PermaLink38.aspx

If anything is unclear, please feel free to let me know.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

0 new messages