473,390 Members | 1,269 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 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 2274
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: patrik.nyman | last post by:
I have a modular set of xml schemas that are being <include/>d into a master schema. The modules have no target namespace, but `inherit' the namespace of the master schema -- this is the so called...
2
by: Jagadish Babu | last post by:
Hi, Can somebody let me know on how to generate an empty XML instance from XML Schema using Java code or XSLT.
0
by: shruthid | last post by:
can we generate a class for the following xsd file?? it does'nt contain a complex type.. <?xml version="1.0" encoding="UTF-8" ?> <xs:schema...
1
by: shruthid | last post by:
can we generate a class for the following xsd file using xsd.exe?? it does'nt contain a complex type.. <?xml version="1.0" encoding="UTF-8" ?> <xs:schema...
11
by: eb621 | last post by:
Hi, I have an xsl transform to convert xml into another (non-standard) data structure. All is fine until I have an xml file with xmlns atts and then all I get is the element contents output with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.