Re: [xml-dev] better (?) than DOM

From
Robin Berjon <>
To
Nathan Young -X <>
Date
2007-02-23T11:51:19Z
ID
<>
Thread
Re: [xml-dev] better (?) than DOM
On Feb 22, 2007, at 18:45, Nathan Young -X ((natyoung - Artizen at  
Cisco)) wrote:
> I'll repost with a little explanation because I'm curious if anyone  
> has seen something like this.  Absent XML4J it's not completely  
> crazy to create violent shortcuts for creating nodes  
> programmatically.  Although it is chained method calls, it comes  
> remarkably close to looking like a markup language:
>
> jQuery('#myDiv').append(
>     jQuery.DIV({'class':'big'},
>         jQuery.SPAN({id:'one','class':'ps'},
>             'Hello Joe', jQuery.I({},'!')
>         )
>     )
> );

Maybe it's just me but even though I've been doing Javascript quite a  
fair bit and for a long time, I don't find the above particularly  
attractive. It seems to be begging for E4X, which is IMHO a lot  
clearer than the above.

--
Robin Berjon
........................................................................
"Let us think the unthinkable, let us do the undoable. Let us prepare
  to grapple with the ineffable itself, and see if we may not eff it
  after all."
             -- Dirk Gently (Douglas Adams)