Artima新闻:Ryan Tomayko发布Kid 0.5

Ryan Tomayko发布了Kid0.5版。Kid是一个基于XML的Python模板语言的开源项目. 你可以利用Kid项目在XML中嵌入Python语言,利用动态语言的强大能力轻松完成工作。一个明显应用将是在web环境下,就象PHP所做的那样。

Ryan Tomayko has posted Kid 0.5, "a simple Pythonic template language for XML based vocabularies. It was spawned as a result of a kinky love triangle between XSLT, TAL, and PHP." The language is based on just six attributes: kid:for, kid:if, kid:def, kid:content, kid:omit, and kid:replace; each of which contains a Python expression. Since this expression can point to externally defined functions, this is most of what you need. In addition there are attribute value templates similar to XSLT's, and <?python?> processing instructions can embed code directly in the XML document. I'm not sure I approve of the use of processing instructions in the language, but I'm not sure I don't either. Not having to escape XML-significant symbols like < and & in the embedded code is convenient. Kid templates are compiled to Python byte-code and can be imported and invoked like normal Python code. Kid templates generate SAX events and can be used with existing libraries that work along SAX pipelines. This release changes the license from GPL to MIT. Overall it looks like a fairly well-designed, well-thought out system that has clearly learned from the mistakes of gnarly systems like PHP, JSP, and ASP.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值