Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Fellow monks,

I have just stumbled upon a blog entry about a technology that I had never heard of before, but that is apparently being widely implemented in the JavaScript world (Rhino 1.6 has it, Firefox 1.5 has it, Flash ActionScript 3 will have it): E4X -- ECMAScript for XML -- Native XML for JavaScript.

* var order = <order><customer>. . .</customer> <item><price>5</price><qty>10</qty></item> <item level="rush"> <price>2.5</price> <qty>30</qty> </item> <item level="rush"> <price>1.5</price> <qty>50</qty> </item> </order>; * var items = order.item; // XMLList of item el'ts * var prices = order..price; * var urgentItems = order.item.(@level == "rush"); * var itemAttrs = order.item[0].@*;

Basically E4X allows you to work with (and even embed) XML into JavaScript in a very straightforward fashion. In fact, the whole approach (especially the XML-here-doc/interpolation facility) strikes me as very Perlish, but a quick googling and a super-search here turned up nothing for "e4x perl".

My question is: are there plans to support E4X in Perl (not necessarily as a core feature, but as a module, and only as far is it is syntactically compatible), and is there already something similar to it in the Perl world.?

code sample taken from Brendan Eich's presentation at XTech 05


In reply to E4X4Perl ? by Thilosophy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-04-20 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found