How to reference the user defined DTD when creating new task
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 35
- Joined: Thu Aug 15, 2019 5:31 pm
How to reference the user defined DTD when creating new task
Hi experts,
I have defined one own task type DTD and put it
1. following http://dita4practitioners.github.io/dit ... shell.html to create one folder named "C:\Program Files\Oxygen XML Editor 21\frameworks\dita\DITA-OT3.x\plugins\com.example.doctype.userdefine" for own DTD task type shell.
2. package the DTD task shell as the DITA OT.
3. as I run the "ant -f integrator.xml" failed, so I manually updated the "C:\Program Files\Oxygen XML Editor 21\frameworks\dita\DITA-OT3.x\plugins\org.dita.base\catalog-dita.xml" to add the below lines:
4. according to https://www.oxygenxml.com/doc/versions/ ... gin_method, I created a new folder called template_folders inside the C:\Program Files\Oxygen XML Editor 21\frameworks\dita\DITA-OT3.x\plugins\ directory and move the folder created by step 1 to it.
But when I new one new file, couldn't find my own task file template.
Could you please help me with this and see if there are anything wrong? Or could you please point me that how to reference the user defined DTD when creating new task?
PS: the folder "com.example.doctype.userdefine" has been added in this question. Thanks a lot
I have defined one own task type DTD and put it
1. following http://dita4practitioners.github.io/dit ... shell.html to create one folder named "C:\Program Files\Oxygen XML Editor 21\frameworks\dita\DITA-OT3.x\plugins\com.example.doctype.userdefine" for own DTD task type shell.
2. package the DTD task shell as the DITA OT.
3. as I run the "ant -f integrator.xml" failed, so I manually updated the "C:\Program Files\Oxygen XML Editor 21\frameworks\dita\DITA-OT3.x\plugins\org.dita.base\catalog-dita.xml" to add the below lines:
Code: Select all
<nextCatalog catalog="../com.example.doctype.userdefine/catalog.xml"/>
But when I new one new file, couldn't find my own task file template.
Could you please help me with this and see if there are anything wrong? Or could you please point me that how to reference the user defined DTD when creating new task?
PS: the folder "com.example.doctype.userdefine" has been added in this question. Thanks a lot
com.example.doctype.userdefine.zip
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9437
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to reference the user defined DTD when creating new task
Hi,
For step (3) I answered you here:
post55028.html#p55028
for step (4) our documentation is incorrect and we'll rectify it, the new file template should be created in the folder structure: OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT3.x\plugins\com.example.doctype.userdefine\template_folders\. So the "template_folders" folder needs to be inside your plugin's folder and not inside the parent "plugins" folder.
In my case I created for tests this new file template:
OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT3.x\plugins\com.example.doctype.userdefine\template_folders\Tasks\CustomTask.xml
with the contents:
I looked more into your plugin because it still does not properly work. In the DTD "com.example.doctype.userdefine\task\dtd\task.dtd" this reference:
is resolved preferring the public ID to the DITA 1.3 task.mod instead of yours. You could replace it with:
to force the reference to resolve to your custom task.mod.
Same for this reference:
you can replace it with:
so that your custom "task.ent" is used.
You will also need a couple more changes, replace:
with:
and create a "strictTaskbodyConstraint.mod" module file next to your custom "task.mod" containing:
This is necessary because the original "strictTaskbodyConstraint.mod" defines the entity "taskbody.content" and because it's included first you cannot override it anymore.
I'm attaching my changes below:
Radu
For step (3) I answered you here:
post55028.html#p55028
for step (4) our documentation is incorrect and we'll rectify it, the new file template should be created in the folder structure: OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT3.x\plugins\com.example.doctype.userdefine\template_folders\. So the "template_folders" folder needs to be inside your plugin's folder and not inside the parent "plugins" folder.
In my case I created for tests this new file template:
OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT3.x\plugins\com.example.doctype.userdefine\template_folders\Tasks\CustomTask.xml
with the contents:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "urn:pubid:dita4practitioners.com:doctypes:dita:task" "task.dtd">
<task id="${id}">
<title></title>
<taskbody></taskbody>
</task>
Code: Select all
<!ENTITY % task-type
PUBLIC "-//OASIS//ELEMENTS DITA 1.3 Task//EN"
"task.mod"
>%task-type;
Code: Select all
<!ENTITY % task-type SYSTEM "task.mod"
>%task-type;
Same for this reference:
Code: Select all
<!ENTITY % task-dec
PUBLIC "-//OASIS//ENTITIES DITA 1.3 Task//EN"
"task.ent"
>%task-dec;
you can replace it with:
Code: Select all
<!ENTITY % task-dec
SYSTEM
"task.ent"
>%task-dec;
You will also need a couple more changes, replace:
Code: Select all
<!ENTITY % strictTaskbody-def
PUBLIC "-//OASIS//ELEMENTS DITA 1.3 Strict Taskbody Constraint//EN"
"strictTaskbodyConstraint.mod"
>%strictTaskbody-def;
Code: Select all
<!ENTITY % strictTaskbody-def SYSTEM
"strictTaskbodyConstraint.mod"
>%strictTaskbody-def;
Code: Select all
<!ENTITY taskbody-constraints
"(topic task strictTaskbody-c)"
>
<!ENTITY % prereq "prereq">
<!ENTITY % context "context">
<!ENTITY % steps "steps">
<!ENTITY % steps-unordered "steps-unordered">
<!ENTITY % result "result">
<!ENTITY % tasktroubleshooting "tasktroubleshooting">
<!ENTITY % example "example">
<!ENTITY % postreq "postreq">
I'm attaching my changes below:
com.example.doctype.userdefine.zip
Regards,Radu
You do not have the required permissions to view the files attached to this post.
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 35
- Joined: Thu Aug 15, 2019 5:31 pm
Re: How to reference the user defined DTD when creating new task
Thanks a lot Radu. The steps and example is very clear.
Still have one further question: when I tried to create one CustomTask type file document, the default postfix for the new file in "save as" line of "New" dialog is "xxxxxxxx.xml"
How can I change it to "xxxxx.dita"?
Still have one further question: when I tried to create one CustomTask type file document, the default postfix for the new file in "save as" line of "New" dialog is "xxxxxxxx.xml"
How can I change it to "xxxxx.dita"?
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service