Pages: 1
Print
Author Topic: Element not available in DITA specialization  (Read 577 times)
larrygolding
Member

Posts: 15


« on: August 30, 2011, 10:17:11 AM »

Using XMetaL Author Enterprise 6.0.1.030:

I made a DITA specialization of the "content" topic type, and installed it according to the instructions in the presentation http://www.slideshare.net/XMetaL/custom-xml-through-dita-specialization-in-xmetal. After restarting XMetaL, I can create a blank XML document based on my specialized DTD, I can insert the root element pspconcept, and I can insert the child elements title, shortdesc, and pspconbody specified by pspconcept's content model. So far so good; in plain text view I have:

<?xml version="1.0"?>
<!DOCTYPE pspconcept SYSTEM "C:\Program Files (x86)\Common Files\XMetaL Shared\DITA_OT\MyProject\PspConcept\pspConcept.dtd">
<pspconcept><title><?xm-replace_text Type new title here ?></title><shortdesc></shortdesc><pspconbody></pspconbody></pspconcept>


But when, in tags view, I place the cursor between the pspconbody start and end tags, the valid child element overview (the only valid child element in this preliminary version of my DTD) does not show up in the Element List pane (neither in the Used tab nor in the All tab); in fact, the Elements List pane is empty. Here is my module:

<!ENTITY % pspconcept "pspconcept">
<!ENTITY % pspconbody "pspconbody">
<!ENTITY % overview "overview">

<!ELEMENT pspconcept ((%title;),(%shortdesc;),(%pspconbody;))>

<!ATTLIST pspconcept id                  ID                 #REQUIRED
                     conref              CDATA              #IMPLIED
                     %select-atts;
                     %localization-atts;
                     %arch-atts;
                     outputclass         CDATA              #IMPLIED
                     domains             CDATA             "&included-domains;">

<!ELEMENT pspconbody  (%overview;)>

<!ATTLIST pspconcept  %global-atts; class  CDATA
                      "- topic/topic concept/concept pspconcept/pspconcept ">

<!ATTLIST pspconbody  %global-atts; class  CDATA
                      "- topic/body concept/conbody pspconcept/pspconbody ">

<!ATTLIST overview %global-atts; class CDATA
                      "- topic/section concept/section pspconcept/overview ">


What am I doing wrong?

Thanks,
Larry
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 1548



WWW
« Reply #1 on: August 30, 2011, 07:36:18 PM »

Nothing obviously wrong looking at this. However, because there is no DTD file I'm not sure how it is referencing the other portions of the DITA DTDs and mods (can't see how that would affect things but you never know). Perhaps having both pspConcept.dtd and this file (the whole thing in case you have snipped it a little) will explain things better.

The other thing I would recommend is to modify the DOCTYPE declaration to match this format so that XMetaL will take advantage of its catalog lookups to find everything:

<!DOCTYPE pspconcept PUBLIC "--your preferred public id--" "pspConcept.dtd">

Note that the value for the PUBLIC id should match what you specified when you entered it into "Select Specialized DITA DTD" from the Tools menu. Doing this will also allow the DITA OT to find the proper DTD using its catalog (though that requires a separate manual catalog change on your part).
« Last Edit: August 30, 2011, 07:41:16 PM by Derek Read » Logged
larrygolding
Member

Posts: 15


« Reply #2 on: August 31, 2011, 11:40:45 AM »

Hi Derek, thanks for the response. The module file pspConcept.mod which I included in the original message is complete except for two comments at the top. The DTD file pspConcept.dtd is below.

I have written an installer for my specialization that automatically makes the appropriate changes to dita_specialized.soc and dita_xac_catalog_specialized.xml. Is this the "manual catalog change" you refer to?

With regard to your suggestion about the DOCTYPE: I have not yet created a template for my new content type. To test it, I do File, New, Blank XML Document, and select my pspConcept.dtd. In plain text view, the resulting blank document looks like this:

<?xml version="1.0"?>
<!DOCTYPE data-about SYSTEM "C:\Program Files (x86)\Common Files\XMetaL Shared\DITA_OT\MySecretProject\PspConcept\pspConcept.dtd">

Note that the name is "data-about", despite the fact that dita_xac_catalog_specialized.xml contains this mapping:

  <mapping>
    <pubid>-//Microsoft//DTD MySecretProject PSP Concept//EN</pubid>
    <sysid>pspConcept</sysid>
    <handler>DitaDocHandler</handler>
    <type>ditabase</type>
  </mapping>

... and dita_specialized.soc contains this line:

PUBLIC "-//Microsoft//DTD MySecretProject PSP Concept//EN" "C:\Program Files (x86)\XMetaL 6.0\Author\DITA\XACs\pspConcept\pspConcept_ditabase.dtd"

Is that a clue?

Here is the DTD:

<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->

<!-- DITA specialization DTD for the "PSP concept" topic type. -->

<!-- ============================================================= -->
<!--                    PUBLIC DOCUMENT TYPE DEFINITION            -->
<!--                    TYPICAL INVOCATION                         -->
<!--                                                               
PUBLIC "-//Microsoft//DTD Quality Essentials PSP Concept//EN"
-->

<!-- ============================================================= -->
<!--                    DOMAIN ENTITY DECLARATIONS                 -->
<!-- ============================================================= -->

<!ENTITY % hi-d-dec     PUBLIC
"-//OASIS//ENTITIES DITA Highlight Domain//EN"
"..\..\highlightDomain.ent"                                                >
%hi-d-dec;

<!-- ============================================================= -->
<!--                    DOMAIN EXTENSIONS                          -->
<!-- ============================================================= -->

<!ENTITY % ph           "  %hi-d-ph; "       >

<!-- ============================================================= -->
<!--                    DOMAIN ATTRIBUTE EXTENSIONS                -->
<!-- ============================================================= -->
<!ENTITY % props-attribute-extensions  ""                            >
<!ENTITY % base-attribute-extensions   ""                            >

<!-- ============================================================= -->
<!--                    DOMAINS ATTRIBUTE OVERRIDE                 -->
<!-- ============================================================= -->
<!--                    Must be declared ahead of the DTDs, which
                        puts @domains first in order               -->

<!ENTITY included-domains    "&hi-d-att;"                >

<!-- ============================================================= -->
<!--                    BASE TYPE ELEMENT INTEGRATION              -->
<!-- ============================================================= -->

<!--                    Embed topic to get generic elements        -->
<!ENTITY % topic-type   PUBLIC
           "-//OASIS//ELEMENTS DITA Topic//EN" "..\..\dtd\topic.mod">
%topic-type;

<!--                    Embed concept to get specific elements     -->
<!ENTITY % concept-typemod PUBLIC
         "-//OASIS//ELEMENTS DITA Concept//EN" "..\..\dtd\concept.mod">
%concept-typemod;

<!ENTITY % pspconcept-typemod PUBLIC
         "-//Microsoft//ELEMENTS Quality Essentials PSP Concept//EN" "pspConcept.mod">
%pspconcept-typemod;

<!-- ============================================================= -->
<!--                    DOMAIN ELEMENT INTEGRATION                 -->
<!-- ============================================================= -->

<!ENTITY % hi-d-def     PUBLIC
"-//OASIS//ELEMENTS DITA Highlight Domain//EN"
"..\..\highlightDomain.mod"                                                >
%hi-d-def;

<!-- ================== End DITA Recipe DTD  ======================= -->
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 1548



WWW
« Reply #3 on: August 31, 2011, 06:37:42 PM »

Not sure why I missed it just looking (I had to create some files and play to jog my brain). You have defined <!ENTITY % overview "overview"> so ultimately <pspconbody> says it can have the element named "overview". However, unless the element itself is defined XMetaL won't let you insert it, and you have not defined that element anywhere.

Adding something like the following will allow you to insert it (not sure what you want to define its children as so I've just used PCDATA here to show that it works). You might want to use one of the standard DITA entities (for basic.ph or basic.block for example) instead.

<!ELEMENT overview (#PCDATA)>

As for the DOCTYPE declaration, when you create a new document from that particular template XMetaL gives you what you see because it is sort of working in a dumb developer-oriented mode at that point. It has no idea what your final intensions are. Its sort of up to you to massage that into the final form you want to give to your real authors and then save the resulting file as a different template file (to save in the Template folder).

I think if you fix the DTD then XMetaL may do a better job of automatically selecting <pspconcept> in the Element List as the first element to insert (it basically tries to pick the first one declared in the DTD, it may be confused by what you have in there at the moment).

The "manual change" I was referring to was to do with the DITA Open Toolkits catalog file located here:
<DITA OT>\catalog-dita_template.xml

If you wish to use the DITA OT that we install to generate output using files based on your specialized DTD then you will need to add appropriate entries to this file so the DITA OT can find them. When you choose Tools > Select Specialized DITA DTD that wizard generates all the required files for authoring in XMetaL only, it does not try to mess with the DITA OT.
« Last Edit: August 31, 2011, 06:44:23 PM by Derek Read » Logged
larrygolding
Member

Posts: 15


« Reply #4 on: August 31, 2011, 06:48:41 PM »

Thank you Derek! Yes, that's it. I supplied the ELEMENT definitions for pspconcept and pspconbody, but not for overview. Embarassingly simple once you see it, but boy, it was hard to see :-)

Thanks again,
Larry
Logged
Pages: 1
Print
Jump to:  

email us