本文整理了Java中org.apache.shindig.gadgets.templates.XmlTemplateLibrary.bypassTemplateSanitization()
方法的一些代码示例,展示了XmlTemplateLibrary.bypassTemplateSanitization()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlTemplateLibrary.bypassTemplateSanitization()
方法的具体详情如下:
包路径:org.apache.shindig.gadgets.templates.XmlTemplateLibrary
类名称:XmlTemplateLibrary
方法名:bypassTemplateSanitization
[英]For "safe" libraries, bypass sanitization. Sanitization should be bypassed on each element in the tree, but not on the whole tree (false, not true, in the call to bypassSanitization() below), since os:Render elements will insert unsafe content.
[中]对于“安全”的图书馆,绕过消毒。应该在树中的每个元素上绕过清理,但不能在整个树上绕过清理(在下面对BypassSanitation()的调用中为false,而不是true),因为os:Render元素将插入不安全的内容。
代码示例来源:origin: com.lmco.shindig/shindig-gadgets
/**
* For "safe" libraries, bypass sanitization. Sanitization should
* be bypassed on each element in the tree, but not on the whole
* tree (false, not true, in the call to bypassSanitization() below),
* since os:Render elements will insert unsafe content.
*/
private void bypassTemplateSanitization(Element template) {
SanitizingGadgetRewriter.bypassSanitization(template, false);
NodeList children = template.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node node = children.item(i);
if (node instanceof Element) {
bypassTemplateSanitization((Element) node);
}
}
}
代码示例来源:origin: org.gatein.shindig/shindig-gadgets
/**
* For "safe" libraries, bypass sanitization. Sanitization should
* be bypassed on each element in the tree, but not on the whole
* tree (false, not true, in the call to bypassSanitization() below),
* since os:Render elements will insert unsafe content.
*/
private void bypassTemplateSanitization(Element template) {
SanitizingGadgetRewriter.bypassSanitization(template, false);
NodeList children = template.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node node = children.item(i);
if (node instanceof Element) {
bypassTemplateSanitization((Element) node);
}
}
}
代码示例来源:origin: org.apache.shindig/shindig-gadgets
/**
* For "safe" libraries, bypass sanitization. Sanitization should
* be bypassed on each element in the tree, but not on the whole
* tree (false, not true, in the call to bypassSanitization() below),
* since os:Render elements will insert unsafe content.
*/
private void bypassTemplateSanitization(Element template) {
SanitizingGadgetRewriter.bypassSanitization(template, false);
Node childNode = template.getFirstChild();
while(childNode != null) {
if (childNode instanceof Element) {
bypassTemplateSanitization((Element) childNode);
}
childNode = childNode.getNextSibling();
}
}
代码示例来源:origin: org.gatein.shindig/shindig-gadgets
private TagHandler createHandler(String tagName, Element template,
Set<TemplateResource> resources)
throws TemplateParserException {
String [] nameParts = StringUtils.splitPreserveAllTokens(tagName, ':');
// At this time, we only support namespaced tags
if (nameParts.length != 2) {
return null;
}
String namespaceUri = template.lookupNamespaceURI(nameParts[0]);
if (!nsPrefix.equals(nameParts[0]) || !nsUri.equals(namespaceUri)) {
throw new TemplateParserException(
"Can't create tags in undeclared namespace: " + nameParts[0]);
}
if (isSafe()) {
bypassTemplateSanitization(template);
}
return new LibraryTagHandler(
createTagHandler(template, namespaceUri, nameParts[1]),
resources);
}
代码示例来源:origin: com.lmco.shindig/shindig-gadgets
private TagHandler createHandler(String tagName, Element template,
Set<TemplateResource> resources)
throws TemplateParserException {
String [] nameParts = StringUtils.splitPreserveAllTokens(tagName, ':');
// At this time, we only support namespaced tags
if (nameParts.length != 2) {
return null;
}
String namespaceUri = template.lookupNamespaceURI(nameParts[0]);
if (!nsPrefix.equals(nameParts[0]) || !nsUri.equals(namespaceUri)) {
throw new TemplateParserException(
"Can't create tags in undeclared namespace: " + nameParts[0]);
}
if (isSafe()) {
bypassTemplateSanitization(template);
}
return new LibraryTagHandler(
createTagHandler(template, namespaceUri, nameParts[1]),
resources);
}
代码示例来源:origin: org.apache.shindig/shindig-gadgets
private TagHandler createHandler(String tagName, Element template,
Set<TemplateResource> resources)
throws TemplateParserException {
String [] nameParts = StringUtils.splitPreserveAllTokens(tagName, ':');
// At this time, we only support namespaced tags
if (nameParts.length != 2) {
return null;
}
String namespaceUri = "";
synchronized (template) {
namespaceUri = template.lookupNamespaceURI(nameParts[0]);
}
if (!nsPrefix.equals(nameParts[0]) || !nsUri.equals(namespaceUri)) {
throw new TemplateParserException(
"Can't create tags in undeclared namespace: " + nameParts[0]);
}
if (isSafe()) {
bypassTemplateSanitization(template);
}
return new LibraryTagHandler(
createTagHandler(template, namespaceUri, nameParts[1]),
resources);
}
内容来源于网络,如有侵权,请联系作者删除!