javascript 元素的内容必须由格式良好的字符数据或标记组成
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29523016/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The content of elements must consist of well-formed character data or markup
提问by user3710320
<table id="header" align="center">
<#assign PI = primaryId />
<#if (PI.getIdentified())><table id="header" align="center">
I run into the following error any help appreciated,I try to read some other related topics but I can't understand exactly what happen. The error pointed to <#assign PI = primaryId /> .
我遇到了以下错误,感谢任何帮助,我尝试阅读其他一些相关主题,但我无法完全理解发生了什么。错误指向 <#assign PI = primaryId /> 。
[Fatal Error] header.ftl:19:23: The content of elements must consist of well-formed character data or markup
[致命错误] header.ftl:19:23:元素的内容必须由格式正确的字符数据或标记组成
回答by ddekany
From the error message, you are trying to parse the FTL with an XML parser. Of course, FTL is not well-formed XML (though with the square bracket syntax, like [#assign ...]
it can be). Maybe you meant to parse the outputof the template as XML, not the template itself.
根据错误消息,您正尝试使用 XML 解析器解析 FTL。当然,FTL 不是格式良好的 XML(尽管可以使用方括号语法[#assign ...]
)。也许您打算将模板的输出解析为 XML,而不是模板本身。