我需要获取像这样的内容
<script type="text/vnd.graphviz" id="genealogy">
digraph genealogy {
ratio="auto";
rankdir="BT";
edge [style=solid arrowhead=none arrowtail=normal ];
node [color=lightblue style=filled shape=box ];
"118" [label="Max Mustermann"];
"812" -> "118" [];
"812" [label="Luise Mustermann"];
};
</script>但不幸的是
<h:outputScript id="genealogy">
digraph genealogy {
ratio="auto";
rankdir="BT";
edge [style=solid arrowhead=none arrowtail=normal ];
node [color=lightblue style=filled shape=box ];
"118" [label="Max Mustermann"];
"812" -> "118" [];
"812" [label="Luise Mustermann"];
};
</h:outputScript>只是给了我
<script type="text/javascript">
digraph genealogy {
ratio="auto";
rankdir="BT";
edge [style=solid arrowhead=none arrowtail=normal ];
node [color=lightblue style=filled shape=box ];
"118" [label="Max Mustermann"];
"812" -> "118" [];
"812" [label="Luise Mustermann"];
};
</script>所以我的问题是:如何将文本“家谱”(和type=“id=/vnd.graphviz”)放到-Tag中?
发布于 2013-06-08 00:46:14
在源代码中,type="text/javascript"是硬编码的,因此您不能使用h:outputScript标记进行编码。
@Override
protected void startElement(ResponseWriter writer, UIComponent component) throws IOException {
writer.startElement("script", component);
writer.writeAttribute("type", "text/javascript", "type");
}来自ScriptRenderer.java。
我看到的唯一方法就是使用普通的HTML标记!
https://stackoverflow.com/questions/16988806
复制相似问题