Allow XML syntax for RSP files

55 views
Skip to first unread message

Iván Zaera Avellón

unread,
Apr 10, 2013, 7:35:41 AM4/10/13
to rik...@googlegroups.com
Hi all:


What I request is that web_ui compiler accepts XML as input, not only HTML, so that it is easier to integrate it with other compilers.

Whether or not it gets done, I think that it would be a good thing to allow RSP syntax to be written as XML. An RSP would look like this:

------------------------------------
<!DOCTYPE html>
<html ns:rsp="http://www.rikulo.org">
<rsp:page partOf="mylib" args="String title,List<String> items"/>
<head>
   <title><rsp:valueOf expr="title"/></title>
</head>
<body>

<table>
  <rsp:forEach var="item" collection="items">
     <tr>
       <td>Row:</td>
       <td><rsp:valueOf expr="item"/></td>
     </tr>
  </rsp:for>
</table>

</body>
</html>
------------------------------------


I am aware that XML syntax is more cumbersome than current RSP syntax, but it allows more extensibility, makes parsing easier, and lets designers work with RSP files directly in their HTML composers. There was the same "problem" with JSP that lead to the JSPX specification. I think we should learn from that and prepare for it.

Please beware that I'm not saying that we should discard current syntax as it is far more productive in scenarios where XML is not needed, but I definitely propose to support both in the mid-term (like JSP and JSPX does).

Opinions?

Regards,
Ivan

Tom Yeh

unread,
Apr 11, 2013, 2:19:17 AM4/11/13
to rik...@googlegroups.com

There are a few reasons we don’t use XML syntax. First, RSP is designed to handle any kind of text files, such as CSS. Second, it requires a XML parser, and, worse, HTML is not 100% compatible with XML (see html5plus – it is why I forked it from html5lib). Also, XML is too complicated but less flexible. For example, it is hard to specify an expression in XML attributes with another XML tags.

Regarding extension, I don’t think namespace is a must. For example, you can prefix the custom tags with a special prefix. XML namespace is overkill to me -- without tool, it is hard to remember these namespaces and not easy to link a prefix back to a namespace (unless all docs follows the same rule).

On the other hand, the inability of loading Dart code at run time is actually the limited factor for customization. I don't find a good way to import custom code without knowing its existence in advance.

Reply all
Reply to author
Forward
0 new messages