XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Generic XML Tag Closer </> (GXTC)

Mitch Amiano said:
> my 2 cents
>
> With the availability of relatively low cost or free XML editors having
> good content completion, I see no advantage even from the standpoint of
> data entry. Just for instance, with oXygen's content completion will
> close tags with about three ( < /  {ENTER} ) keystrokes.

Please read previous comments and follow the link to ConciseXML in this
thread. They are not so worried about editing when leaving the </>
_optional_. They are more worried about limitations of end tags in
dinamical environments.

There exist also problems with end tags in large datuments. That is the
reason that XSLT includes parsing capabilites for string data because when
encoding large quantity of data XML end tags (and even start tags!) are
very inefficient (this is discussed by Jenny Tennison in her book

[http://www.amazon.com/gp/product/1861005946/102-1558124-8994523?n=283155]).

Inefficiency is also reason for SVG paths d="M ..."

> </> makes the closure of an element anonymous. To the human reader, a
> long span of content in which the start tag is no longer near the
> anonymous end tag makes a visual scan useless.

Not sure. Since this point is common to XML, SGML, ConciseXML, liminal,
CanonML, and SXML, let me use next example for discussion

[http://www.xmlfiles.com/examples/simple.xml]:

<breakfast-menu>
  <food>
    <name>Belgian Waffles</name>
    <price>$5.95</price>
    <description>two of our famous Belgian Waffles with plenty of real
maple syrup</description>
    <calories>650</calories>
  </food>

  <food>
    <name>Strawberry Belgian Waffles</name>
    <price>$7.95</price>
    <description>light Belgian waffles covered with strawberrys and
whipped cream</description>
    <calories>900</calories>
  </food>

  <food>
    <name>Berry-Berry Belgian Waffles</name>
    <price>$8.95</price>
    <description>light Belgian waffles covered with an assortment of fresh
berries and whipped cream</description>
    <calories>900</calories>
  </food>

  <food>
    <name>French Toast</name>
    <price>$4.50</price>
    <description>thick slices made from our homemade sourdough
bread</description>
    <calories>600</calories>
  </food>

  <food>
    <name>Homestyle Breakfast</name>
    <price>$6.95</price>
    <description>two eggs, bacon or sausage, toast, and our ever-popular
hash browns</description>
    <calories>950</calories>
  </food>
</breakfast-menu>


SGML (when option of avoiding some end tags is available):

<breakfast-menu>
  <food>
    <name>Belgian Waffles
    <price>$5.95
    <description>two of our famous Belgian Waffles with plenty of real
maple syrup
    <calories>650
  </food>

  <food>
    <name>Strawberry Belgian Waffles
    <price>$7.95
    <description>light Belgian waffles covered with strawberrys and
whipped cream
    <calories>900
  </food>

  <food>
    <name>Berry-Berry Belgian Waffles
    <price>$8.95
    <description>light Belgian waffles covered with an assortment of fresh
berries and whipped cream
    <calories>900
  </food>

  <food>
    <name>French Toast
    <price>$4.50
    <description>thick slices made from our homemade sourdough bread
    <calories>600
  </food>

  <food>
    <name>Homestyle Breakfast
    <price>$6.95
    <description>two eggs, bacon or sausage, toast, and our ever-popular
hash browns
    <calories>950
  </food>
</breakfast-menu>

ConciseXML (if the _option_ of </> is mixed with full end tags)

<breakfast-menu>
  <food>
    <name>Belgian Waffles</>
    <price>$5.95</>
    <description>two of our famous Belgian Waffles with plenty of real
maple syrup</>
    <calories>650</>
  </food>

  <food>
    <name>Strawberry Belgian Waffles</>
    <price>$7.95</>
    <description>light Belgian waffles covered with strawberrys and
whipped cream</>
    <calories>900</>
  </food>

  <food>
    <name>Berry-Berry Belgian Waffles</>
    <price>$8.95</>
    <description>light Belgian waffles covered with an assortment of fresh
berries and whipped cream</>
    <calories>900</>
  </food>

  <food>
    <name>French Toast</>
    <price>$4.50</>
    <description>thick slices made from our homemade sourdough bread</>
    <calories>600</>
  </food>

  <food>
    <name>Homestyle Breakfast</>
    <price>$6.95</>
    <description>two eggs, bacon or sausage, toast, and our ever-popular
hash browns</>
    <calories>950</>
  </food>
</breakfast-menu>


liminal (full end tags are needed for overlaping ranges. Optional end tags
are _only_ available for annotations because cannot overlap):

[breakfast-menu}
  [food}
    [name}Belgian Waffles{name]
    [price}$5.95{price]
    [description}two of our famous Belgian Waffles with plenty of real
maple syrup{description]
    [calories}650{calories]
  {food]

  [food}
    [name}Strawberry Belgian Waffles{name]
    [price}$7.95{price]
    [description}light Belgian waffles covered with strawberrys and
whipped cream{description]
    [calories}900{calories]
  {food]

  [food}
    [name}Berry-Berry Belgian Waffles{name]
    [price}$8.95{price]
    [description}light Belgian waffles covered with an assortment of fresh
berries and whipped cream{description]
    [calories}900{calories]
  {food]

  [food}
    [name}French Toast{name]
    [price}$4.50{price]
    [description}thick slices made from our homemade sourdough
bread{description]
    [calories}600{calories]
  {food]

  [food}
    [name}Homestyle Breakfast{name]
    [price}$6.95{price]
    [description}two eggs, bacon or sausage, toast, and our ever-popular
hash browns{description]
    [calories}950{calories]
  {food]
{breakfast-menu]


CanonML (does not use end tags but can add comments in end ] if you desire):

[::breakfast-menu
  [::food
    [::name  Belgian Waffles]
    [::price  $5.95]
    [::description  two of our famous Belgian Waffles with plenty of real
maple syrup]
    [::calories  650]]

  [::food
    [::name  Strawberry Belgian Waffles]
    [::price  $7.95]
    [::description  light Belgian waffles covered with strawberrys and
whipped cream]
    [::calories  900]]

  [::food
    [::name  Berry-Berry Belgian Waffles]
    [::price  $8.95]
    [::description  light Belgian waffles covered with an assortment of
fresh berries and whipped cream]
    [::calories  900]]

  [::food
    [::name  French Toast]
    [::price  $4.50]
    [::description  thick slices made from our homemade sourdough bread]
    [::calories  600]]

  [::food
    [::name  Homestyle Breakfast]
    [::price  $6.95]
    [::description  two eggs, bacon or sausage, toast, and our
ever-popular hash browns]
    [::calories  950]]
]


SXML:

(breakfast-menu
  (food
    (name "Belgian Waffles")
    (price "$5.95")
    (description "two of our famous Belgian Waffles with plenty of real
maple syrup")
    (calories "650"))

  (food
    (name "Strawberry Belgian Waffles")
    (price "7.95")
    (description "light Belgian waffles covered with strawberrys and
whipped cream")
    (calories "900"))

  (food
    (name "Berry-Berry Belgian Waffles")
    (price "$8.95")
    (description "light Belgian waffles covered with an assortment of
fresh berries and whipped cream")
    (calories "900"))

  (food
    (name "French Toast")
    (price "$4.50")
    (description "thick slices made from our homemade sourdough bread")
    (calories "600"))

  (food
    (name "Homestyle Breakfast")
    (price "$6.95")
    (description "two eggs, bacon or sausage, toast, and our ever-popular
hash browns")
    (calories "950"))
)

Many people do not find greater readability with the XML format. Other, of
course, disagree. Morever, the supposed readability of end tags often
disappears when using attributes since end tags can match any start tag
independently of attributes:

<section class="normal">
<section class="special">
...
</section>
</section>

What section closes the final tag? first? second? other contain in ...?

> When a (start|end) tag is missing the anonymous end tag makes it harder
> to distinguish which element is incorrect. This might not mean as much
> when using a tree editor, but when using a source mode editor or
> text-based script (print/puts/echo) to generate content, or plain old
> damaged files, you're likely to loose more time trying to debug.  For
> that matter, if I textually cut-and-paste a fragment with an XML end tag
>  so that its position is swapped outside of an ancestor element
> structure's end tag, the validation process is likely to give errors; if
>  I textually cut-and-paste the same as an anonymous end tag, the
> validation process may not know anything is wrong at all if the end tags
>  still match in number. This can happen for instance when you select a
> line of content but you don't notice that the end tag got selected too,
> and you drag and drop.

There are situations where XML syntax can offer us advantages and
situations where cannot. E.g. use namespaces; what is more readable and
understandable, the standard XML

<math xmlns:mml="http://www.w3.org/1998/Math/MathML";>
  <mml:apply>
    <mml:eq/>
    <mml:ci>E</mml:ci>
    <mml:apply>
      <mml:times/>
      <mml:ci>m</mml:ci>
      <mml:apply>
        <mml:power/>
        <mml:ci>c</mml:ci>
        <mml:cn>2</mml:cn>
      </mml:apply>
    </mml:apply>
  </mml:apply>
</math>

or next (maybe a proposal for next MathML 3 input syntax)?

[math @xmlns:mml="http://www.w3.org/1998/Math/MathML";
  [mml:apply
    [mml:eq]
    [mml:ci E]
    [mml:apply
      [mml:times]
      [mml:ci m]
      [mml:apply
        [mml:power]
        [mml:ci c]
        [mml:cn 2]
      ]
    ]
  ]
]

Note you can know _exactly_ what each ] is closing even without a syntax
highlight editor (there are many for free). For instance, i want know what
closes the third ] begining from the end. Then i put cursor in it *] and
next move it up and automatically i finalize in *[math:apply the second
apply element. One do not need count brackets not visual matching them
(the theoretical advantage of XML end tags vanishes here). With a sintax
highlighter editor it is better still since you can do

[math @xmlns:mml="http://www.w3.org/1998/Math/MathML";
  [mml:apply
    [mml:eq]
    [mml:ci E]
    [mml:apply
      [mml:times]
      [mml:ci m]
      [mml:apply
        [mml:power]
        [mml:ci c]
        [mml:cn 2] ]]]]

and selecting any "]" or "[" the editor highlihts the corresponding pair
for you.

One cannot claim that XML syntax is best or more readable than other
syntax including the </> notation in absolute terms. It is a case by case
methodology.

In
[http://canonicalscience.blogspot.com/2006/04/canonml-markup-language-beyond-tex-xml.html]

I wrote some basic arguments against claims by Paul Prescod that XML
syntax is more robust in the face of errors. See also

[http://www-128.ibm.com/developerworks/xml/library/x-syntax.html?loc=x]


Juan R.

Center for CANONICAL |SCIENCE)




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


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

Copyright 1993-2007 XML.org. This site is hosted by OASIS