473,657 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

restriction problemt, attribute from an nested element

i have 2 abstract type defined:

<xs:complexTy pe name="InputHead erType" id="InputHeader Type"
abstract="false ">
<xs:complexCont ent>
<xs:restricti on base="xs:anyTyp e">
<xs:sequence/>
<xs:attribute name="InputFiel d" type="sg:InputF ieldType"
use="required"/>
<xs:attribute name="keyfield" type="sg:Keyfie ldType"
use="required"/>
<xs:attribute name="FieldX" type="sg:FieldX Type" use="required"/>
</xs:restriction>
</xs:complexConte nt>
</xs:complexType>

<xs:complexTy pe name="OutputHea derType" id="OutputHeade rType"
abstract="false ">
<xs:complexCont ent>
<xs:restricti on base="xs:anyTyp e">
<xs:sequence/>
<xs:attribute name="OutputFie ld" type="sg:Output FieldType"
use="required"/>
<xs:attribute name="keyfield" type="sg:Keyfie ldType"
use="required"/>
<xs:attribute name="FieldY" type="sg:FieldY Type" use="required"/>
</xs:restriction>
</xs:complexConte nt>
</xs:complexType>

<xs:complexTy pe name ="HeaderType ">
<xs:choice>
<xs:element name="InputHead er" type="sg:InputH eaderType"/>
<xs:element name="OutputHea der" type="sg:Output HeaderType"/>
</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 XXInputHeaderTy pe, XXHeaderOutputT ype but i preffer
something like this.

<xs:complexTy pe name="XXHeaderT ype">
<xs:complexCont ent>
<xs:restricti on base="sg:Header Type">
<xs:attribute name="keyfield" type="sg:keyfie ldType"
use="required" fixed="XX"/>
</xs:restriction>
</xs:complexConte nt>
</xs:complexType>

Thanks.
Jul 20 '05 #1
0 1301

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

Similar topics

0
1546
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 from 1 to 50. Each child element is optional (i.e. there don't have to be 50 altogether) but each ID (1-50) may occur only once within the parent element. The best definition I have so far is this: <xs:element name="allPeriodData">...
4
2655
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 value="large"/> <xs:enumeration value="xlarge"/> </xs:restriction> </xs:simpleType>
1
1728
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 elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
4
2293
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 elements which have types that are subsets of the element types in the super-complex type. For example: <xs:element name="A" type="A_Type" abstract="true"/> <xs:element name="B" type="B_Type" abstract="true"/>
3
4030
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> <xs:element name="firstname" type="xs:string"/> </xs:sequence> <xs:attribute name="life" use="optional"> <xs:simpleType>
0
1572
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' referenced in this document. The value for the 'base' attribute is invalid - 'xsd:string' is an invalid value for the 'base' attribute. An error occured at the file:///C:Program Files/Microsoft Visual Studio .NET 2003...
1
1250
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
4050
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 easy: <xs:element name="kirk" minOccurs="0" maxOccurs="1"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="2"/>
3
3841
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" /> </xs:restriction> </xs:simpleContent>
0
8402
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8829
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
8734
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...
1
8508
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8608
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7341
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...
0
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2733
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
1962
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.