473,395 Members | 1,401 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,395 software developers and data experts.

restriction problemt, attribute from an nested element

i have 2 abstract type defined:

<xs:complexType name="InputHeaderType" id="InputHeaderType"
abstract="false">
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:sequence/>
<xs:attribute name="InputField" type="sg:InputFieldType"
use="required"/>
<xs:attribute name="keyfield" type="sg:KeyfieldType"
use="required"/>
<xs:attribute name="FieldX" type="sg:FieldXType" use="required"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="OutputHeaderType" id="OutputHeaderType"
abstract="false">
<xs:complexContent>
<xs:restriction base="xs:anyType">
<xs:sequence/>
<xs:attribute name="OutputField" type="sg:OutputFieldType"
use="required"/>
<xs:attribute name="keyfield" type="sg:KeyfieldType"
use="required"/>
<xs:attribute name="FieldY" type="sg:FieldYType" use="required"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>

<xs:complexType name ="HeaderType">
<xs:choice>
<xs:element name="InputHeader" type="sg:InputHeaderType"/>
<xs:element name="OutputHeader" type="sg:OutputHeaderType"/>
</xs:choice>
</xs:complexType>

I want something as below, but errors appear.
Can i use an attribute from one of the inside element?
I can create XXInputHeaderType, XXHeaderOutputType but i preffer
something like this.

<xs:complexType name="XXHeaderType">
<xs:complexContent>
<xs:restriction base="sg:HeaderType">
<xs:attribute name="keyfield" type="sg:keyfieldType"
use="required" fixed="XX"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>

Thanks.
Jul 20 '05 #1
0 1293

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andy Howden | last post by:
I'm trying to define a schema element (allPeriodData) containing up to 50 different decimal child elements (periodData). Each child element (periodData) identifies itself with an ID having a value...
4
by: scorpion | last post by:
I have a simple type like this: <xs:simpleType name="SizeType"> <xs:restriction base="xs:token"> <xs:enumeration value="small"/> <xs:enumeration value="medium"/> <xs:enumeration...
1
by: Dietmar Gräbner | last post by:
Hi Right now I'm dealing with derivation by restriction and I have some questions concerning the attribute property use in context of the derivation. Consider following Schema: <xs:schema...
4
by: Lars Geldner | last post by:
Hello, I'm searching for a possibility to define a complex type using xml schema that can only be derived by restriction. The sub-complex type should have a content model that only contains...
3
by: nicolaspujol | last post by:
Hi, wondering if anybody could help me figure how to. in schema, restrict the list of tokens I may have as an attribute value. For example <xs:complexType name="customer"> <xs:sequence>...
0
by: Deep Purple | last post by:
I started with the following error... ------------------------------------------------------- An error occured while loading the schema with TargetNamespace 'http://www.w3.org/2001/XMLSchema'...
1
by: vincente13 | last post by:
Hi all, I would like to know if this schema is correct.. ..... ..... <xs:simpleType name="stringtype"> <xs:restriction base="xs:string"/> </xs:simpleType>
1
by: executeinc | last post by:
Could you some help to define 1. An element with restriction on it's base type (xs:string), limiting maxlength 2. That element also needs two attributes defined on it. Simple restriction is...
3
by: Kai Schlamp | last post by:
Hello! In my schema I have the following: <xs:complexType name="textareaType"> <xs:simpleContent> <xs:restriction base="xs:string"> <xs:attribute ref="label" use="required" />...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.