Jump to content

How does one define nest-able xml tags in XSD?


Recommended Posts

I am working on building a developer IDE ( an assembly language RAD actually for megadrive homebrew)the project file uses xml 1.0 and requires a complexType (folder) to be allowed to have itself as an optional member. Here is how the project file format would be layed out (in other words, an example):

<?xml version="1.0"?> <project title="Tetris Clone" version="0"><asmfile type="68k">main.s</asmfile><folder name="levels">  <asmfile type="68k">levels.inc</asmfile>  <binary type="artwork" compress="lzss">   <artwork rows="130" cols="24" sort="vertical">level artwork.bin</artwork>  </binary>  <binary type="map">   <map blocksize="2" numblocks="1500">level block mappings.bin</map>  </binary></folder><folder name="artwork">  <folder name="tetrominos">   <asmfile type="68k">tetromino loader.inc</asmfile>  </folder></folder><target name="clonetris.bin">main.s</target></project>

asmfile types would be restricted to just 68k, z80, and sh2 and it would be intended for developing legal homebrew games for sega genesis (also known as megadrive), sega cd (also known as mega cd), and 32x. most of this I can handle, I am just wondering, how do we make it so that a complexType can have itself as an optional member. Once I have that one answered, I will likely not have to return here again for a while. And before you say this is posted in the wrong place, I will tell you that I am asking how in schema xsd does one define a type that can include itself (look at the artwork and tetrominos folders in the example project above to see what I am asking about)the folder tag should allow all of these elements as members: asmfile, binary, target, and folder (yes even itself), how many folder levels should be allowed? as many as the project needs, because those represent real folders in the filesystem. why multiple targets? if you are making a sega cd homebrew, you may needs a target for each binary file on the cd as we as the bootloader and the cd iso itself.

Edited by kramlat
Link to post
Share on other sites
  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...