Wednesday, June 4th, 2008

Nexaweb announces dojo.E markup and runtime

Category: Dojo, JavaScript, Library

Nexaweb has released a new product that build on Dojo, dojo.E:

dojo.E provides developers with the ability to use an XML based markup language to add in their Ajax behaviors. Markup whether — XML, HTML or CSS — simplifies development by allow developers to convey in simple text format what they would otherwise need to convey in code. Markup also provides a great abstraction layer that separates the implementation from the usage.

This release, which is an Apache style open source project itself, consists of two pieces:

dojo.E Markup

dojo.E Markup allows developers to describe their dojo components using a simple markup language that translates directly into dojo classes. For example declaring a button in dojo would be done one of two ways;

  1. <div dojoType=”dijit.form.Button” label=”Hello, world”/>

Using JavaScript new dijit.form.Button(htmlElement, “Hello, World”);

dojo.E Markup provides a third way that allows developers to describe the button as follows:

  1. <script type=“text/xml” dojoType=“dojoe.XmlScript”>
  2.    <ui xmlns:dijit=“dijit”>
  3.         <dijit :form.Button label=“Hello, World!”
  4.           onclick=“alert(’It works!’)”/>
  5.     </ui>
  6. </script>

dojo.E Runtime

The runtime provides additional markup that makes modifying the HTML DOM or the dojo Components easier.

  1. <xm :xmodify document=”ui”>
  2.     </xm><xm :append select=”//widget.SortList”>
  3.         <li>{0}</li>
  4.     </xm>

The xModify syntax above tells the dojo.E runtime to append a “

  • {0}
  • ” tag to the dojo SortList component. The select statement in this case is a XPath statement and not a CSS selector. In the actual sample this snippet above is wrap with a “Macro” which allows the developer to parameterize the “{0}” and execute the xModify snippet when the developer clicks the “Add” button.

    You can play with this in a live editor that shows samples such as a todo list:

    1. <declarations>
    2.     <dojoe :Macro id="add" xmlns:dojoe="dojoe">
    3.     < ![CDATA[
    4.     <xm:xmodify xmlns="html" xmlns:xm="dojoe" xmlns:dijit="dijit" document="ui">
    5.         <xm :append select="//widget.SortList ">
    6.             <li>{0}</li>
    7.         </xm>
    9.     ]]>
    10.     </dojoe>
    11. </declarations>
    12. <ui xmlns:dijit="dijit" xmlns:dojox="dojox" xmlns="html">
    13.     <div id="input_container">
    14.         <span>ToDo:</span>
    15.         <input style="width: 184px; margin-left:3px;" id="textbox" type="text" class="input_tbx" value="Item"/>
    16.         <input class="button" type="button" value="Add" onclick="dojoe.containers.macro.get('add').execute(document.getElementById('textbox').value);" />
    17.     </div>
    18.     <div id="list_container">
    19.         <dojox :widget.SortList  title="SortList From Markup" style="width:300px; height:150px;">
    20.             <li>A. Download and Install the dojo.E</li>
    21.             <li>B. Build dojo.E Application</li>
    22.             <li>C. Profit</li>
    23.         </dojox>
    24.     </div>
    25. </ui>

    Posted by Dion Almaer at 8:36 am

    3.3 rating from 51 votes


    Comments feed TrackBack URI

    Yeah, ’cause–you know–ColdFusion proved that coding in tags was so much more fun!

    Comment by JRice — June 4, 2008

    Dojo.U for Useless.

    Even if you did want to use tags you would use one embedded in the framework like Backbase.

    Comment by robojax — June 4, 2008

    That’s the most ungodly stew of languages and syntaxes that one could imagine. Just one question–WHY?

    Comment by tora — June 4, 2008

    Even though the idea of embedding XML markup content with script tag is great (although old, consider aforementioned Backbase), I would recommend Nexaweb not to claim “text/xml” mime-type possession as this might create a lock on client-side technologies (suppose browsers implement that mime-type handler).
    “text/nexaweb+xml” or “text/dojo.E+xml” would be more safe with this respect.

    Comment by caston — June 4, 2008

    The why, is that not everyone in the world is a JavaScript and Ajax expert. Markup, whether people like it or think its fun to development in, does provide a base on which vendors can build tools that make it easier to build applications and shield them from implementation changes.

    The other reason is that being able to respond from a server with modifications allows the developer to transition modification calls to the server. This can be really helpful for performing different tasks. Each of the pieces of the language can be used independently.

    Comment by digitalIchi — June 4, 2008


    Great idea, I will look into that.

    Comment by digitalIchi — June 4, 2008


    Comment by soff — June 4, 2008

    huh? What an ugly syntax and messy design. Why on earth would one use this instead of DojoML, or some real clean/concise XML that actually provides value? Amazing.

    Comment by soff — June 4, 2008

    This doesn’t excite me very much, but I’m sure there’s someone with a title like “senior enterprise analyst” that saw this and jumped for joy. If you think this is ugly syntax and messy design, you’d feel the same way about a lot of enterprise stuff, even though there’s a huge market for it, and the people that use it are quite happy with it.

    Comment by pottedmeat — June 4, 2008

    No thanks. That’s nasty.

    Comment by AaronHeckmann — June 4, 2008

    Looks a lot like .ASPX pages in fact, though .ASPX pages doesn’t propagate to the client meaning XHTML is not broken.
    To “extend” the HTML standards like this is just plain ignorant…
    Sorry Alex, this is NOT “Open Web”… :|

    Comment by polterguy — June 4, 2008

    I think the reason that this has such negative feedback is that the majority of readers on this site is that we are all to developer oriented to see some benefit in this. I agree, the syntax is ugly and there is little use of this from a standard developer’s perspective.

    However, I think this would be very useful on some community oriented sites. For example, to allow users to create custom widgets, all you need to do is spit out some generated HTML, not rely on pre-made javascript functionality or generate any sort of javascript. I could develop an interface to allow people with no development experience to build their own custom Dojo widgets in about a day with this library (but I won’t).

    So, for developing your site or applications, this is a horrible approach. But building an interface to allow custom widgets to be built is where this shines.

    Comment by tj111 — June 4, 2008


    I somewhat agree and somewhat disagree. Granted the things shown are not standards, more of a different approach to an already solved problem. The goal of the project is not to re-implement things that are already built. The first version is more of the foundation to built out a standard way to incorporate xml-based markup into Ajax application.

    The W3C and others have created syntax that is very well defined, considered standards, open and useful to developing applications. Take for instance svg, Using this project I can take the SVG syntax and map it. Other W3C syntax like xml events, x-forms can also be brought into browsers not supporting it using dojo.E. This I would consider open web.

    Comment by digitalIchi — June 4, 2008

    your allready using custom attributes, why not use custom namespaces -_-, if u wanted to make it easyer..

    that looks like something… and its easy to understand for none developers =/

    Comment by V1 — June 4, 2008

    Not all of us are using custom attributes, we’re not breaking XHTML ONE PLACE in our current SVN code now. (meaning no “custom attributes”)
    Fact is we’re all attacking MSFT for being non-compatible, how can we expect them to be when the ones screaming the most are NOT…?
    (Btw, I scream too, but at least we _try_)

    Comment by polterguy — June 5, 2008

    There is a much more lightweight jQuery based alternative:

    I use this with the eXist-Xml DB and notice a high developer productivity and low maintenance costs, leaving even RubyOnRails behind …


    Comment by Rusco — June 5, 2008

    There is something kind of nice about building a UI with declarative markup like this. So instead of your server-side building tag soup, you build and manipulate an xml document to represent your UI. If you wanted to create a forms editor – a gui editor – having a structured xml representation to back it is going to get you there a lot faster. OTOH the drawbacks to declarative UI systems are always in the lack of expressive power in the markup – you trade a flexible scripting language for a limited set of elements and attributes.

    I wonder his dojo.e compared to the dojox.wire project, as well as frameworks like backbase that are well established in this niche.

    Comment by sfoster — June 5, 2008

    Leave a comment

    You must be logged in to post a comment.