Allow users to select a range of content referenced elements
This feature would allow a user to conref more than one element at a time. For example, this feature would allow a user to conref steps 2 to 5 in a task. Currently, a user wishing to reuse a series of adjacent elements must create a conref to each referenced node. This feature would enable a short-hand allowing a user to denote a range of content references by marking the start and end elements. This proposal has a minor design changes from the original IssueNumber17c.html proposal http://www.oasis-open.org/committees/download.php/15118/IssueNumber17c.html (simplified attribute name and value names ).
The reusable content exists in a target DITA topic or map. The elements which will be conref'd to as the start and end of the ranges must have id attributes.
The user will create a range by adding a pair of elements in the source topic. The first element in the source must be the same type as the start element of the target range. The user will add a conref attribute that points to the start target and set the value of the conreftype attribute to "start." The second element in the pair must be the same as the end target element with a conref pointing to the end of the targeted range and should have conref attribute value of "end." The user should only create ranges on target elements that share the same parent element.
Processors will resolve the range by pulling in the start target and following sibling elements across to and including the end target.
Assumptions for the target instance are:
Assumptions for the source instance are:
Error conditions may occur if
These types of error conditions may occur when the author and reuser are different actors. If the author has created a topic which is being reused through the conref range feature, and the author goes and reorders the elements in the target instance, an error condition can be created.
Processors should fail on first error. It is not expected that processors will be able to pull in the referenced range if any of these error conditions are met. Standard XML validation will not be able to catch these error conditions. Tools will need to add additional business rules checking if they need to enforce valid conref ranges. These error conditions will most likely be caught when a processor attempts to resolving a conref range.
This proposal introduces a new universal attribute that acts as a type modifier on the existing "conref" attribute. The attribute is called "conreftype" and would modify the default action for processing content references.
Add a new attribute in the DTD and XML Schema.
The change in DTD syntax in the id-atts entity within commonElements.mod
<!ENTITY % id-atts
'id NMTOKEN #IMPLIED
conref CDATA #IMPLIED
conreftype (start | end ) #IMPLIED'>
The change in XML Schema syntax:
<xs:attributeGroup name="id-atts">
<xs:annotation>
<xs:documentation>ID attributes (%id-atts;) is a parameter entity declaration in the
topic DTD that includes attributes that enable the naming and referencing
of elements in a DITA topic: <keyword>id</keyword> and <keyword>conref</keyword>.
</xs:documentation>
</xs:annotation>
<xs:attribute name="id" type="xs:NMTOKEN"/>
<xs:attribute name="conref" type="xs:string"/>
<xs:attribute name="conreftype" type="conreftype-atts.class"/>
</xs:attributeGroup>
<xs:simpleType name="conreftype-att.class">
<xs:restriction base="xs:string">
<xs:enumeration value="start"/>
<xs:enumeration value="end"/>
</xs:restriction>
</xs:simpleType>
Base processing would change to pull in the start and end content references as well as all intermediate contiguous nodes. Base processing should operate on the assumption that the reuser will place the start and end pointers adjacent to each other. In the sourced document, the start and end elements must appear in the correct order (start before end), must have ids set and should share the same parent element. Although ids are not necessary on the intermediate ids for processing purposes, authors should be encouraged to set ids on all items intended for reuse to make the system more flexible.
<topic id="x"> ... <body> <of> <li id="apple">A</li> <li id="bear">B</li> <li id="cat">C</li> <li id="dog">D</li> <li id="eel">E</li> </of> </body> </topic>