我有一个DTD文件,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<!--=========================
XML Construct Domain Module
==========================-->
<!ENTITY % category "category">
<!ENTITY % pattern "pattern">
<!ENTITY % template "template">
<!ENTITY % category.content "((pattern)?|(template)*)">
<!ENTITY % category.attribute " ">
<!ELEMENT category %category.content;>
<!ATTLIST category %category.attribute;>
<!ATTLIST category %global-atts; class CDATA "+ topic/foreign aiml-d/category">
<!ENTITY % pattern.content "(#PCDATA)">
<!ENTITY % pattern.attribute " ">
<!ELEMENT pattern %pattern.content;>
<!ATTLIST pattern %pattern.attribute;>
<!ATTLIST pattern %global-atts; class CDATA "+ topic/foreign aiml-d/pattern">
<!ENTITY % template.content "(#PCDATA)*">
<!ENTITY % template.attribute " ">
<!ELEMENT template %template.content;>
<!ATTLIST template %template.attribute;>
<!ATTLIST template %global-atts; class CDATA "+ topic/foreign aiml-d/template">
这是我的XML文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE concept SYSTEM "C:\Users\lenovo\Desktop\dita-ot-3.0\plugins\org.dita.docbook-aiml\resource\concept.dtd">
<concept id="topicid">
<title>Test concept</title>
<conbody>
<p>
<category>
<pattern>WHAT IS DITA</pattern>
<template>DITA is kind of content organization stucture.</template>
</category>
</p>
</conbody>
</concept>
当我验证XML文件时,出现错误消息“元素类型“类别”不得声明多次。”但是我已经检查了文件,没有两次声明。我不知道文件出了什么问题。
我已经尝试过在StackOverflow上提出的解决方案,但是仍然无法正常工作。