Jump to content

XML schema - how to do this...


Guest Faranicius

Recommended Posts

Guest Faranicius

Hello to all, newbie here. Sorry for my english and for my long message.I already downloaded and read the w3schools' tutorial about XML schema. Now proceeding to create my own XML schema for existing doc files to be converted into XML file.I need to create a schema for an XML file like this: <paragraph>This is the content of my favourite paragraph. Inside you can find news about <keyword>history</keyword> and <keyword>computer science.</keyword>.I usually say that <definition>"gaglioffo" is that kind of man who never cares about politness</definition> and recently I found that history was...............</paragraph>I am having trouble how to build a complex type for such kind of paragraphs into my XML schema since I have several of them and no order is fixed and many occurrencies are possible for keyword and definition (and image etc.) child-elements.. ...how to do this ?I cannot use the <ALL> order indicator because it asks for only one occurence of each child-element while I may have many different keywords inside my paragraph.I cannot use the <SEQUENCE> indicator cause I child elements rarely follow the same order and my schema must reference many different paragraphs.Actually the only way I find to draw a solution is to extract keywords, images and definitions elements from paraghraps putting at the beginning or at the bottom of it. Then use the SEQUENCE indicator with mioccurs=0 and maxoccurs= unbounded....but this way sucks as it assumes redundancy and forces me to a bigger effort. Is there something I missed from the tutorial ? Any different idea ?Please help me Thank you for any help!Faranicius

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...