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

simpleType Question

Is this correct?

I am representing my database in an XML schema, but I am not just naming an
element=database field. But some of my IDs (i.e. USER_ID, and PROFILE_ID)
are not the same length in numbers. They are defined in the database as
NUMBERPS(2,0), NUMBERPS(3,0),...,NUMBERPS(8,0). Therefore in my complexTypes
should my ID/Identity fields use a simpleType with the limiting facets.

For example:

<xs:complexType name="application">
<xs:sequence>
<xs:element name="app_id" type="id4" />
<xs:element name="enabled_ind" type="indicator" />
<xs:element name="application_desc" type="xs:string"/>
<xs:element name="application_guid" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="id4">
<xs:restriction base="xs:int">
<xs:minInclusive value="1" />
<xs:totalDigits value="4" />
<xs:maxExclusive value="9999" />
</xs:restriction>
</xs:simpleType>

Is this good design, too restrictive, or what? My database cannot accept
something different, therefore I would assume, I should be strict.
--
Mike Logan
Nov 12 '05 #1
1 1110
Yes you can use such a restriction. In this particular case you do not need
to have a maxEx facet since you already defined the min and totalDigits.

"Mike Logan" <Mi*******@community.nospam> wrote in message
news:FE**********************************@microsof t.com...
Is this correct?

I am representing my database in an XML schema, but I am not just naming an element=database field. But some of my IDs (i.e. USER_ID, and PROFILE_ID)
are not the same length in numbers. They are defined in the database as
NUMBERPS(2,0), NUMBERPS(3,0),...,NUMBERPS(8,0). Therefore in my complexTypes should my ID/Identity fields use a simpleType with the limiting facets.

For example:

<xs:complexType name="application">
<xs:sequence>
<xs:element name="app_id" type="id4" />
<xs:element name="enabled_ind" type="indicator" />
<xs:element name="application_desc" type="xs:string"/>
<xs:element name="application_guid" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="id4">
<xs:restriction base="xs:int">
<xs:minInclusive value="1" />
<xs:totalDigits value="4" />
<xs:maxExclusive value="9999" />
</xs:restriction>
</xs:simpleType>

Is this good design, too restrictive, or what? My database cannot accept
something different, therefore I would assume, I should be strict.
--
Mike Logan

Nov 12 '05 #2

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

Similar topics

2
by: Ian Griffiths | last post by:
I have been given a schema, instances of which I'm required to be able to consume and generate. I'd like to be able to manipulate these instances as DataSets internally in my application. The...
0
by: Codex Twin | last post by:
hello group: The following is a fragment from a schema which defines the EWethnicCategoryStructure type. As you can see, its type is defined by the SimpleType enumeration EWethnicCategoryType....
2
by: aevans1108 | last post by:
Greetings Please give me a push in the right direction if this the wrong place to ask this question. Why is it that I can get the count of facets for an element restriction if the...
0
by: beyonddc.storage | last post by:
Below is my current schema <xs:simpleType name="LongType"> <xs:restriction base="xs:long"> </xs:restriction> </xs:simpleType> <xs:simpleType name="MaxLong"> <xs:restriction base="LongType">...
2
by: ZagrebMike | last post by:
Hi, I want to create a simpleType that will constrain an element to be a date of the form dd/mm/yyyy. I have this at the moment, <xs:simpleType name="newDate"> <xs:restriction...
1
by: sk | last post by:
How can I validate the element within the a simgle element? I tried to make a schema like the following, but seems the schema is not right. xml doc <id0001> <id0002>hello</id0002> </id0001> ...
0
by: JamesG | last post by:
Hi all, In my WSDL, I have several constraints on the data structure. The problem is, they aren't being enforced. Take the following two as an example. <xsd:simpleType name="consTokenType">...
2
by: JamesG | last post by:
Hi all, I'm developing a web service, and as part of the WSDL I have the following constraints: <xsd:simpleType name="consTokenType"> <xsd:restriction base="xsd:string"> <xsd:pattern...
3
by: Anil Mamede | last post by:
Hi, I'm having an hard time to build a regular expression that: - Will accept words; - Will accept spaces; - But cannot accept digits; Examples: This is a game
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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,...

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.