subject scheme - how to implement this set of controlled values for outputclass?

oootini
Posts: 5

subject scheme - how to implement this set of controlled values for outputclass?

Wed Jun 21, 2017 11:18 am

Hello,

I want to implement the following outputclass specializations in a subject scheme map: Image

So far, I have set up the outputclass values for the map level items (followingRadu's post on subject schemes: http://blog.oxygenxml.com/2015/07/controlled-attribute-values-for-your.html), I am stuck trying to figure out how to configure the topic level values. Is this even possible using a single subject scheme map?

Do i need to create a second map that uses a <schemeref> to control the topic level values? Any tips much appreciated! :)

Code: Select all

<!DOCTYPE subjectScheme PUBLIC "-//OASIS//DTD DITA Subject Scheme Map//EN" "map.dtd">
<subjectScheme>
    <subjectHead>
        <subjectHeadMeta>
            <navtitle>Provide controlled attributes</navtitle>
        </subjectHeadMeta>
    </subjectHead>
    <hasInstance>
        <subjectdef keys="mm_map_control">
            <subjectdef keys="mmpdf:noCover">
                <topicmeta>
                    <navtitle>Suppresses generation of cover page</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="mmpdf:noTOC">
                <topicmeta>
                    <navtitle>Suppress TOC generation</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="mmpdf:noIndex">
                <topicmeta>
                    <navtitle>Suppress Index generation</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="mmpdf:section:NAME">
                <topicmeta>
                    <navtitle>start new section using SectionDef 'NAME'. SectionDef is defined in
                        the MFD template or using SectionDef sectionDef="NAME" and starts a new page
                        layout sequence</navtitle>
                </topicmeta>
            </subjectdef>
        </subjectdef>
        <subjectdef keys="mm_bookmap_control">
            <subjectdef keys="mmpdf:noCover">
                <topicmeta>
                    <navtitle>Suppresses generation of cover page</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="mmpdf:noTOC">
                <topicmeta>
                    <navtitle>Suppress TOC generation</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="mmpdf:noIndex">
                <topicmeta>
                    <navtitle>Suppress Index generation</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="mmpdf:section:NAME">
                <topicmeta>
                    <navtitle>start new section using SectionDef 'NAME'. SectionDef is defined in
                        the MFD template or using SectionDef sectionDef="NAME" and starts a new page
                        layout sequence</navtitle>
                </topicmeta>
            </subjectdef>
        </subjectdef>
        <subjectdef keys="mm_title_control">
            <subjectdef keys="mmpdf:pageBreak">
                <topicmeta>
                    <navtitle>breaks page before title/p/note paragraph</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="mmpdf:columnBreak">
                <topicmeta>
                    <navtitle>force title/p/note paragraph to top of next column (or page, for
                        single column documents)</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="mmpdf:span">
                <topicmeta>
                    <navtitle>Spans title across all columns in multi-column document</navtitle>
                </topicmeta>
            </subjectdef>
        </subjectdef>
        <subjectdef keys="mm_title_control">
            <subjectdef keys="mmpdf:pageBreak">
                <topicmeta>
                    <navtitle>breaks page before title/p/note paragraph</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="mmpdf:columnBreak">
                <topicmeta>
                    <navtitle>force title/p/note paragraph to top of next column (or page, for
                        single column documents)</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="mmpdf:span">
                <topicmeta>
                    <navtitle>Spans title across all columns in multi-column document</navtitle>
                </topicmeta>
            </subjectdef>
        </subjectdef>
        <subjectdef keys="mm_topictitle_control">
            <subjectdef keys="mmpdf:section:NAME">
                <topicmeta>
                    <navtitle>start new section using SectionDef 'NAME'. SectionDef is defined in
                        the MFD template or using SectionDef sectionDef="NAME" and starts a new page
                        layout sequence</navtitle>
                </topicmeta>
            </subjectdef>
        </subjectdef>
        <subjectdef keys="mm_topic_control">
            <subjectdef keys="mmpdf:section:NAME">
                <topicmeta>
                    <navtitle>start new section using SectionDef 'NAME'. SectionDef is defined in
                        the MFD template or using SectionDef sectionDef="NAME" and starts a new page
                        layout sequence</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="mm_p_control">
                <subjectdef keys="mmpdf:span">
                    <topicmeta>
                        <navtitle>Spans title across all columns in multi-column document</navtitle>
                    </topicmeta>
                </subjectdef>
                <subjectdef keys="mmpdf:pageBreak">
                    <topicmeta>
                        <navtitle>breaks page before title/p/note paragraph</navtitle>
                    </topicmeta>
                </subjectdef>
                <subjectdef keys="mmpdf:columnBreak">
                    <topicmeta>
                        <navtitle>force title/p/note paragraph to top of next column (or page, for
                            single column documents)</navtitle>
                    </topicmeta>
                </subjectdef>
            </subjectdef>
            <subjectdef keys="mm_note_control">
                <subjectdef keys="mmpdf:columnBreak">
                    <topicmeta>
                        <navtitle>force title/p/note paragraph to top of next column (or page, for
                            single column documents)</navtitle>
                    </topicmeta>
                </subjectdef>
                <subjectdef keys="mmpdf:pageBreak">
                    <topicmeta>
                        <navtitle>breaks page before title/p/note paragraph</navtitle>
                    </topicmeta>
                </subjectdef>
            </subjectdef>
        </subjectdef>
        <subjectdef keys="mm_chapter_control">
            <subjectdef keys="mmpdf:section:NAME">
                <topicmeta>
                    <navtitle>start new section using SectionDef 'NAME'. SectionDef is defined in
                        the MFD template or using SectionDef sectionDef="NAME" and starts a new page
                        layout sequence</navtitle>
                </topicmeta>
            </subjectdef>
        </subjectdef>
        <subjectdef keys="mm_appendix_control">
            <subjectdef keys="mmpdf:section:NAME">
                <topicmeta>
                    <navtitle>start new section using SectionDef 'NAME'. SectionDef is defined in
                        the MFD template or using SectionDef sectionDef="NAME" and starts a new page
                        layout sequence</navtitle>
                </topicmeta>
            </subjectdef>
        </subjectdef>
        <subjectdef keys="mm_booktitle_control">
            <subjectdef keys="mmpdf:section:NAME">
                <topicmeta>
                    <navtitle>start new section using SectionDef 'NAME'. SectionDef is defined in
                        the MFD template or using SectionDef sectionDef="NAME" and starts a new page
                        layout sequence</navtitle>
                </topicmeta>
            </subjectdef>
        </subjectdef>
    </hasInstance>

    <enumerationdef>
        <elementdef name="map"/>
        <attributedef name="outputclass"/>
        <subjectdef keyref="mm_map_control"/>
    </enumerationdef>
    <enumerationdef>
        <elementdef name="note"/>
        <attributedef name="outputclass"/>
        <subjectdef keyref="mm_note_control"/>
    </enumerationdef>
    <enumerationdef>
        <elementdef name="p"/>
        <attributedef name="outputclass"/>
        <subjectdef keyref="mm_p_control"/>
    </enumerationdef>
    <enumerationdef>
        <elementdef name="bookmap"/>
        <attributedef name="outputclass"/>
        <subjectdef keyref="mm_bookmap_control"/>
    </enumerationdef>
    <enumerationdef>
        <elementdef name="title"/>
        <attributedef name="outputclass"/>
        <subjectdef keyref="mm_title_control"/>
    </enumerationdef>
    <enumerationdef>
        <elementdef name="topic/title"/>
        <attributedef name="outputclass"/>
        <subjectdef keyref="mm_topictitle_control"/>
    </enumerationdef>
    <enumerationdef>
        <elementdef name="topic"/>
        <attributedef name="outputclass"/>
        <subjectdef keyref="mm_topic_control"/>
    </enumerationdef>
    <enumerationdef>
        <elementdef name="chapter"/>
        <attributedef name="outputclass"/>
        <subjectdef keyref="mm_chapter_control"/>
    </enumerationdef>
    <enumerationdef>
        <elementdef name="appendix"/>
        <attributedef name="outputclass"/>
        <subjectdef keyref="mm_appendix_control"/>
    </enumerationdef>
    <enumerationdef>
        <elementdef name="booktitle"/>
        <attributedef name="outputclass"/>
        <subjectdef keyref="mm_booktitle_control"/>
    </enumerationdef>
</subjectScheme>
Radu
Posts: 5226

Re: subject scheme - how to implement this set of controlled values for outputclass?

Wed Jun 21, 2017 12:23 pm

Hi,

Even if you define a second subject scheme map, the controlled information will be gathered as a reunion of all controlled values defined in the subject scheme maps. So it does not matter much.
I think the main problem is this one:

Code: Select all

   <enumerationdef>
        <elementdef name="title"/>
        <attributedef name="outputclass"/>
        <subjectdef keyref="mm_title_control"/>
    </enumerationdef>
    <enumerationdef>
        <elementdef name="topic/title"/>
        <attributedef name="outputclass"/>
        <subjectdef keyref="mm_topictitle_control"/>
    </enumerationdef>


You have a DITA Map <title> and a topic <title> and you want different values for them. But the elementdef @name does not allow an xpath, it only allows an element name there. So according to the specification and also with how Oxygen implemented this feature there is no way to differentiate between controlled values used in the map titles and in the topic titles.
The only workaround would probably be either to specify on the <title> all the controlled attribute values, then use Schematron rules to report errors if people use on a map title attribute values from a topic title:

http://blog.oxygenxml.com/2017/02/sharing-schematron-validation-rules.html

or to not use Subject Scheme maps for imposing controlled attribute values.
There are other ways:

https://www.oxygenxml.com/doc/versions/18/ug-editor/topics/configuring-content-completion-proposals.html#configuring-content-completion-proposals

Basically for a certain element and attribute you can call via our configuration an XSLT stylesheet which has a parameter called contextElementXPathExpression which will help you decide in what context is the current element placed.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
oootini
Posts: 5

Re: subject scheme - how to implement this set of controlled values for outputclass?

Wed Jun 21, 2017 3:43 pm

Thanks for the swift response and detailed answer. I'll look into the more ribust solutions you mention, thanks.

So this won't work for map/title @outputclass and topic/title @outputclass as originally desccribed in my example. I've removed the offending topic/title element from my map, and I now see all possible values for any title element, map or topic. All good.

I should be able to specify output class values for p, and note using the above subject scheme map right? My example map above does not work for p and note. Can you tell me what I am missing there?
Radu
Posts: 5226

Re: subject scheme - how to implement this set of controlled values for outputclass?

Wed Jun 21, 2017 4:02 pm

Hi,

If you search for example in your subject scheme map for "mmpdf:span" you will see that the key is defined 3 times. But these are still keys (although they will be used as attribute values) and with the DITA standard if you have duplicate keys, only the first key definition will be taken into account.
You can define the "mmpdf:span" key only once and refer to it 3 times, something like what I suggested in this older post:

https://www.oxygenxml.com/forum/post39188.html#p39223

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest