Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

xsd.exe Bug (Constraints on Attribute Declaration Schema Components)

$
0
0

I'm trying to use xsd.exe to generate a schema for this class.

 

Code Snippet

publicclassTest

{

    [

XmlAttribute(AttributeName = "noNamespaceSchemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")]

    publicstring noNamespaceSchemaLocation;

}

 

When xsd.exe attempts to generate the schema, it fails.

 

Error: There was an error processing 'XmlTest.exe'.
   - Schema item 'attribute' named 'noNamespaceSchemaLocation' from namespace 'http://www.w3.org/2001/XMLSchema-instance'. The target namespace of an attribute declaration, whether local or global, must not match
http://www.w3.org/2001/XMLSchema-instance.
   - The target namespace of an attribute declaration, whether local or global, must not match
http://www.w3.org/2001/XMLSchema-instance.

 

I checked the specification (http://www.w3.org/TR/xmlschema-1/#coss-attribute) and noticed a slight difference--my emphasis in bold.

 

The {target namespace} of an attribute declaration, whether local or top-level, must not match http://www.w3.org/2001/XMLSchema-instance (unless it is one of the four built-in declarations given in the next section).

 

The noNamespaceSchemaLocation attribute is one of the declartions referenced in the "next section". Is this a bug in xsd.exe? Is there a fix available?


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>