OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] xml schema best practices question.. one big xml or lots o

[ Lists Home | Date Index | Thread Index ]


On Apr 15, 2005, at 7:40 PM, Leevi Graham wrote:

> hi guys this is my first post to this dev-list... hopefully it wont be 
> the last...
>
> i have a aquestion that has been bugging me for quite some time..
>
> i am attempting to create a business directory with xml as data 
> storage.
>
> i wish to create business elements that contain the obvious 
> information.. address, contact location etc...
>
> however the business type may change from retail to professional to 
> hosplitality....mainly hospitality like pubs and restaraunts..
>
> so finally here is my question:
>
> *lets say i have a business element that is a restaraunt and that 
> restauraunt obviously has a menu.. should i include the menu as a 
> child element of the business or should i create a seperate xml file 
> called menus. Also if I do create a menus.xml file that contains the 
> menus seperatley how will i be able to tell which menu belongs to 
> which restaraunt..*

Usually, a menu is specific to a restaurant.  While there are 
exceptions (e.g. restaurant chains), that is
a good indicator that you "should" make it a child element.  For data 
processing reasons, you may
not want to do that.

There are several solutions to this:

   * In the schema, declare the element as a child element and use 
XInclude to
     include an external document in the right place.

   * Replace the menu element child with a choice group containing a 
link to
     a menu document or the menu itself.

   * Make all the menu children links to external documents that contain
     the menu.

Keep in mind that if you declare the menu element as a global element 
in your
schema, you will be able to externalize menus in the future.

Also, in your question, you imply that you'd have one document that 
contains all
the menus.  I wouldn't suggest doing that as there isn't a strong 
relationship
between different menus from different businesses.  It also makes 
linking to
a specific menu harder.

If you plan to have large amounts of data, you might consider streaming 
technologies
for processing the information or an XML-aware database such as
eXist (http://exist.sourceforge.net/).

-- Alex Milowski  

"The excellence of grammar as a guide is proportional to the paucity of 
the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS