DITA and XMetaL Discussion
ramu January 2, 2014 at 10:09 am
customized templateJanuary 2, 2014 at 10:09 amParticipants 4Replies 5Last Activity 8 years, 9 months ago
Hello every one,
I trying to customize the default template.
For example in concept template, it looks like this
Now i want to add one more tag fot concept. (say
). then it should look like this
?xm-replace_text Concept Title?>
when i entered directly, it will show some error(this element can't be inserted ).
please help me how to do thisDerek Read January 2, 2014 at 8:03 pm
Reply to: customized templateJanuary 2, 2014 at 8:03 pm
Your first example looks like a valid DITA concept (minus the XML prolog) but your second document is not.
Perhaps you have specialized DITA? If you have then you will need to ensure your specialized DITA DTDs are valid and then follow the procedure in Help under “Working with DITA” > “DITA Specializations” to configure XMetaL Author Enterprise to recognize your DTDs as DITA.
If you have not specialized DITA then your issue is that you are creating an invalid concept. The element you wish to insert is not allowed in a concept. You will not be able to insert this element using the Element List (it will not be listed as a choice). If you do insert the element (perhaps by typing it in using Plain Text view or while using another application) a validation error will be displayed when XMetaL validates the document. The error will be similar to: “Unknown tag name. The tag name 'volume' is not defined.”
The concept document type does not support a “volume” element. In addition, in a DITA concept the first element must be “title”. No other element can appear before it.
[quote=DITA spec – concept element content model]( (title) then (titlealts) (optional) then (abstract or shortdesc) (optional) then (prolog) (optional) then (conbody) (optional) then (related-links) (optional) then (concept) (any number) )
DITA does define a “volume” element, but not in a concept. The element is only allowed inside the bookmap document type (a bookmap is a specialized type of map).
To see details of the content model for any DITA element place your insertion point (text cursor) directly inside the element while the document is open in Tags On or Normal view and press Alt+F1. It is usually easiest to position your insert point for this while in Tags On view.
To understand how XMetaL Author helps you create valid XML read the Help topic “Authoring structured content” and the subtopics below it titled “Validation and rules checking” and “Working with elements”.Derek Read January 2, 2014 at 8:09 pm
Reply to: customized templateJanuary 2, 2014 at 8:09 pm
Reading the DITA specification documents may also help:
These specific topics relate to concept:
XMetaL Author Enterprise uses the DITA DTDs (which we get directly from OASIS) to figure out what is valid in any specific standard DITA document type.Derek Read January 2, 2014 at 8:18 pm
Reply to: customized templateJanuary 2, 2014 at 8:18 pm
Please also keep in mind that XMetaL Author Enterprise requires an XML prolog, including doctype declaration, in order to figure out which DTD to load when the document is loaded. Base any modified templates you create on the templates we include in the Template subfolder of the installation in order to get the prolog correct. You would get another set of messages if you do not include that, causing you to need to browse to locate the DTD. That is definitely something you do not want your end users doing.
The basic concept template that we include with XMetaL Author Enterprise 8.0 looks like this:
Here's a modified version that adds a couple of elements and removes the “created with” comment. You might have a template that looks like the following if all of your authors commonly include their name inside any DITA documents they write:
Note: If a CMS is involved check with the vendor that provides the integration for XMetaL Author Enterprise to see if they have any special requirements for templates.ramu January 23, 2014 at 12:53 pm
Reply to: customized templateJanuary 23, 2014 at 12:53 pm
So is it possible to make “volume” as a attribute in concept template??Derek Read January 23, 2014 at 7:51 pm
Reply to: customized templateJanuary 23, 2014 at 7:51 pm
I think you may be misunderstanding the role of templates in XMetaL Author. With XMetaL Author, adding something to its templates has no bearing on whether a document is valid or not, the DTD is used to determine XML validity. The template is just a starting point for the creation of new documents.
So yes, you could add a volume attribute to elements in an XML template that references the DITA concept DTD but then all of the new documents you create based on this template would be invalid. These new documents would still be validated against the concept DTD, which does not allow a volume attribute on any element (and it does not allow for a volume element either).
If you really need this attribute (or element) to be in your DITA documents you should specialize the DITA DTDs, probably basing your specialized concept on the standard DITA concept DTD. http://docs.oasis-open.org/dita/v1.2/os/spec/archSpec/specialize.html
Once you have a specialized DTD you will need to configure XMetaL Author Enterprise to use it. This is described in the XMetaL Author Enterprise documentation under the help topic Working with DITA > DITA specializations.
I think there may be some additional confusion on your side. In your latest response you mention a volume attribute whereas initially you were discussing a volume element (and included an XML sample showing a volume element). As I said previously, there is a volume element defined for the DITA bookmap document type, but that is the only document type that has this element. There are no DITA document types that define a volume attribute for any element. I'm not sure what level you are at with your understanding of XML or DITA, so I'm not sure if what I've said above will really help. Hopefully it does, but if not I would recommend reading up on those two things as you will need to have a pretty good understanding of both XML and DITA to create a specialized DITA DTD.
- You must be logged in to reply to this topic.