472,124 Members | 1,391 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,124 software developers and data experts.

xsd.exe (version 1.1) can't deal with <xs:annotation>?

SA
Hi all,

in the following situation:

<xs:element name="Type">

<xs:simpleType>

<xs:restriction base="xs:NMTOKEN">

<xs:enumeration value="I"/>

<xs:enumeration value="J"/>

<xs:enumeration value="P">

<xs:annotation>P will occur for Primary.</xs:annotation>

</xs:enumeration>

<xs:enumeration value="S">

<xs:annotation>S will occur for Secondary.</xs:annotation>

</xs:enumeration>

</xs:restriction>

</xs:simpleType>

</xs:element>

which is part of an otherwise valid Schema, xsd.exe fails to generate the
class because of the text in the <xs:annotation> elements.

Is this behavior correct?

--
Sven.
Nov 12 '05 #1
2 2199
"SA" <in*********@freemail.nl> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
<xs:enumeration value="P">
<xs:annotation>P will occur for Primary.</xs:annotation>
</xs:enumeration> : : which is part of an otherwise valid Schema, xsd.exe fails to generate the
class because of the text in the <xs:annotation> elements.

Is this behavior correct?


I believe the <xs:annotation> element is not valid (e.g., xsd is correct), because
the definition of an annotation's content model is:

( appinfo | documentation )*

not character data (i.e., <xs:annotation> cannot contain an immediate child text node).

See XML Schema 1.0 Part 1 Section 3.13.2,

http://www.w3.org/TR/2004/REC-xmlsch...are-annotation

Try putting the text into an <xs:documentation> child element, like this,

<xs:enumeration value="P">
<xs:annotation>
<xs:documentation>P will occur for Primary.</xs:documentation>
</xs:annotation>
</xs:enumeration>
Derek Harmon
Nov 12 '05 #2
SA
Derek:

That was it indeed.

Not a Schema expert myself, I had to deal with the schema that was handed to
me by a vendor.

Thanks,

--
Sven.

"Derek Harmon" <lo*******@msn.com> wrote in message
news:#y**************@TK2MSFTNGP15.phx.gbl...
"SA" <in*********@freemail.nl> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
<xs:enumeration value="P">
<xs:annotation>P will occur for Primary.</xs:annotation>
</xs:enumeration>

: :
which is part of an otherwise valid Schema, xsd.exe fails to generate the class because of the text in the <xs:annotation> elements.

Is this behavior correct?


I believe the <xs:annotation> element is not valid (e.g., xsd is correct),

because the definition of an annotation's content model is:

( appinfo | documentation )*

not character data (i.e., <xs:annotation> cannot contain an immediate child text node).
See XML Schema 1.0 Part 1 Section 3.13.2,

http://www.w3.org/TR/2004/REC-xmlsch...are-annotation
Try putting the text into an <xs:documentation> child element, like this,

<xs:enumeration value="P">
<xs:annotation>
<xs:documentation>P will occur for Primary.</xs:documentation>
</xs:annotation>
</xs:enumeration>
Derek Harmon

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by patrik.nyman | last post: by
11 posts views Thread by eb621 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.