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

xs:element with two types (xs:string and xs:int)

I would like to have an element defined in my XML Schema, that can hold
either an xs:string or xs:int value. Is this possible?

e.g. something like -

<xs:element name="service">
<xs:simpleType>
<xs:restriction base="xs:string"/>
<xs:restriction base="xs:int"/>
</xs:simpleType>
</xs:element>
Thanks

--
Adam Retter
Devon Portal Technician

Devon Portal Project
Devon e-Partnership
County Hall
Exeter
Devon, UK.
Jul 20 '05 #1
2 1527


Adam Retter wrote:
I would like to have an element defined in my XML Schema, that can hold
either an xs:string or xs:int value. Is this possible?


You can build a union of simple types e.g.
<xs:union>
however I am not sure what sense that makes for xs:string and xs:int as
obviously xs:string contains any xs:int anyway.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
Martin Honnen <ma*******@yahoo.de> writes:
Adam Retter wrote:
I would like to have an element defined in my XML Schema, that can hold
either an xs:string or xs:int value. Is this possible?


You can build a union of simple types e.g.
<xs:union>
however I am not sure what sense that makes for xs:string and xs:int
as obviously xs:string contains any xs:int anyway.


The lexical space of xsd:string contains the lexical space
of xsd:int, but the value spaces are disjoint, and it
can matter to an application which uses the type annotations
provided by schema processing.

-C. M. Sperberg-McQueen
World Wide Web Consortium
Jul 20 '05 #3

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

Similar topics

0
by: Timo Nentwig | last post by:
Hi! I try to write a schema for: <f4t-config> <database> <jndi-url>foo</jndi-url> <fetch-size>100</fetch-size> <!-- these are the problem --> <query id="foo">bar</query>
1
by: Alejandro Calbazana | last post by:
Hello, Should the XmlValidatingReader validating xml against an xsd serially (e.g. - does the XML have to be in the correct position in order for a document to be valid)? For example, I am...
3
by: MSSQLServerDeveloper | last post by:
I have a simple vb.net program that creates an xmlschema using the dataset method writexmlschema (see #1). It creates a file (see #2), but I would like a file that looks like #3 - #3 is DIFFERENT...
2
by: Json | last post by:
Ok, brand new to SQLXML 3.0 and its various issues. Heres what I'm trying to do: 1. I am trying to load xml data into an empty SQL table from my .NET console application. 2. This isn't a huge...
1
by: ronchese | last post by:
Hello All. I need to complement some information in a xml file, using the Xml.XmlDocument object. This xml contains several <xs:element ....> nodes (is a saved dataset), and I need to write new...
3
by: nshala | last post by:
Hallo, I wrote a complex XSD-Schema for validating complex XML files. By validating xs:int elements XmlValidatingReader does not validate it correctly. My XSD looks like this: .......
1
by: trialproduct2004 | last post by:
Hi all, I am having table in database with say name as '1company'. when i generate strongly typed dataset for this table in xsd file i am getting entry as below:- <xs:element...
4
by: Bradley Plett | last post by:
It seems that the XSD tool supplied with VS2005 does not handle "xs:union". Am I doing something wrong? Is there a work-around? Here is a simple sample file:...
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...
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: 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?
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
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,...
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.