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

Evolution of a markup language: replace recurring patterns that areimper

  • From: "Costello, Roger L." <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Wed, 22 Dec 2010 09:50:36 -0500

Evolution of a markup language: replace recurring patterns that areimper
Hi Folks,

In this book [1] the author says that the members of the HTML5 working group have identified recurring JavaScript patterns and then created corresponding markup:

   When JavaScript was introduced into web browsers, it
   was immediately seized upon for two tasks: Image rollovers
   and Form enhancements. When CSS came along with its
   :hover pseudo-class, web designers no longer needed to reach
   for JavaScript just to achieve a simple rollover effect.

   This is a recurring trend. If a pattern is popular enough, it
   will almost certainly evolve from requiring a scripted solution
   to something more declarative.

   ...

   Following the same migratory pattern from scripted to declarative
   solutions, the [HTML5] specification introduces many new form
   enhancements.

   ...

   HTML5--it's paving a cowpath ...


Another way of saying this is: HTML5 has migrated imperative code to declarative markup.

This is exciting.


The book gives this example of migrating imperative code to declarative markup:

    Here's a common DOM Scripting pattern, often used for
    search forms:

    1. When a form field has no value, insert some placeholder text into it.

    2. When the user focuses on that field, remove the placeholder text.

    3. If the user leaves the field and the field still has no value, reinstate the
       placeholder text.

    In an HTML5 document, you can simply use the placeholder attribute:

    <input id="hobbies" name="hobbies" type="text" placeholder="Owl stretching">


The HTML language is evolving by diligently observing usage patterns and then creating equivalent markup. Thus, there is a slow but steady progression away from the need for imperative code to declarative solutions.

Cool.

How has XML evolved? Can you cite examples of where usage patterns have been observed and then equivalent declarative solutions have been provided?

/Roger

[1] "HTML5 For Web Designers" by Jeremy Keith, p. 40-43.


[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.