简体   繁体   English

ColdFusion 或 Java 中的 CSS 解析器?

[英]CSS Parser in ColdFusion or Java?

I'm building something that requires a simple HTML frontend for editing some properties in CSS.我正在构建的东西需要一个简单的 HTML 前端来编辑 CSS 中的一些属性。 However, I need to get the value specified by a CSS file.但是,我需要获取 CSS 文件指定的值。

The only parser I can find is CSS Parser Project , and it is in Java.我能找到的唯一解析器是CSS Parser Project ,它位于 Java 中。 It implements both Document Object Model Level 2 Style & SAC: The Simple API for CSS API. It implements both Document Object Model Level 2 Style & SAC: The Simple API for CSS API. It should work, but we have not tried.它应该可以工作,但我们还没有尝试过。 Any tutorial on this project or the API's?关于这个项目或 API 的任何教程?

Another solution my team can think of is to push that responsibility to the client's browser + jQuery .我的团队可以想到的另一个解决方案是将责任推给客户的浏览器 + jQuery However, it doesn't seem very reliable and efficient.但是,它似乎不是很可靠和有效。

Regular expression does not seem to be the right tool for fishing out properties from CSS.正则表达式似乎不是从 CSS 中提取属性的正确工具。

Anyone has a better/simpler solution?有人有更好/更简单的解决方案吗? Thanks!谢谢!

Ben Nadel has created a CSS parser in ColdFusion - it's not fully featured yet, but it might be good enough? Ben Nadel在 ColdFusion 中创建了一个 CSS 解析器- 它的功能还没有完全,但它可能已经足够好了?

He's also been doing a lot of other CSS-related stuff recently, so if you need more things take a poke around his blog.他最近还做了很多其他与 CSS 相关的事情,所以如果你需要更多的东西,可以浏览他的博客。

The only parser I can find is CSS Parser Project... Any tutorial on this project or the API's?我能找到的唯一解析器是 CSS 解析器项目...关于这个项目或 API 的任何教程?

It looks like this may have beenrenamed from a previous project - here's the API: http://www.docjar.com/docs/api/com/steadystate/css/overview-summary.html看起来这可能是从以前的项目中重命名的——这里是 API: http://www.docjar.com/docs/api/com/steadystate/css/overview-summary.ZFC35FDCZ8A8228

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM