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

A beginners question about substitution groups

Hi,

I'm currently teaching myself about XML schems at the same time as
specifying the XML document for a project I've been given to write.
(I'm new to the XML world, so progress is a little slow at the moment!)

I find myself needing to restrict an element to contain either an
integer in the range of 01 - 99 OR the value "*9". Because of the
asterisk an simple integer field is not sufficient so I suspect I need
to use a substitution group to specify that this element can either be
an integer, or a string with only one permissable value.

I'm following the XML Schema Part 0 - 3 from the w3c.org website to
indicate what is permissible in the language.

I'm a little confused about how to code up a substitution group so that
the value is either a ranged integer, or a specific string. Could
someone point me in the direction of some other documentation which is
a little more readable than the official primer, or describe to me how
it's done - I don't want some canned XML with "This will do what you
require", as I'd like to work this simple problem through myself.

Cheers.

Feb 27 '06 #1
2 1259
Hi,

You actually need a union type rather than a substitution group. The
Primer has some coverage on that:

http://www.w3.org/TR/xmlschema-0/#UnionDt

There is an example of a union type from my book (and many more schema
examples) at:

http://www.datypic.com/books/defxmls...r11.html#EX116

Hope that helps,
Priscilla

----------------------------------
Priscilla Walmsley
Author, Definitive XML Schema
Definitive XQuery
http://www.datypic.com
----------------------------------

*** Sent via Developersdex http://www.developersdex.com ***
Feb 27 '06 #2
Aha! A union (which I'd not actually read about yet) is definitely the
way to go. I think that I may do well with a comfortable book, rather
than the precise, but slightly terse, standards docs!

Seeing as you've written both, it I feel I should look no further! :)

Many thanks Priscilla - my schema is rolling again...

Steve.

Feb 28 '06 #3

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

Similar topics

3
by: Alessandro Brollo | last post by:
Far from a professional programmer, I'm simply a newbie Python user. Two basic questions: 1. I don't want to post banal questions about Python to main Python list. Does a "banal Python questions...
2
by: John Carron | last post by:
Hi All, I have written a simple schema (see below) that uses substitution groups. I don't know if this the correct usage because I'm fairly new to xml schema. The structure is as follows: ...
0
by: John Carron | last post by:
Hi All, I have written a simple schema (see below) that uses substitution groups. I don't know if this the correct usage because I'm fairly new to xml schema. The structure is as follows: ...
1
by: kollareddy | last post by:
Hi all, I am new to xml/xsd world. I want to know the differences between complex type and element being abstract and if both can be declared so, in case of substitution goups.Also can xsi:type...
55
by: Cindy | last post by:
Hello!! I'm new at access and there's is an article by Arvin Meyer for beginners that is references in Google Groups but I can't seem to find the original post with the article's URL. Does anyone...
1
by: KERLOG | last post by:
Hello, I found that in "glibc" there is a function to perform variable substitution. It start with $. By digging inside the code of "glibc" I can't find how it's done. Has someone already...
4
by: Don | last post by:
I think "macro substitution" is the correct term for what I want to do, but, to be sure, here is a description of what I'd like to know is possible: I want to be able to create a create an object...
7
by: MtiPaulo | last post by:
I know FoxPro has excellent macro substitution but I am trying to find through MS Access. Wondering if MS Access has Macro Substitution? I will give you my basic example. In FoxPro Language...
7
by: Bob Betts | last post by:
hi .. i am a total beginner in Visual Studio.net specifically Visual Basic... what forum do i subscribe to ..... ? Thanks
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: 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: 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:
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,...
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...

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.