Skip to content

Commit

Permalink
Merge pull request #884 from robander/imposerole
Browse files Browse the repository at this point in the history
Add impose-role attribute #670
  • Loading branch information
robander authored Jan 4, 2023
2 parents 95e3ca1 + 5efc516 commit e959a72
Show file tree
Hide file tree
Showing 27 changed files with 404 additions and 102 deletions.
1 change: 1 addition & 0 deletions doctypes/dtd/base/ditavalrefDomain.mod
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
processing-role
CDATA
'resource-only'
%impose-role-attribute-fixed-keeptarget;
%ditavalref-univ-atts;"
>
<!ELEMENT ditavalref %ditavalref.content;>
Expand Down
18 changes: 18 additions & 0 deletions doctypes/dtd/base/map.mod
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,23 @@ PUBLIC "-//OASIS//ELEMENTS DITA 2.0 Map//EN"
#IMPLIED"
>

<!ENTITY % impose-role-attribute
"impose-role
(impose |
keeptarget |
-dita-use-conref-target)
'keeptarget'"
>
<!ENTITY % impose-role-attribute-fixed-keeptarget
"impose-role
(keeptarget)
'keeptarget'"
>
<!ENTITY % impose-role-attribute-fixed-impose
"impose-role
(impose)
'impose'"
>

<!-- ============================================================= -->
<!-- MODULES CALLS -->
Expand Down Expand Up @@ -427,6 +444,7 @@ PUBLIC "-//OASIS//ELEMENTS DITA 2.0 Map//EN"
keys
CDATA
#IMPLIED
%impose-role-attribute;
%topicref-atts;
%univ-atts;"
>
Expand Down
3 changes: 3 additions & 0 deletions doctypes/dtd/base/mapGroup.mod
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
format
CDATA
'ditamap'
%impose-role-attribute-fixed-keeptarget;
%topicref-atts-without-format;
%univ-atts;"
>
Expand Down Expand Up @@ -179,6 +180,7 @@
subjectrefs
CDATA
#IMPLIED
%impose-role-attribute-fixed-keeptarget;
%univ-atts;"
>
<!ELEMENT keydef %keydef.content;>
Expand Down Expand Up @@ -241,6 +243,7 @@
yes |
-dita-use-conref-target)
#IMPLIED
%impose-role-attribute;
%univ-atts;"
>
<!ELEMENT mapresources %mapresources.content;>
Expand Down
3 changes: 3 additions & 0 deletions doctypes/dtd/subjectScheme/classifyDomain.mod
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
yes |
-dita-use-conref-target)
'no'
%impose-role-attribute-fixed-keeptarget;
%univ-atts;"
>
<!ELEMENT topicsubject %topicsubject.content;>
Expand Down Expand Up @@ -152,6 +153,7 @@
yes |
-dita-use-conref-target)
'no'
%impose-role-attribute-fixed-keeptarget;
%univ-atts;"
>
<!ELEMENT topicapply %topicapply.content;>
Expand Down Expand Up @@ -212,6 +214,7 @@
yes |
-dita-use-conref-target)
'no'
%impose-role-attribute-fixed-keeptarget;
%univ-atts;"
>
<!ELEMENT subjectref %subjectref.content;>
Expand Down
3 changes: 3 additions & 0 deletions doctypes/dtd/subjectScheme/subjectScheme.mod
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
peer |
-dita-use-conref-target)
#IMPLIED
%impose-role-attribute-fixed-keeptarget;
%univ-atts;"
>
<!ELEMENT schemeref %schemeref.content;>
Expand Down Expand Up @@ -231,6 +232,7 @@
yes |
-dita-use-conref-target)
#IMPLIED
%impose-role-attribute-fixed-keeptarget;
%univ-atts;"
>
<!ELEMENT subjectdef %subjectdef.content;>
Expand Down Expand Up @@ -423,6 +425,7 @@
yes |
-dita-use-conref-target)
#IMPLIED
%impose-role-attribute-fixed-keeptarget;
%univ-atts;"
>
<!ELEMENT defaultSubject %defaultSubject.content;>
Expand Down
1 change: 1 addition & 0 deletions doctypes/rng/base/ditavalrefDomain.rng
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ PUBLIC "-//OASIS//ELEMENTS DITA 2.0 DITAVAL Ref Domain//EN"
<optional>
<attribute name="processing-role" a:defaultValue="resource-only"/>
</optional>
<ref name="impose-role-attribute-fixed-keeptarget"/>
<ref name="ditavalref-univ-atts"/>
</define>
<define name="ditavalref.element">
Expand Down
7 changes: 5 additions & 2 deletions doctypes/rng/base/mapGroupDomain.rng
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ PUBLIC "-//OASIS//ELEMENTS DITA 2.0 Map Group Domain//EN"
<optional>
<attribute name="format" a:defaultValue="ditamap"/>
</optional>
<ref name="impose-role-attribute-fixed-keeptarget"/>
<ref name="topicref-atts-without-format"/>
<ref name="univ-atts"/>
</define>
Expand Down Expand Up @@ -288,8 +289,9 @@ PUBLIC "-//OASIS//ELEMENTS DITA 2.0 Map Group Domain//EN"
<attribute name="chunk"/>
</optional>
<optional>
<attribute name="subjectrefs"/>
</optional>
<attribute name="subjectrefs"/>
</optional>
<ref name="impose-role-attribute-fixed-keeptarget"/>
<ref name="univ-atts"/>
</define>
<define name="keydef.element">
Expand Down Expand Up @@ -386,6 +388,7 @@ PUBLIC "-//OASIS//ELEMENTS DITA 2.0 Map Group Domain//EN"
</choice>
</attribute>
</optional>
<ref name="impose-role-attribute"/>
<ref name="univ-atts"/>
</define>
<define name="mapresources.element">
Expand Down
26 changes: 26 additions & 0 deletions doctypes/rng/base/mapMod.rng
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,31 @@ PUBLIC "-//OASIS//ELEMENTS DITA 2.0 Map//EN"
<attribute name="subjectrefs"/>
</optional>
</define>
<define name="impose-role-attribute">
<optional>
<attribute name="impose-role" a:defaultValue="keeptarget">
<choice>
<value>impose</value>
<value>keeptarget</value>
<value>-dita-use-conref-target</value>
</choice>
</attribute>
</optional>
</define>
<define name="impose-role-attribute-fixed-keeptarget">
<optional>
<attribute name="impose-role" a:defaultValue="keeptarget">
<value>keeptarget</value>
</attribute>
</optional>
</define>
<define name="impose-role-attribute-fixed-impose">
<optional>
<attribute name="impose-role" a:defaultValue="impose">
<value>impose</value>
</attribute>
</optional>
</define>
</div>


Expand Down Expand Up @@ -581,6 +606,7 @@ PUBLIC "-//OASIS//ELEMENTS DITA 2.0 Map//EN"
<optional>
<attribute name="keys"/>
</optional>
<ref name="impose-role-attribute"/>
<ref name="topicref-atts"/>
<ref name="univ-atts"/>
</define>
Expand Down
3 changes: 3 additions & 0 deletions doctypes/rng/subjectScheme/classifyDomain.rng
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ PUBLIC "-//OASIS//ELEMENTS DITA 2.0 Subject Classification Domain//EN"
</choice>
</attribute>
</optional>
<ref name="impose-role-attribute-fixed-keeptarget"/>
<ref name="univ-atts"/>
</define>
<a:documentation></a:documentation>
Expand Down Expand Up @@ -248,6 +249,7 @@ PUBLIC "-//OASIS//ELEMENTS DITA 2.0 Subject Classification Domain//EN"
</choice>
</attribute>
</optional>
<ref name="impose-role-attribute-fixed-keeptarget"/>
<ref name="univ-atts"/>
</define>
<a:documentation></a:documentation>
Expand Down Expand Up @@ -338,6 +340,7 @@ PUBLIC "-//OASIS//ELEMENTS DITA 2.0 Subject Classification Domain//EN"
</choice>
</attribute>
</optional>
<ref name="impose-role-attribute-fixed-keeptarget"/>
<ref name="univ-atts"/>
</define>
<a:documentation></a:documentation>
Expand Down
3 changes: 3 additions & 0 deletions doctypes/rng/subjectScheme/subjectSchemeMod.rng
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
</choice>
</attribute>
</optional>
<ref name="impose-role-attribute-fixed-keeptarget"/>
<ref name="univ-atts"/>
</define>
<define name="schemeref.element">
Expand Down Expand Up @@ -308,6 +309,7 @@
</choice>
</attribute>
</optional>
<ref name="impose-role-attribute-fixed-keeptarget"/>
<ref name="univ-atts"/>
</define>
<define name="subjectdef.element">
Expand Down Expand Up @@ -627,6 +629,7 @@
</choice>
</attribute>
</optional>
<ref name="impose-role-attribute-fixed-keeptarget"/>
<ref name="univ-atts"/>
</define>
<define name="defaultSubject.element">
Expand Down
2 changes: 0 additions & 2 deletions specification/archSpec/base/cascading-metadata.ditamap
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
<topicref href="map-to-map-cascading-of-metadata.dita">
<topicref href="cascading-of-attributes-from-map-to-map.dita"/>
<topicref href="cascading-of-metadata-elements-from-map-to-map.dita"/>
<topicref href="cascading-of-roles-in-specialized-maps.dita"/>
</topicref>
<topicref href="examples-of-cascading.dita">
<topicref href="example-cascade-elements.dita"/>
<topicref href="example-cascade-map-to-map-elements.dita"/>
<topicref href="example-cascade-map-to-map-attributes.dita"/>
<topicref href="example-cascade-attribute.dita"/>
<topicref href="example-cascading-topicref-roles.dita"/>
</topicref>
</topicref>
</map>
6 changes: 5 additions & 1 deletion specification/archSpec/base/ditamap-processing.ditamap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
<map xml:lang="en-us">
<title>DITA map processing</title>
<topicref href="dita-map-processing.dita">
<topicref href="dita-maps-and-their-usage.dita"/>
<topicref href="dita-maps-and-their-usage.dita">
<topicref href="impose-topicref-role.dita">
<topicref href="example-impose-topicref-roles.dita"/>
</topicref>
</topicref>
<mapref href="subject-scheme-maps.ditamap"/>
<mapref href="cascading-metadata.ditamap"/>
<mapref href="chunking.ditamap"/>
Expand Down
63 changes: 0 additions & 63 deletions specification/archSpec/base/example-cascading-topicref-roles.dita

This file was deleted.

51 changes: 51 additions & 0 deletions specification/archSpec/base/example-impose-topicref-roles.dita
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="cascadetopicrefrole">
<title>Example: How <xmlelement>topicref</xmlelement> roles are imposed on referenced maps</title>
<shortdesc>In this scenario, a specialized <xmlelement>topicref</xmlelement> element references
content in another map.</shortdesc>
<prolog>
<metadata/>
</prolog>
<conbody>
<p>Consider the scenario of a <xmlelement>chapter</xmlelement> element from the Bookmap
specialization that references a DITA map. This scenario could take several forms:<dl
id="dl_ohc_nq5_nsb">
<dlentry>
<dt>Referenced map contains a single top-level <xmlelement>topicref</xmlelement>
element</dt>
<dd>The entire branch functions as if it were included in the bookmap<ph rev="review-k">.
The</ph> "chapter" role is imposed on the branch, with the result that the top-level
<xmlelement>topicref</xmlelement> element is processed as if it were the
<xmlelement>chapter</xmlelement> element.</dd>
</dlentry>
<dlentry>
<dt>Referenced map contains multiple top-level <xmlelement>topicref</xmlelement>
elements</dt>
<dd>The "chapter" role is imposed on each top-level element in the referenced map. Each
top-level <xmlelement>topicref</xmlelement> element is processed as if it were a
<xmlelement>chapter</xmlelement> element.</dd>
</dlentry>
<dlentry>
<dt>Referenced map contains a single <xmlelement>appendix</xmlelement> element</dt>
<dd>The "chapter" role is imposed on the <xmlelement>appendix</xmlelement> element, which
is processed as it were a <xmlelement>chapter</xmlelement> element.</dd>
</dlentry>
<dlentry>
<dt>Referenced map contains a single <xmlelement>part</xmlelement> element, with nested
<xmlelement>chapter</xmlelement> elements</dt>
<dd>The "chapter" role is imposed on the <xmlelement>part</xmlelement> element, which is
processed as it were a <xmlelement>chapter</xmlelement> element. Nested
<xmlelement>chapter</xmlelement> elements might not be understandable by processors,
which can treat this as an error or recover as they are able.</dd>
</dlentry>
<dlentry>
<dt><xmlelement>chapter</xmlelement> element references a single
<xmlelement>topicref</xmlelement> element rather than a map</dt>
<dd>The "chapter" role is imposed on the referenced <xmlelement>topicref</xmlelement>
element, which is processed as if it were a <xmlelement>chapter</xmlelement>
element.</dd>
</dlentry>
</dl></p>
</conbody>
</concept>
Loading

0 comments on commit e959a72

Please sign in to comment.