Css on XML:用颜色突出显示某些字符串 [英] Css on XML: highlight certain strings with color
本文介绍了Css on XML:用颜色突出显示某些字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想突出显示使用内置CSS在XML文件中出现的某些模式。
I want to highlight certain patterns that occur in a XML file using built-in CSS.
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="#style"?>
<ROOT>
<buffer>
Hello World 1234567890.
</buffer>
<STYLING id="style">
STYLING {display: none;}
buffer {display: block;color: blue;}
buffer.<World> {display: block;color: green;}
STYLING {display: none;}
</STYLING>
</ROOT>
我的尝试:
___________________________________________
What I have tried:
___________________________________________
推荐答案
你甚至没有关闭...
见这里: XML和CSS [ ^ ]
还要注意XML应该使用XSLT而不是CSS格式化......
见这里: XML和XSLT [ ^ ]
You are not even close...
See here: XML and CSS[^]
Also notice that XML should be formatted using XSLT and not CSS...
See here: XML and XSLT[^]
我阅读的文档说CSS无法显示某些节点内容模式。应使用不同的脚本语言,如JS,JSON或PHP。
I read the documentation that says CSS cannot display certain patterns of the node content. A different scripting language as JS, JSON or PHP should be used.
这篇关于Css on XML:用颜色突出显示某些字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文