[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML design: don't use duplicate keys in XML objects

  • From: Hans-Juergen Rennau <hrennau@yahoo.de>
  • To: Michael Kay <mike@saxonica.com>
  • Date: Tue, 5 May 2015 11:17:24 +0000 (UTC)

Re:  XML design: don't use duplicate keys in XML objects
No - in your example I would not want a container for the <para> elements. It *is* a matter of instinct (or Sprachgefühl, as I would say), but our instinctive reactions can be reflected and condensed into helpful guidelines. Guidelines are important when we are concerned about quality and consistency, especially when dealing with large and many schemas, and when cooperating with others. Instinct is paramount - (a) when developing/maintaining the rules and (b) when deciding whether to apply the rules - but rules are important. I think you would agree, and if not, I would like to know.

In the current case, I agree with your objection to the suggested rule, so there must be a reason. I prefer refining the rule, rather than discarding it. I feel that the children of <section> are more perceived like a stream of items, rather than a list of items from which to choose. This streaming character is typical for document-oriented XML, while I had only thought of data-oriented XML. The rule should be refined accordingly.

No, I cannot quantify the "weight", it was an unfortunate attempt to use an image, intended to hint at a sense of proportion which is awakened when glimpsing a structure, documents included. (How quantify and express "proportion"? It is about the relationship between the extent ("weight") of parts forming a whole.)  

Finally, Stephen points to a practical aspect: container elements serve as "collapsing points", which are extremely useful when inspecting data visualy.

Hans-Jürgen



Michael Kay <mike@saxonica.com> schrieb am 1:39 Dienstag, 5.Mai 2015:


>Dare I propose an esthetic rule that child elements should (if possible) have comparable weight, and the weight is obviously rather uncoupled from the number of value items. 

Can you quantify what you mean by “weight”?

Do I read you as saying that you don’t like

<section>
  <head>..</head>
  <para>..</para>
  <para>..</para>
  <para>..</para>
</section>

and would prefer

<section>
  <head>..</head>
  <body>
    <para>..</para>
    <para>..</para>
    <para>..</para>
  </body>
</section>

Personally, I’ve found it impossible to come up with a general rule on this. I rely on instinct. In the above example the wrapper seems to serve no conceivable purpose.

Michael Kay
Saxonica




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.