Pages: 1
Print
Author Topic: Questions about creating specialized elements  (Read 3299 times)
txvia
Member

Posts: 44


« on: September 10, 2011, 12:54:36 PM »

Hi folks, I want to create a new specialized element called <artifact>; I dug through countless online tutorials as well as this forum, and still could not find an easy way to get this done. I understand doing this involves editing or creating a new DTD file and the whole nine yards.

Could you please show me an easy way to do this, because this is the first time I am doing this without any prior knowledge or ideas about DTDs and DITA OT.

Should I create a new element? Or should I just simply "extend" an existing element using the "outputclass" attribute? Even for the latter, I am not even sure how to do it right! Could you please show me how to do this the easy way?

What I want to do is to duplicate the <codeph> tag and create one called <artifact> that looks and feels like <codeph>. In addition, I'd like to be able to select and use this tag from the right-hand pane of the XMetal GUI when I am editing a DITA file. I am currently using XMetal 6.x SP1. Thanks for your help!
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: September 12, 2011, 12:07:42 PM »

You sort of have two questions here. One is whether to specialize or not. I won't attempt to answer that as there is information elsewhere on this that would give a better answer than me. You seem to have an idea that you could possibly get by using @outputclass. That is a very valid option depending on what you actually need to make these changes for. If it is to affect output then that might be the easiest route.

The Rockley Group (http://www.rockley.com/) has a book called DITA 101 that discusses why you would want to specialize that may be worth having a look at. This book is really cheap (last time I checked the electronic version was about $10) considering everything it contains.

If you decide to go with specialization your first step is to create a valid DITA specialized DTD. Please see Eliot Kimber's tutorial on this subject as I think it is easiest to follow. You will probably want to read higher level topics, but "Topic Specialization Tutorial" is likely to get you where you need to go: http://xiruss.org/tutorials/dita-specialization/

Two things to note:
1) Out of the box XMetaL Author Enterprise 6.0 and 6.0 SP1 are configured for authoring with the DITA 1.1 DTDs. You can swap those for 1.0 (we include the older 1.0 DTDs), but we don't include 1.2. If you need DITA 1.2 you can contact XMetaL Support and ask about it. However, adding 1.2 into the mix will likely just make things harder. None of the CMS systems that we integrate with (and in fact as far as I know no CMS systems in existence) truly support DITA 1.2 at this time. So, if you use a CMS 1.1 is your best option.
2) XMetaL currently only uses the DITA DTDs so you can ignore anything that discusses XSD.

Once you have a valid DTD you can follow the instructions in the XMetaL Author Enterprise help. The relevant section is Working with DITA > DITA Specializations.
Logged
txvia
Member

Posts: 44


« Reply #2 on: September 12, 2011, 02:49:17 PM »

Hi Derek: Thanks for the reply. I think the issue lies not on whether or not I want specialize elements, but I want specialized elements :) I read about setting outputclass but didn't seem to work for me.

I then added <artifact> to a number of files including topic.dtd and so on, and seemed to get it to appear in the element list and was able to use it. But after that, two new problems arise:

1. I am only able to see the <artifact> element in all DITA topics: test, concept, composite, with the exception of topic when I want to select a new topic DITA file to work on.

2. I want to duplicate the <artifact> element by having it look exactly like <codeph> but was unable to do so.

Could you help? Thanks.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: September 13, 2011, 03:32:05 PM »

Simply making modifications to the DITA DTDs that do not follow the DITA specifications for specializing is not the recommended way to do things. You really need to create a specialized DITA DTD. XMetaL Author itself (the core product) has the ability to read any valid DTD, valid to the W3C XML 1.0 Recommendation (and the DTD you have created is likely valid) and so the core functionality (the Element List and Attribute Inspector) will likely work, as well as validation and other functionality. However, the DITA functionality, which is additional functionality added to the core product specifically for authoring DITA documents, may not function properly unless you have a properly specialized DITA DTD.

Following Eliot Kimber's tutorial for specializing a DITA DTD is what I would recommend. If you do that (and integrate it according to our instructions in the product) then our DITA authoring functionality should "just work" (no additional hacking of our code, CSS files, etc, required). One benefit (that you have seen not working) is that the CSS files we ship have been coded to be "specialization savvy", meaning that if you have an element named <artifact> that is a specialized element based on <codeph> it will end up looking the same in the editor. In addition, the DITA Open Toolkit will also create similar looking output to <codeph> for your <artifact> element when you generate output. You would actually need to specifically add additional code in both cases to have the element styled differently.

You may wish to watch the webinar here to get a better idea of what you can expect: http://forums.xmetal.com/index.php/topic,1164.0.html
« Last Edit: September 13, 2011, 03:34:02 PM by Derek Read » Logged
Pages: 1
Print
Jump to: