• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Any good resources about design of XML

 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having a head-scratching time trying to work out how best to design my XML. Questions like
should I use:
<action scope="global">
blah ..
</action>
or:
<action>
<scope>global</scope>
blah ..
</action>
or:
<action>
<scope>global</scope>
<content>
blah ..
</content>
</action>
or:
<global-action>
blah ..
</global-action>
All of these are semanticaly equivalent, but I want to make my XML as amenable to different processing methods as possible and reasonably flexible for unknown future requirements.
Does anyone know of any websites or books which discuss issues like this?
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I'm pretty new to XML and haven't really done much research on it, so I can't help you with websites or books. But if you want my rather uninformed opinion anyway, I like the first construct best.
<action scope="global">
blah ..
</action>
As long as a given action can have only one scope, and that scope can be represented by a simple string, this is all you need IMO. And all the "blah..." is clearly modified by the scope "global".
<action>
<scope>global</scope>
blah ..
</action>
This one could be useful if your concept of scope is more complex - e.g. if you want to define the scope to include modules A and C, but not B:
<action>
<scope>module A</scope>
<scope>module C</scope>
blah ..
</action>
But this is longer obviously. And it's not as obvious to me whether "blah..." is modified by one, both, or neither of the scope elements. It looks like "blah..." is outside the scope of either <scope>. Maybe there's a way in XML to specify whether this is the case or not; I dunno.
<action>
<scope>global</scope>
<content>
blah ..
</content>
</action>
Again, is the content modified by the scope? It doesn't look like it, IMO. Do you want to be able to have more than one <content> as well as more than one <scope> inside an <action>? If not, this seems like overkill. Also, I tend to think that the "content" of the <action> is already implicitly (or explicitly?) defined as whatever is in between the <action ...> and the </action>.
<global-action>
blah ..
</global-action>
This could work. But will there be other types of actions, e.g. <local-action>? Will they be similar in most ways? I'd want to keep their common behavior in a single <action> element. But that's my OO thinking - I'm not sure how necessary it really is here.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. I was beginning to think no one else even reads the XML forum. These are just the kind of many-possible-answers questions I keep bumping into with XML.
For the moment I have gone with a version of the first option. I hope it was the right choice.
 
Jim Yingst
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While browsing a local bookstore, I came across "Structuring XML Documents" by David Megginson. This seems to have a fair amount to say about this sort of thing, and has pretty good reviews at amazon. Probably worth checking out.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi frank,
could u check out this link http://java.sun.com/xml/docs/tutorial/overview/4_design.html which is for Designing an XML Data Structure
Regds.
Rahul
[This message has been edited by rahul_mkar (edited June 19, 2000).]
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. That's just the sort of thing I was looking for.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Frank,
I think that this forum is not at all active. How do u think we can work to make this an active forum.
regds.
Rahul.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!