Attribute is not allowed to appear in element "topicref".
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 105
- Joined: Thu Jan 20, 2022 12:36 pm
Attribute is not allowed to appear in element "topicref".
Hello,
I created a subject scheme map with the following declaration:
However, when I apply a profiling attribute to a topic referenced in a map:
I notice the following message:
Why couldn't I apply this new attribute to my topic ref?
Thanks a lot for your help
I created a subject scheme map with the following declaration:
Code: Select all
<subjectScheme>
<subjectdef keys="browserapp">
<subjectdef keys="firefox" navtitle="Firefox"/>
<subjectdef keys="chrome" navtitle="Chrome"/>
<subjectdef keys="safari" navtitle="Safari"/>
<subjectdef keys="brave" navtitle="Brave"/>
</subjectdef>
<enumerationdef>
<attributedef name="BrowserApp"/>
<subjectdef keyref="browserapp"/>
</enumerationdef>
</subjectScheme>
Code: Select all
<topicref href="topics/brave.dita" BrowserApp="brave"/>
Code: Select all
Attribute "BrowserApp" is not allowed to appear in element "topicref".
Thanks a lot for your help

------
Gaspard
Gaspard
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Attribute is not allowed to appear in element "topicref".
Post by chrispitude »
Hi gbv34,
If you want to create your own profiling attribute in DITA, you must specialize it from @props first, which means creating DITA-OT plugins to define your attribute, then defining a new document shell type that uses it.
As an alternative, you could use an existing DITA profiling attribute (like @audience or @deliveryTarget) to capture this information:
If you are already using that attribute for other things, you could use DITA's support for profiling attribute groups:
2.4.3.1 Conditional processing values and groups
https://docs.oasis-open.org/dita/dita/v ... butes.html
which would let you create a "group" within the attribute, essentially acting as your own sub-attribute within that attribute:
but this feature won't be supported in Oxygen until the v25 release.
If you want to create your own profiling attribute in DITA, you must specialize it from @props first, which means creating DITA-OT plugins to define your attribute, then defining a new document shell type that uses it.
As an alternative, you could use an existing DITA profiling attribute (like @audience or @deliveryTarget) to capture this information:
Code: Select all
<subjectScheme>
<subjectdef keys="browserapp">
<subjectdef keys="firefox" navtitle="Firefox"/>
<subjectdef keys="chrome" navtitle="Chrome"/>
<subjectdef keys="safari" navtitle="Safari"/>
<subjectdef keys="brave" navtitle="Brave"/>
</subjectdef>
<enumerationdef>
<attributedef name="deliveryTarget"/>
<!-- ^^^^^^^^^^^^^^ -->
<subjectdef keyref="browserapp"/>
</enumerationdef>
</subjectScheme>
2.4.3.1 Conditional processing values and groups
https://docs.oasis-open.org/dita/dita/v ... butes.html
which would let you create a "group" within the attribute, essentially acting as your own sub-attribute within that attribute:
Code: Select all
<subjectScheme>
<subjectdef keys="browserapp">
<subjectdef keys="BrowserApp(firefox)" navtitle="Firefox"/>
<subjectdef keys="BrowserApp(chrome)" navtitle="Chrome"/>
<subjectdef keys="BrowserApp(safari)" navtitle="Safari"/>
<subjectdef keys="BrowserApp(brave)" navtitle="Brave"/>
<!-- ^^^^^^^^^^ -->
</subjectdef>
<enumerationdef>
<attributedef name="deliveryTarget"/>
<subjectdef keyref="browserapp"/>
</enumerationdef>
</subjectScheme>
-
- Posts: 9454
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Attribute is not allowed to appear in element "topicref".
Hi,
As Chris says, with the subject scheme map you cannot define new profiling attributes, you just define controlled values for existing profiling attributes.
But to add a new profiling attribute you need to create a DITA OT DITA specialization plugin:
http://dita4practitioners.github.io/dit ... ocess.html
and integrate it in the DITA OT publishing engine used by Oxygen:
https://www.oxygenxml.com/doc/versions/ ... ation.html
Regards,
Radu
As Chris says, with the subject scheme map you cannot define new profiling attributes, you just define controlled values for existing profiling attributes.
But to add a new profiling attribute you need to create a DITA OT DITA specialization plugin:
http://dita4practitioners.github.io/dit ... ocess.html
and integrate it in the DITA OT publishing engine used by Oxygen:
https://www.oxygenxml.com/doc/versions/ ... ation.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Attribute is not allowed to appear in element "topicref".
Post by chrispitude »
And if you really want to specialize your own attribute, you can use the make_dita_grammar.pl script to automate the plugin creation, available here:
DITA-plugin-utilities
https://github.com/chrispy-snps/DITA-plugin-utilities
You would give it input something like this:
and it would make the DITA-OT plugin and document-type shell for you. But you would still need to follow the process in Radu's second link to use them.
DITA-plugin-utilities
https://github.com/chrispy-snps/DITA-plugin-utilities
You would give it input something like this:
Code: Select all
<plugin directory="./com.synopsys.docshell" uri_prefix="com:synopsys:docshell">
<attributedomain filename="BrowserAppAttMod.rng" domain="BrowserApp">
<specialize attribute="BrowserApp" from="props" model="(Firefox|Chrome|Safari|Brave)*"/>
</attributedomain>
<topicshell filename="myTopicShell.rng">
<title>My Topic</title>
<header>...some header stuff...</header>
<root_element>topic</root_element>
<include_domains>BrowserApp</include_domains>
</topicshell>
</plugin>
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service