With strings and even E4X, you don't get the same experience that react
supports. Things like property completion in XML mode, XML internal logic, etc.
________________________________
From: es-discuss <[email protected]> on behalf of liorean
<[email protected]>
Sent: Monday, May 20, 2019 3:03:04 AM
To: Jacob Bloom
Cc: ViliusCreator; [email protected]
Subject: Re: Re: Proposal: native XML object support.
You could already do something like this:
let
RawXML=xml`<some-element some-attribute="${some_variable}">some
content</some-element>`
,XMLApplication=rss`<rss version="2.0">
<channel>
<title>RSS Title</title>
<description>This is an example of an RSS feed</description>
<link>http://www.example.com/main.html</link>
<lastBuildDate>Mon, 06 Sep 2010 00:01:00 +0000 </lastBuildDate>
<pubDate>Sun, 06 Sep 2009 16:20:00 +0000</pubDate>
<ttl>1800</ttl>
<item>
<title>Example entry</title>
<description>Here is some text containing an interesting
description.</description>
<link>http://www.example.com/blog/post/1</link>
<guid isPermaLink="false">7bd204c6-1655-4c27-aeee-53f933c5395f</guid>
<pubDate>Sun, 06 Sep 2009 16:20:00 +0000</pubDate>
</item>
</channel>
</rss> ` // rss example courtesy wikipedia
And all you'd need is an XML parser for EcmaScript tagged templates, or for a
specific XML application such as RSS, an application specific handler which
would probably be layered on top of such an XML parser. And XML is actually not
that hard to parse, in difference to HTML, thanks to its draconic error
handling. It's actually the XML application handlers that might get more
involved.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss