473,396 Members | 1,891 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.

Schema question

Take the following XML:
<Frame type="Image" id="frame1">
<Draw/>
</Frame>

<Frame type="Text" id="frame2">
<Print/>
</Frame>
Is there a way in Schema to specify that the "Frame" element is
different (and thus requires different child elements) depending on
the value of an attribute (specifically the "type" attribute)?

Jul 16 '07 #1
3 1850
Robert Dailey wrote:
Is there a way in Schema to specify that the "Frame" element is
different (and thus requires different child elements) depending on
the value of an attribute (specifically the "type" attribute)?
Presence or absence, maybe. Value, I don't think so. Some of the other
schema(-like) languages do support that, or you can enforce that
constrating in the application code...
--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Jul 16 '07 #2
On Jul 16, 1:05 pm, Joseph Kesselman <keshlam-nos...@comcast.net>
wrote:
Robert Dailey wrote:
Is there a way in Schema to specify that the "Frame" element is
different (and thus requires different child elements) depending on
the value of an attribute (specifically the "type" attribute)?

Presence or absence, maybe. Value, I don't think so. Some of the other
schema(-like) languages do support that, or you can enforce that
constrating in the application code...

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Thank you for your reply, it was the answer I was looking for.

I would also like to ask if it's possible to make a schema accept
either of the following attribute combinations for a single element:

<Offset x="0" y="0"/>
<Offset var="myvar"/>

Is this possible?

Jul 16 '07 #3
On 16 Jul, 20:36, Robert Dailey <rcdai...@gmail.comwrote:
On Jul 16, 1:05 pm, Joseph Kesselman <keshlam-nos...@comcast.net>
wrote:
Robert Dailey wrote:
Is there a way in Schema to specify that the "Frame" element is
different (and thus requires different child elements) depending on
the value of an attribute (specifically the "type" attribute)?
Presence or absence, maybe. Value, I don't think so. Some of the other
schema(-like) languages do support that, or you can enforce that
constrating in the application code...
--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden

Thank you for your reply, it was the answer I was looking for.

I would also like to ask if it's possible to make a schema accept
either of the following attribute combinations for a single element:

<Offset x="0" y="0"/>
<Offset var="myvar"/>

Is this possible?
In schema you can effectively only specify the union of the two
types. As a result things like <Offsett x="0" var="myvar"/would
also validate. You could apply additional constraints at the
application level. XSD1.1 is due to improve onthis and Relax-NG
supports what you want.

HTH,

Pete.
--
=============================================
Pete Cordell
Codalogic Ltd
for XML Schema to C++ data binding visit
http://www.codalogic.com/lmx/
=============================================
Jul 18 '07 #4

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

Similar topics

0
by: Antony | last post by:
Hi there, firstly thank you for thinking about this problem of mine. This is a long message because I want to put all the facts (the XML and the schema) to try to get a solution from you helpful...
1
by: Gregg Williams | last post by:
Hi--I am having a problem designing a schema to fit my XML data, and I'm hoping that someone can help. Essentially, I have a schema in mind and two target vocabularies for it, where one vocabulary...
4
by: Jari Kujansuu | last post by:
I can successfully parse XML document using SAX or DOM and I can also validate XML document against schema. Problem is that my program should deal with user-defined schemas which means that when...
7
by: Andrei Ivanov | last post by:
This happend again, but now, postgresql tells me where it happens: pg_dump: SQL command failed pg_dump: Error message from server: ERROR: did not find '}' at end of input node pg_dump: The...
2
by: PeterW | last post by:
I have an xml file from which I want to generate an xsd schema and at a later stage a cs class. The xml file has a mix of defined namespaces and also an empty namespace. These are defined as...
4
by: bibsoconner | last post by:
Hi, I hope someone can please help me. I'm having a lot of trouble with schema files in .NET. I have produced a very simple example that uses "include" to include other schema files. It all...
4
by: cmc | last post by:
I need some clarification to help me understand the DB2 strucure more. The questions are about "implicit schema" 1. This is a very interest concpet that DB2 let every user to create new schema...
1
by: drb | last post by:
Hi, Newbie question #2 - hope that's OK! I'm trying to create a WSDL file using one or more XSD schema files. While WSDL.exe doesn't seem to support the XSD "import" function, if I include a...
1
by: brucepickford001 | last post by:
Hi, I have a not simple problem. I want the following XML to be schema valid <PopulationDemographic> <PersonName>Joe Blogs</PersonName> <Age>2</Age> <Category>baby</Category>...
0
by: jrhitokiri | last post by:
QUESTION 1: I'm trying to create a room reservation system for school using wicket and MySQL, and I'm a bit confused with this one. I've already created the user database and rooms database. My...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
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...
0
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,...

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.