Reputation: 2210
The following xml snippet produces the following error from Xerces engine using Oxygen XML Editor:
Unexpected element "codeblock". The content of the parent element type must match "(dl|div|lcInteractionBase2|lcTrueFalse2|lcSingleSelect2|lcMultipleSelect2|lcSequencing2|lcMatching2|lcHotspot2|lcOpenQuestion2|fig|imagemap|lcInteractionBase|lcTrueFalse|lcSingleSelect|lcMultipleSelect|lcSequencing|lcMatching|lcHotspot|lcOpenQuestion|image|lines|lq|note|lcInstructornote|lcInstructornote2|object|ol|p|pre|simpletable|sl|table|ul|boolean|cite|keyword|ph|b|i|line-through|overline|sup|sub|tt|u|q|term|text|tm|xref|state|data|sort-as|data-about|foreign|unknown|draft-comment|fn|indextermref|indexterm|required-cleanup)".
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE learningContent PUBLIC "-//OASIS//DTD DITA Learning Content//EN" "learningContent.dtd">
<learningContent id="oc4j_learning_task1">
<title>Task 1</title>
<shortdesc></shortdesc>
<learningContentbody></learningContentbody>
<task id="oc4j_task1">
<title>Task 1</title>
<shortdesc/>
<taskbody>
<context>
<p><b>Requirements</b></p>
</context>
<steps>
<step>
<cmd>Login with sftp in the production server</cmd>
</step>
<step>
<cmd>Download the whole directory OC4J10 in your local directory</cmd>
</step>
<step>
<cmd>Make sure the system is using the same JDK (currently 1.6.0_45) from Oracle</cmd>
</step>
<step>
<cmd>Change the following files in /OC4J10/j2ee/home/config</cmd>
<substeps id="substeps_vty_xh4_dw">
<substep>
<cmd>application.xml</cmd>
<info>the file should point to the WAR (or expanded) files in your local
machine where the application modules are located as in following
example:
<codeblock>foo
</codeblock>
</info>
</substep>
</substeps>
</step>
</steps>
</taskbody>
</task>
</learningContent>
I tried to put a parent element like a div (as is suggested by the error?) but it doesn't work either.
Upvotes: 3
Views: 751
Reputation: 1924
It seems that both the DITA 1.2 and DITA 1.3 learning domain DTDs do not include the programming domain module so the codeblock is not allowed anywhere in a "learningContent". So Oxygen is just following the specs when it reports a validation error. So for example if you look at the shell DTD for a DITA task: "DITA-OT\dtd\technicalContent\dtd\task.dtd" it references inside the programming domain (which incorporates elements like codeblock or codeph) but the learning shell DTD "DITA-OT2.x\plugins\org.oasis-open.dita.v1_3\dtd\learning\dtd\learningContent.dtd" does not. So you would probably need a learning and training dtd specialization which also adds the programmind domain.
Upvotes: 2
Reputation: 218
This example does not work at XMetal 11 either (tested also in Oxygen 17.0), because it does not follow the DTDs (as Radu Coravu said).
Upvotes: 1
Reputation: 516
According to the spec, this should be correct. You don't mention which version of oXygen you're using. You can try wrapping the codeblock in a P element but I get the feeling that the error is being caused by the task being embedded in the learningContent topic. It may be that set of specializations don't include codeblock that way.
Upvotes: 1