Change entity xref.attributes in mod file

Post here questions and problems related to editing and publishing DITA content.
ann.jensen
Posts: 316
Joined: Wed Jun 17, 2015 10:19 am

Change entity xref.attributes in mod file

Post by ann.jensen »

Hi,
I want to set a finite set of values for selection for the outputclass attribute when used on an xref element.
The possible values are
type=option1
type=option2

I set this in the mod file as follows

Code: Select all

<!ENTITY % xref.attributes
              "href
                          CDATA
                                    #IMPLIED
               keyref
                          CDATA
                                    #IMPLIED
               type
                          CDATA
                                    #IMPLIED
               format
                          CDATA
                                    #IMPLIED
               scope
                          (external |
                           local |
                           peer |
                           -dita-use-conref-target)
                                    #IMPLIED
               %univ-atts;
               outputclass
                         (type=option1 |
						type=option2)
                                    #IMPLIED
                              %variables-atts;"
>
I get an error when this is applied due to the = sign. It works fine if I omit the = sign and the values appear in attribute selector.
Is there a way to escape this equals sign so that I can use these attribute values?
Any advice appreciated,
Regards,
Ann
Radu
Posts: 9434
Joined: Fri Jul 09, 2004 5:18 pm

Re: Change entity xref.attributes in mod file

Post by Radu »

Hello Ann,
So going to the DTD specification for ATTLIST:

https://www.w3.org/TR/xml/#NT-AttlistDecl
The attribute definition has a name and a type:
https://www.w3.org/TR/xml/#NT-AttDef
And the attribute type can be a plain string or an enumerated type:
https://www.w3.org/TR/xml/#NT-AttType
With the enumerated type being a sequence of "|" separated Name tokens:
https://www.w3.org/TR/xml/#NT-EnumeratedType
And the name tokens:
https://www.w3.org/TR/xml/#NT-Name
basically allow these character values:

Code: Select all

[4]   	NameStartChar	   ::=   	":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
[4a]   	NameChar	   ::=   	NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
The equal sign is hexadecimal "3D" so it does not seem to fit here.
This means that maybe you can use ":" instead or something.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ann.jensen
Posts: 316
Joined: Wed Jun 17, 2015 10:19 am

Re: Change entity xref.attributes in mod file

Post by ann.jensen »

Thanks for the explanation Radu.
Regards,
Ann
Post Reply