XML DTD validation error: The content of element type "diagram" must match

193 views Asked by At

I dont know why am getting the following error: Line 70 Column 11 : The content of element type "diagram" must match "(diagram_value,goal,qualitygoal,agent*)"*. I have tried changing the DTD constraints in the childs of the root element but that does not seem to work. I have also made also made sure that all the child elements of the root element are included in the xml, but the error still shows.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE diagram [
  
  <!ELEMENT diagram (diagram_value,goal,qualitygoal*,agent*)>
  <!ELEMENT diagram_value (#PCDATA)>
  
  
  <!ELEMENT goal (refinement_level*,goal_value+)>
  <!ELEMENT refinement_level (#PCDATA)>
  <!ELEMENT goal_value (#PCDATA)>
  <!ATTLIST goal goal_id ID #REQUIRED>
  <!ATTLIST goal decomposed_from IDREFS #IMPLIED>
  <!ATTLIST goal associated_to IDREFS #IMPLIED>
  
  
  <!ELEMENT qualitygoal (qualitygoal_value+)>
  <!ELEMENT qualitygoal_value (#PCDATA)>
  <!ATTLIST qualitygoal qualitygoal_id ID #REQUIRED>
  
  
  <!ELEMENT agent (agent_type+)>
  <!ELEMENT agent_type (software_agent|human_agent)>
        <!ELEMENT software_agent (#PCDATA)>
        <!ELEMENT human_agent (#PCDATA)>
  <!ATTLIST agent agent_id ID #REQUIRED>
  
  
]>

<diagram>
    <diagram_value>IdCredit value proposition, first- and second level goal model</diagram_value>

<!--list of quality goals in the diagram--> 
 <qualitygoal qualitygoal_id="q1">
  <qualitygoal_value>trustworthy</qualitygoal_value>
 </qualitygoal>
 <qualitygoal qualitygoal_id="q2">
  <qualitygoal_value>scalable</qualitygoal_value>
 </qualitygoal> 
 <qualitygoal qualitygoal_id="q3">
  <qualitygoal_value>secure</qualitygoal_value>
 </qualitygoal>

<!--list of agents in the diagram-->  
 <agent agent_id="a1">
  <agent_type >
   <software_agent>transaction rule</software_agent>
  </agent_type>
 </agent>
 
 
<!--root goal or value proposition and associations -->  
    <goal goal_id="g0">
        <refinement_level>0</refinement_level>
        <goal_value>A Decentralized Blockchain System for the Attestation and Authorization of Digital Assets</goal_value>
    </goal>

<!--goal refinement_levels and associations-->      
  <goal goal_id="g1" decomposed_from="g0" associated_to="q1 q2 q3">
   <refinement_level>1</refinement_level>
   <goal_value>manage transaction</goal_value>
  </goal>   
    
  
    <goal goal_id="g1.1" decomposed_from= "g1 g0" associated_to="a1">
    <refinement_level>2</refinement_level>
    <goal_value>create transaction rule</goal_value>
   </goal>
    
</diagram>

1

There are 1 answers

0
chibuzor joe On

Fixed it by ordering the child elements of the root element correctly. The comment here was helpful: enter link description here