Validating @outputclass by subjectScheme

Post here questions and problems related to editing and publishing DITA content.
tmakita
Posts: 100
Joined: Fri Apr 08, 2011 7:58 am

Validating @outputclass by subjectScheme

Post by tmakita »

I’m developing subjectScheme to validate @outputclass attribute. If I want apply @outputclass=”title-page|title|page” for xref element, subjectScheme will be coded as following:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="urn:oasis:names:tc:dita:spec:classification:rng:subjectScheme.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<subjectScheme>
<subjectHead>
<subjectHeadMeta>
<navtitle> Constraint @outputclass for xref</navtitle>
</subjectHeadMeta>
</subjectHead>
<subjectdef keys="outputclassXref">
<subjectdef keys="title">
<topicmeta>
<navtitle>Output destination title only</navtitle>
</topicmeta>
</subjectdef>
<subjectdef keys="title-page">
<topicmeta>
<navtitle>Output destination title & page</navtitle>
</topicmeta>
</subjectdef>
<subjectdef keys="page">
<topicmeta>
<navtitle>Output destination page only</navtitle>
</topicmeta>
</subjectdef>
</subjectdef>
<enumerationdef>
<elementdef name="xref"/>
<attributedef name="outputclass"/>
<subjectdef keyref="outputclassXref"/>
</enumerationdef>
</subjectScheme>
This works fine in oXygen 18.0. Following is the screen shot.

https://www.dropbox.com/s/gogdmqymt8th5 ... 6.png?dl=0

However if I want to apply fig/@outputclass=”none|left|right” and figgroup/@outputclass=”auto|left|right”, the subjectScheme will become following because the value “left” and “right” are common to fig and figgroup:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="urn:oasis:names:tc:dita:spec:classification:rng:subjectScheme.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<subjectScheme>
<subjectHead>
<subjectHeadMeta>
<navtitle> Constraint @outputclass for fig </navtitle>
</subjectHeadMeta>
</subjectHead>
<subjectdef keys="floatLeft">
<subjectdef keys="left">
<topicmeta>
<navtitle>Floats left</navtitle>
</topicmeta>
</subjectdef>
</subjectdef>
<subjectdef keys="floatRight">
<subjectdef keys="right">
<topicmeta>
<navtitle>Floats right</navtitle>
</topicmeta>
</subjectdef>
</subjectdef>
<subjectdef keys="outputclassFig">
<subjectdef keys="none">
<topicmeta>
<navtitle>No float</navtitle>
</topicmeta>
</subjectdef>
<subjectdef keyref="floatLeft"/>
<subjectdef keyref="floatRight"/>
</subjectdef>
<subjectdef keys="outputclassFigGroup">
<subjectdef keys="auto">
<topicmeta>
<navtitle>Auto (Same as previous)</navtitle>
</topicmeta>
</subjectdef>
<subjectdef keyref="floatLeft"/>
<subjectdef keyref="floatRight"/>
</subjectdef>
<enumerationdef>
<elementdef name="fig"/>
<attributedef name="outputclass"/>
<subjectdef keyref="outputclassFig"/>
</enumerationdef>
<enumerationdef>
<elementdef name="figgroup"/>
<attributedef name="outputclass"/>
<subjectdef keyref="outputclassFigGroup"/>
</enumerationdef>
</subjectScheme>
In this case “floatRight” and “floatLeft” are also treated as the candidate attribute value.

https://www.dropbox.com/s/ay2g8x6t7whho ... 9.png?dl=0

But obviously it is not what I intended. Are there any ways to limit both fig/@outputclass and figgroup/@outputclass to expected value?

Regards,

/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Validating @outputclass by subjectScheme

Post by Radu »

Dear Toshihiko Makita,

I understand your use case. I do not have a workaround for you right now.
I will add an issue on our side, see if we can support the behavior that you want in the application.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Validating @outputclass by subjectScheme

Post by Radu »

Hi,

Just remembered as a possible workaround that you can use the DITA content completion configuration file:

https://www.oxygenxml.com/doc/versions/ ... osals.html

to assign enumerations of values to an attribute set on a certain element. It will only work if the subject scheme map is not set at all.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
tmakita
Posts: 100
Joined: Fri Apr 08, 2011 7:58 am

Re: Validating @outputclass by subjectScheme

Post by tmakita »

Hi Radu,

Thank you for your answer and information.
In this case “floatRight” and “floatLeft” are also treated as the candidate attribute value.
As long as @outputclass is validated via subjectSchme, displaying “floatRight” and “floatLeft” as candidate is not mistake. In my understanding, subjectSchme uses DITA keys/keyref mechanism. Based on these facts, I think that there are certain limitations using subjectScheme for attribute value validation.

Could you give me your opinion?

Regards,

/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Validating @outputclass by subjectScheme

Post by Radu »

Dear Toshihiko Makita,

Unfortunately the specification is quite unclear in this regard so honestly I do not know how this should work.
There is a "dita-comment" mailing list:

https://www.oasis-open.org/committees/t ... a#feedback

on which all the DITA TC committee members are registered so I asked them this question:

https://lists.oasis-open.org/archives/d ... 00000.html

If they reply anything, I will try to update this forum post with their opinion.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Validating @outputclass by subjectScheme

Post by Radu »

Hi,

I was looking more over this situation, a current workaround for what you want to achieve would be something like:

Code: Select all

<!DOCTYPE subjectScheme PUBLIC "-//OASIS//DTD DITA Subject Scheme Map//EN" "subjectScheme.dtd">
<subjectScheme>
<subjectHead>
<subjectHeadMeta>
<navtitle> Constraint @outputclass for fig </navtitle>
</subjectHeadMeta>
</subjectHead>
<subjectdef keys="left">
<topicmeta>
<navtitle>Floats left</navtitle>
</topicmeta>
</subjectdef>
<subjectdef keys="right">
<topicmeta>
<navtitle>Floats right</navtitle>
</topicmeta>
</subjectdef>
<subjectdef keys="outputclassFig">
<subjectdef keys="none">
<topicmeta>
<navtitle>No float</navtitle>
</topicmeta>
</subjectdef>
<subjectdef keyref="left"/>
<subjectdef keyref="right"/>
</subjectdef>
<subjectdef keys="outputclassFigGroup">
<subjectdef keys="auto">
<topicmeta>
<navtitle>Auto (Same as previous)</navtitle>
</topicmeta>
</subjectdef>
<subjectdef keyref="left"/>
<subjectdef keyref="right"/>
</subjectdef>
<enumerationdef>
<elementdef name="fig"/>
<attributedef name="outputclass"/>
<subjectdef keyref="outputclassFig"/>
</enumerationdef>
<enumerationdef>
<elementdef name="figgroup"/>
<attributedef name="outputclass"/>
<subjectdef keyref="outputclassFigGroup"/>
</enumerationdef>
</subjectScheme>
Also, when the DITA TC will give me an answer I will post it here.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
tmakita
Posts: 100
Joined: Fri Apr 08, 2011 7:58 am

Re: Validating @outputclass by subjectScheme

Post by tmakita »

Hi Radu,

What a simple solution it is!
I thought the subjectScheme more complex than actually needed.

Regards,

/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc.
Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
Post Reply