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] Improving XML desing?

[ Lists Home | Date Index | Thread Index ]

<juanrgonzaleza@canonicalscience.com> wrote:
> In
>
> [http://canonicalscience.blogspot.com/2006/04/canonml-markup- 
> language-beyond-tex-xml.html]
>
> i presented some basic thoughts on CanonML, a markup language  
> beyond TeX,
> XML, and alternatives as liminal, GODDAG, SGML concur, and others.  
> The new
> approach is clearly inspired in SXML.

Many people have already commented that s-expressions are more  
concise than XML. The standard rebuttal is that with deeply embedded  
tree structures it is virtually impossible to visually locate the end  
tag and therefore know which element ends where. Therefore, for  
trivial examples s-expressions are more readable, whereas for more  
complex examples XML is much more readable. CanonML appears to be yet  
another s-expression language, with confusing additional syntax that  
appears to serve no purpose (such as double colons), redundant  
duplication of forms ([::x] versus \x). It introduces not only the  
above problem but also

- confusion over whether whitespace is part of the text content or  
the markup (a step backward from SXML)
- lack of processing instruction mechanism
- lack of comment mechanism
- lack of character encoding mechanism
- lack of reusable entity mechanism
- lack of mechanism for modularity of documents (within different  
resources)
- lack of differentiation between unordered and ordered properties  
(XML attributes vs. child elements)

> Some of technical points of CanonML are beyond XML (i mean if one wait
> backward compatibility with XML 1.0-1.1), but other points could be
> considered for discussion on a future XML specification.

Not with your current proposal. The only advantage I can see to your  
language is that it may be slightly more readable for some small  
class of trivial documents. Now let's consider a more reasonable  
example:

<math xmlns='http://www.w3.org/1998/Math/MathML'>
   <mrow>
     <mo fence='true'>&#x2225;</mo>
     <mrow>
       <msup>
         <mi mathvariant='bold'>v</mi>
         <mi>L</mi>
       </msup>
       <mo>-</mo>
       <msubsup>
         <mi mathvariant='bold'>w</mi>
         <msup>
           <mi>c</mi>
           <mi>L</mi>
         </msup>
         <mi>L</mi>
       </msubsup>
     </mrow>
     <mo fence='true'>&#x2225;</mo>
     <mo>&le;</mo>
     <mo fence='true'>&#x2225;</mo>
     <mrow>
       <msup>
         <mi mathvariant='bold'>v</mi>
         <mi>L</mi>
       </msup>
       <mo>-</mo>
       <msubsup>
         <mi mathvariant='bold'>w</mi>
         <mi>i</mi>
         <mi>L</mi>
       </msubsup>
     </mrow>
     <mo fence='true'>&#x2225;</mo>
     <mo>&forall;</mo>
     <mi>i</mi>
   </mrow>
</math>

Let's try this in CanonML:

[::math [@ [::xmlns http://www.w3.org/1998/Math/MathML]] [::mrow  
[::mo [@ [::fence true]] ∥] [::mrow [::msup [::mi [@ [::mathvariant  
bold]] v] [::mi L]] [::mo -] [::msubsup [::mi [@ [::mathvariant  
bold]] w] [::msup [::mi c] [::mi L]] [:mi L]]] [::mo [@ [::fence  
true]] ∥] [::mo ≤] [::mo [@ [::fence true]] ∥] [::mrow [::msup  
[::mi [@ [::mathvariant bold]] v] [::mi L]] [:mo -] [:msubsup [::mi  
[@ [:mathvariant bold]] w] [::mi i] [::mi L]]] [::mo [@ [::fence  
true]] ∥] [::mo ∀] [::mi i]]]

Shorter, yes. But more readable? I know which one I'd prefer to debug  
the nesting of (and edit using vi over an ssh connection). Where does  
the second mrow element end, for instance? The third?
-- 
犬 Chris Burdess
   "They that can give up essential liberty to obtain a little safety
   deserve neither liberty nor safety." - Benjamin Franklin




This is a digitally signed message part





 

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

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