Home Forum Downloads My Favorites Register FAQ Mark Forums Read

Go Back   EQInterface Forums > Developer Discussion > General authoring help / discussion
User Name
Password

Reply
 
Thread Tools Display Modes
Old 08-20-2002, 07:01 PM   #16
Gendal
A Treant
 
Join Date: Jul 2002
Posts: 26
Default

The problem seems to be the following quote from the w3c schema 1.0 primer:

Quote:
There exists a third option for constraining elements in a group: All the elements in the group may appear once or not at all, and they may appear in any order. The all group (which provides a simplified version of the SGML &-Connector) is limited to the top-level of any content model. Moreover, the group's children must all be individual elements (no groups), and no element in the content model may appear more than once, i.e. the permissible values of minOccurs and maxOccurs are 0 and 1. For example, to allow the child elements of purchaseOrder to appear in any order, we could redefine PurchaseOrderType as:


Since the sidl schema allows you to leave out tags as you see fit or include them as you see fit I don't see how the "choice" or "sequence" element constraints would apply at all. The all is exactly what I need, but with the restrictions imposed by 1.0 as I bolded above it of course doesn't work.

I assume there is another way to do it, or more likely I am just looking at it all wrong, but either way I am completly stumped.

Up at http://www.jrh.net/sidlschema.zip is an old work in progress (read: major hack) xslt and a generated xsd from the sidl.xml using the xslt. think I have the complex types set to use the choice restriction atm, which of course doesn't work at all. sequence doesn't work, and "all" is limited to the root level, any child derived "all" restrictions automatically revert to a sequence restriction. =(
Gendal is offline   Reply With Quote
Old 08-20-2002, 08:17 PM   #17
Kraegar
A Gray Wolf
 
Join Date: Aug 2002
Posts: 7
Default

Ok, failing newlines, can you fake em using some sort of row/column setup? Or even screenpieces with relative positions? (So they are in the same window, but the second isn't at a fixed x,y loc, but rather started immediately below the first)?
Kraegar is offline   Reply With Quote
Old 08-20-2002, 09:21 PM   #18
UniDyne
A Tundra Mammoth
 
Join Date: Jul 2002
Server: Veeshan
Posts: 64
Arrow To answer Gendal's questions.

Quote:
Gendal
...it seems elements who inherit a complex type's [elements] are limited to either sequential or choice complexContent...

This is true - that's the way it's supposed to work.

Quote:
W3C Schema Primer
...no element in the content model may appear more than once, i.e. the permissible values of minOccurs and maxOccurs are 0 and 1.

The equivalent of the ? operator in a DTD. This is exactly the behaviour we are looking for. Hard to believe that this is only available for top-level elements... or is it?

What if we used sequence instead of choice?
Quote:
Regarding xsd:sequence
The sequence element specifies that the child elements must appear in a sequence. Each child element can occur from 0 to any number of times.

Sounds exactly like what we want - with one exception: this is the equivalent of the * operator in a DTD, not ?. To correct this, we can simply set the sequence's maxOccurs attribute to 1. As far as I can tell, in most cases, this provides the same functionality that all does in top-level elements.

From everything that I've seen, using sequence is the only choice (no pun intended ). I think it's results will be right on. What were the problems you were having with sequence?

Last edited by UniDyne : 08-20-2002 at 09:57 PM.
UniDyne is offline   Reply With Quote
Old 08-20-2002, 09:32 PM   #19
UniDyne
A Tundra Mammoth
 
Join Date: Jul 2002
Server: Veeshan
Posts: 64
Lightbulb And to get back to the real discussion...

Quote:
Originally posted by Kraegar
Ok, failing newlines, can you fake em using some sort of row/column setup? Or even screenpieces with relative positions? (So they are in the same window, but the second isn't at a fixed x,y loc, but rather started immediately below the first)?


Yes. You simply have to group the text elements together. ScreenItem tags may be nested within other ScreenItem tags. So, create a ScreenItem and call it, say, MyText. Set the coordinates and size for that screen item for where you want the text to appear. Then, within that ScreenItem we call MyText, place ScreenItems for each text box you want to appear. Their coordinates will be relative to MyText instead of the window.

When you place this into the window, only place the MyText piece, not those other text fields you created - they have already been placed in MyText.

Hope this helps. Let me know.
UniDyne is offline   Reply With Quote
Old 08-21-2002, 01:12 AM   #20
Gendal
A Treant
 
Join Date: Jul 2002
Posts: 26
Default

Well from how i understand it a sequence is a sequence, it does not support out of order elements. So 1, 2, 3, 4, 5, and 6 is valid, but 4, 2, 3, 5, 6, and 1 is not because they are out of order. Testing of the schema seems to bear this out, if I generate a sample from the schema using xmlspy it revalidates and looks fine, but soon as I change say the DrawTemplate to before the RelativePosition tag I get an unexpected child element. EQ of course completly ignores any order so I am at a loss of what to do.

Btw there are at least two errors in the uploaded file I found already while quickly reviewing my work. One, the generated element tags need at least a 0 or 1 min/max attribute added if there is no previos min/max specified in sidl.xml to follow, and two, elements with :item attributes should be translated as a string, and not the respective complexType.
Gendal is offline   Reply With Quote
Old 08-21-2002, 11:11 AM   #21
UniDyne
A Tundra Mammoth
 
Join Date: Jul 2002
Server: Veeshan
Posts: 64
Default

What if we used xsd:group alone instead of placing a sequence or choice inside? My understanding is that group does not restrict ordering. If sequence restricts ordering and choice only allows us to use one element, why use them at all?
UniDyne is offline   Reply With Quote
Old 08-21-2002, 05:08 PM   #22
Gendal
A Treant
 
Join Date: Jul 2002
Posts: 26
Default

I need to look at the xsd:group more closely, the original reason I skipped it is because it didn't seem to handle inheritance like complexType's did, making the schema immensely more complicated. I could be wrong, just haven't had time to investigate it anymore.
Gendal is offline   Reply With Quote
Reply



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -5. The time now is 01:43 PM.


vBulletin Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI