469,364 Members | 2,332 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,364 developers. It's quick & easy.

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 2134
"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.

By using this site, you agree to our Privacy Policy and Terms of Use.