Add items to outputclass list

<oXygen/> general issues.
pault
Posts: 64

Add items to outputclass list

Thu Jul 10, 2014 12:32 am

In the values for the outputclass attribute, there are list of languages for syntax highlighting, like language-java. I would like replace them with our values (as we implemented syntax highlighting awhile back). Additionally, I'd like to add a couple of others for other element types, such as <p> and <row>. What's the best way to go about this? I am using XML Editor 15.2.

Thanks,

Paul
Radu
Posts: 5581

Re: Add items to outputclass list

Thu Jul 10, 2014 8:53 am

Hi Paul,

My suggestion for you is to create a Subject Scheme Map with content like:

Code: Select all

<!DOCTYPE subjectScheme PUBLIC "-//OASIS//DTD DITA Subject Scheme Map//EN" "map.dtd">
<subjectScheme>
    <subjectHead>
        <subjectHeadMeta>
            <navtitle></navtitle>
        </subjectHeadMeta>
    </subjectHead>
    <hasInstance>
        <subjectdef keys="outputClassSbjKey">
            <subjectdef keys="JAVA">
                <topicmeta>
                    <navtitle>JAVA LANGUAGE</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="XML">
                <topicmeta>
                    <navtitle>XML LANGUAGE</navtitle>
                </topicmeta>
            </subjectdef>
        </subjectdef>
    </hasInstance>
    <enumerationdef>
        <attributedef name="outputclass"/>
        <subjectdef keyref="outputClassSbjKey"/>
    </enumerationdef>
</subjectScheme>


and to link to it from the DITA Map like:

Code: Select all

<topicref href="productSbjSchemeVals.ditamap" format="ditamap" type="subjectScheme"/>


Basically you can use the Subject Scheme Map to impose allowed sets of values for any attribute name or to reject completely a certain attribute from being used:

http://www.oxygenxml.com/demo/DITA_Subject_Scheme.html

http://www.oxygenxml.com/doc/ug-oxygen/#topics/subject-scheme-map.html

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

Re: Add items to outputclass list

Tue Jul 15, 2014 5:50 pm

Thanks Radu!
pault
Posts: 64

Re: Add items to outputclass list

Fri Aug 01, 2014 8:29 pm

Hi Radu,

Is there a way to remove some of the existing outputclass values from being displayed? For example, I'd like to remove language-bourne, language-xml, and language-ini.

Thanks,

Paul
Radu
Posts: 5581

Re: Add items to outputclass list

Mon Aug 04, 2014 8:59 am

Hi Paul,

That list of default values Oxygen proposes for the @outputclass attribute of a DITA codeblock is given by a special Java extension we have for DITA called ro.sync.ecss.extensions.dita.DITASchemaManagerFilter.
I think that the easiest thing to do for you would be to take control over the displayed list of values by defining values for @outputclass in the Subject Scheme Map.
Or if you are comfortable with Java you could try to overwrite that Java extension and make changes to it, I could give you more details if you are interested in this approach.

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

Re: Add items to outputclass list

Mon Aug 04, 2014 5:43 pm

Hi Radu,

I tried using the Subject Scheme Map from what I saw in the demo, but I just got errors. For example:

Code: Select all

<enumerationdef>
     <attributedef name="language-bourne"/>
     <subjectdef/>
</enumerationdef>

Paul
Radu
Posts: 5581

Re: Add items to outputclass list

Tue Aug 05, 2014 9:28 am

Hi Paul,

The @name attribute of an <attributedef> element states the name of the DITA attribute for which a set of values will be provided. So you cannot remove specific existing allowed values for an attribute but you can specify the entire set of allowed attributes like:

Code: Select all

<!DOCTYPE subjectScheme PUBLIC "-//OASIS//DTD DITA Subject Scheme Map//EN" "map.dtd">
<subjectScheme>
    <subjectHead>
        <subjectHeadMeta>
            <navtitle>Controlled Values list</navtitle>
        </subjectHeadMeta>
    </subjectHead>
    <hasInstance>
        <!-- ALLOWED VALUES FOR CODEBLOCK -->
        <subjectdef keys="outputSbjKey">
            <subjectdef keys="language-php">
                <topicmeta>
                    <navtitle>PHP</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="language-css">
                <topicmeta>
                    <navtitle>CSS</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="language-ruby">
                <topicmeta>
                    <navtitle>Ruby</navtitle>
                </topicmeta>
            </subjectdef>
        </subjectdef>
    </hasInstance>
    <enumerationdef>
        <elementdef name="codeblock"/>
        <attributedef name="outputclass"/>
        <subjectdef keyref="outputSbjKey"/>
    </enumerationdef>
</subjectScheme>


Unfortunately the Java extension which gives those hard coded imposed values for codeblock does not seem to be overwritten by the subject scheme imposed values, so when editing the attribute values you will still received the hard coded values. I will add an issue on our side and we'll look into it.

But at least if you use the subject scheme map users will receive errors if in the edited DITA topics they try to use a value for @outputclass which is not allowed by the subject scheme map.

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

Re: Add items to outputclass list

Thu Aug 07, 2014 3:38 pm

Thanks Radu.
Radu
Posts: 5581

Re: Add items to outputclass list

Wed Apr 01, 2015 9:18 am

Hi,

Just to update the thread, this issue is fixed in Oxygen 16.1:

Unfortunately the Java extension which gives those hard coded imposed values for codeblock does not seem to be overwritten by the subject scheme imposed values, so when editing the attribute values you will still received the hard coded values. I will add an issue on our side and we'll look into it.


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

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 0 guests