我有这个 dtd :http://fast-code.sourceforge.net/template.dtd但是当我包含在 xml 中时,我收到警告:
未检测到文档的语法约束(DTD 或 XML 模式)。
xml 是:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE templates PUBLIC "//UNKNOWN/" "http://fast-code.sourceforge.net/template.dtd">
<templates>
<template type="INSTANCE_OF_CLASS">
<description>Used to Create instance of class</description>
<variation>asasa</variation>
<variation-field>asasa</variation-field>
<class-pattern>asasa</class-pattern>
<getter-setter>setter</getter-setter>
<allowed-file-extensions>java</allowed-file-extensions>
<number-required-classes>1</number-required-classes>
<allow-multiple-variation>false</allow-multiple-variation>
<template-body>
<![CDATA[
// Creating new instance of ${class_name}
final ${class_name} ${instance} = new ${class_name}();
#foreach ($field in ${fields})
${instance}.${field.setter}(${field.value});
#end
]]>
</template-body>
</template>
</templates>
EDIT:我更改了 xml,现在收到此错误:
元素类型“template”的内容必须匹配“(description,variation?,variation-field?,allow-
多重变体?,类模式?,getter-setter?,允许的文件扩展名?,需要数量-
类?,模板主体)”。
我通过指定摆脱了这个烦人的警告<!DOCTYPE xml>
之后<?xml ... >
标签而不是指定其他内容(例如templates
在你的情况下)。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)