jelovirt / dita-generator

DITA Generator is a Python program that generates DITA shell DTDs, DITA topic specialization stubs, and DITA-OT plug-in stubs.
http://dita-generator-hrd.appspot.com/
Apache License 2.0
18 stars 1 forks source link

How to use generated attribute specialization? #21

Closed Fox32 closed 8 years ago

Fox32 commented 11 years ago

I'm tring to use the attribute specialization generator but I can't get it to work. I don't think that it is an issue with your generator - I think it's more a misunderstanding on my side. This is what I have done so far:

  1. Used the Attribute Specialization Generator to create a attribute named mytest
  2. Unzipped the folder into the DITA-OT 1.8 plugins directory
  3. Executed ant -f integrator.xml
  4. Created a dita map with a dita file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="test_topic" audience="expert">
  <title>Test Topic</title>
  <body>
    <p>
      Hello World!
    </p>
    <note mytest="blub">Note!</note>
  </body>
</topic>
  1. Executed ant -Dtranstype=xhtml -args.input=test.ditamap, I would expect that an output is generated but instead I get an error:
 [gen-list] [DOTJ013E][ERROR] Failed to parse the referenced file 'topic_test.dita'. 
The XML parser reported the following error:

 [gen-list] topic_test.dita Line 9:Attribute "mytest" must be declared for element type
 "note".

Did I forget a step while integrating the plugin? My goal is to filter the output with a ditaval file.

Thanks for your help!

jelovirt commented 11 years ago

In order to use attribute domains, you need a shell DTD that contains them. Instead of creating an attribute specialization, create a shell DTD and define your new attributes there. Then, install the plug-in into DITA-OT and write your documents using the new shell DTD. The generator should probably create a README file into the plug-in ZIP to instruct people on how to use the new shell.

Fox32 commented 11 years ago

Thanks for your help! That works as expected.

An alternative to a readme file would be more informations on the last page of the gerneration steps. Or add a additional page at the end. It should contain infos about:

You solved my problem, but I leave this open as a feature request.