473,805 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

SA
Hi all,

in the following situation:

<xs:element name="Type">

<xs:simpleTyp e>

<xs:restricti on base="xs:NMTOKE N">

<xs:enumerati on value="I"/>

<xs:enumerati on value="J"/>

<xs:enumerati on value="P">

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

</xs:enumeration>

<xs:enumerati on 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:annotatio n> elements.

Is this behavior correct?

--
Sven.
Nov 12 '05 #1
2 2301
"SA" <in*********@fr eemail.nl> wrote in message news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
<xs:enumerati on 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:annotatio n> elements.

Is this behavior correct?


I believe the <xs:annotatio n> 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:annotatio n> 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:documentati on> child element, like this,

<xs:enumerati on value="P">
<xs:annotatio n>
<xs:documentati on>P will occur for Primary.</xs:documentatio n>
</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******** ******@TK2MSFTN GP15.phx.gbl...
"SA" <in*********@fr eemail.nl> wrote in message news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
<xs:enumerati on 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:annotatio n> elements.

Is this behavior correct?


I believe the <xs:annotatio n> 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:annotatio n> 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:documentati on> child element, like this,

<xs:enumerati on value="P">
<xs:annotatio n>
<xs:documentati on>P will occur for Primary.</xs:documentatio n>
</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
1644
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 Chameleon design. The master schema in its turn is <import/>ed into other schemas with different namespaces. Now, in the modules I'd like to use Schematron rules. Problem is, these do not seem to inherit the target namespace of the master...
2
1933
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
1452
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 targetNamespace="http://www.sonatacentral.com/service/v20" xmlns:sc="http://www.sonatacentral.com/service/v20" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:simpleType name="ExpenseGroup"> <xs:annotation>...
1
7953
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 targetNamespace="http://www.sonatacentral.com/service/v20" xmlns:sc="http://www.sonatacentral.com/service/v20" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:simpleType name="ExpenseGroup"> <xs:annotation>...
11
6684
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 none of the tagging that I have written in. Remove the xmlns atts from the xml and all is fine. I’ve tried adding in the xmlns from the xml into the xsl:stylesheet element of the xsl but get the same result. This is the same run on xmlspy and with...
0
9596
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10356
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9179
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7644
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5676
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.