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

Re: SML: Second Try


xml escape quote
[Don Park]
>
> In the last attempt to simplify XML, two key requirements were a)
> compatibility with XML, and b) minimalization.  This time, I removed the
> compatibility requirement and shifted to focus to user-friendly syntax:
> easier to read and write than XML.  First rought cut of the syntax is
> described informally as a blog post.
>
> http://www.docuverse.com/blog/donpark/2003/02/04.html#a200
>
> Please keep in mind that the syntax is incomplete but presented here to
> promote discussion and exploration.
>

This looks a lot like an indented syntax I created a while back to make it
easier to type XML files.  I posted it to the PyXML list, and at XML2002
John Cowan asked me to post it here. (which obviously I did not get to
before now - sorry, John).

Here is my version of Don's sample from the linked web page -

XML -

<circle x="1.0" y="1.0" r="0.5">
   <fill color="#FF0000"/>
   <text>Hello</text>
</circle>

Indented Text -

circle::
    @x::1.0
    @y::1.0
    @r::0.5
    fill
        @color::#FF0000
    text::Circle A

Character content, if there is any, begins right after the "::" as shown in
the "text::" line. Text can wrap into multiple contiguous lines, since lines
that do not begin with 'WORD::' or '@ATT::' are taken to be part of the
character content of the open element (so you do not get mixed content - a
tradoff for simplicity - you could fix it by using for example ~text:: for
text fragments).

A line that begins with a semicolon is taken as a comment line.

Any number of indent levels are supported.  I wrote a simple Python parser
that emits SAX events, and an XML handler that emits XML.

I use double colons so I can use single colons in namespaced element names.
Although my code does not actually understand namespaces, this device allows
the use of prefixed names, and of course you can put in the xmlns:xxx pseudo
attributes.

Of course this format is too simple to capture everything in XML, but it
does the basics of banging elements into place easily and readably.

I like especially like ths format for the Python-esque indentation approach
(like Don's) and for its ability to easily distinguish the attributes from
the elements, plus I do not even have to quote attribute values, which in
turn means I do not have to escape quotes.

I never thought of this as a replacement for XML, but just a handy helper
for easy typing and reading.

Cheers,

Tom P



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.