xsl xml 中的标记
我目前将 html 标记存储在 xsl 和 xml 中。这之前使我能够根据传递到 xsl 文件中的变量呈现 html 标记。目的是根据站点变量提供常见的页面功能,例如横幅、页脚。随着项目变得越来越大,我发现这种方法有限制,因为我最终复制了 xml/xsl 文件中的相当多的内容以满足每个站点的单独需求。
xsl/xml 的替代方案是什么?目前有更好的选择吗?从编程的角度来看,我发现它非常有限。
I currently have html markup stored in xsl and xml. This has previously enabled me to render html markup based on variables I pass into the xsl file. The purpose is to serve common page features such as banner, footer based on site variables. As the project got bigger, I find this approach limiting, as I ended up replicating quite bit of the contents within the xml/xsl files to suit the individual needs of each site.
What is the alternative to xsl/xml? Are there currently better otpions? Coming from a programming perspective, I find it very limiting.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那里有无数的 Web 模板框架。这是有关该主题的维基百科条目,相当详尽。
你是在客户端进行渲染吗?该文章中有一堆客户端模板选项,但是我唯一研究过的是 Mustache,它似乎取得了很好的平衡简单性和功能性。实际上,Mustache 也可以在服务器端运行。
祝你好运!
There are a gazillion web templating frameworks out there. Here's the wikipedia entry on the subject, which is fairly thorough.
Are you doing the rendering client-side? There are a pile of client-side templating options in that article, but the only one I have looked into is Mustache, which seems to strike a nice balance of simplicity and functionality. Actually, Mustache can be run server-side as well.
Good luck!