Reference to topic of topic
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 4
- Joined: Wed Oct 23, 2024 4:41 pm
Reference to topic of topic
Hi,
I'm reading this: The @keyref attribute, and specifically: For elements that can refer to elements within maps or topics, the value of the @keyref attribute is a key name, a slash ("/"), and the ID of the target element, where the key name must be bound to either the map or topic that contains the target element.
I've created this topic of topics, and the <keyword/> doesn't resolve, see attached,
Many thanks,
David
<map>
<title>Information Architecture Examples</title>
<topicref keys="sysvars" href="system-variables.dita" />
</map>
<topic id="system-variables">
<title>System variables</title>
<shortdesc>An approach to system variables.</shortdesc>
<body>
<p>Blurb</p>
</body>
<topic id="activate_all_roles_on_login">
<title>activate_all_roles_on_login</title>
<body>
<p><keyword keyref="sysvars/activate_all_roles_on_login"/></p>
</body>
</topic>
</topic>
I'm reading this: The @keyref attribute, and specifically: For elements that can refer to elements within maps or topics, the value of the @keyref attribute is a key name, a slash ("/"), and the ID of the target element, where the key name must be bound to either the map or topic that contains the target element.
I've created this topic of topics, and the <keyword/> doesn't resolve, see attached,
Many thanks,
David
<map>
<title>Information Architecture Examples</title>
<topicref keys="sysvars" href="system-variables.dita" />
</map>
<topic id="system-variables">
<title>System variables</title>
<shortdesc>An approach to system variables.</shortdesc>
<body>
<p>Blurb</p>
</body>
<topic id="activate_all_roles_on_login">
<title>activate_all_roles_on_login</title>
<body>
<p><keyword keyref="sysvars/activate_all_roles_on_login"/></p>
</body>
</topic>
</topic>
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Reference to topic of topic
Hi David,
You should probably read this part here "Effective text content is determined using the following set of rules:":
https://www.oxygenxml.com/dita/1.3/spec ... -text.html
Your case matches the situation in the specs:
Radu
You should probably read this part here "Effective text content is determined using the following set of rules:":
https://www.oxygenxml.com/dita/1.3/spec ... -text.html
Your case matches the situation in the specs:
Regards,For elements that also exist as a child of <topicmeta> in the key definition, effective content is taken from the first matching direct child of <topicmeta>. For example, given the following key definition, an empty <author> element with the attribute keyref="justMe" would result in the matching content "Just M. Name":Code: Select all
<keydef keys="justMe" href="http://www.example.com/my-profile" format="html" scope="external"> <topicmeta> <author>Just M. Name</author> </topicmeta> </keydef>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Reference to topic of topic
Hi David,
Right, for xref with keyref to a key which does not have any topicmeta this part of the specs should apply:
https://www.oxygenxml.com/dita/1.3/spec ... -text.html
Radu
Right, for xref with keyref to a key which does not have any topicmeta this part of the specs should apply:
https://www.oxygenxml.com/dita/1.3/spec ... -text.html
Regards,Otherwise, if the element with the key reference results in a link, normal link text determination rules apply as they would for <xref> (for example, using the <navtitle> or falling back to the URI of the link target).
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Reference to topic of topic
Hi,
So in a way you are attempting to reuse topic titles using keyrefs but without generating a link, I do not see a way to do this with the current standard, maybe you could add some outputclass attribute on the xref and then process it further in the publishing customization and get rid of the link...
Regards,
Radu
So in a way you are attempting to reuse topic titles using keyrefs but without generating a link, I do not see a way to do this with the current standard, maybe you could add some outputclass attribute on the xref and then process it further in the publishing customization and get rid of the link...
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 4
- Joined: Wed Oct 23, 2024 4:41 pm
Re: Reference to topic of topic
Curious?
This works: href="system-variables.dita#activate_all_roles_on_login"
This doesn't: keyref="sysvars#activate_all_roles_on_login"
I'd expect that a reference to a child topic could use a keyref based on a keydef to the parent topic.
Anyway, I'll just have to live with it.
Thanks for your assistance, Radu.
This works: href="system-variables.dita#activate_all_roles_on_login"
This doesn't: keyref="sysvars#activate_all_roles_on_login"
I'd expect that a reference to a child topic could use a keyref based on a keydef to the parent topic.
Anyway, I'll just have to live with it.
Thanks for your assistance, Radu.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Reference to topic of topic
Hi David,
Otherwise you need to create a key for each inner topic like:
Regards,
Radu
All topics inside a DITA XML file behave as top level topics. The keyref "keyName/elementID" can only refer to a non-topic "elementID".I'd expect that a reference to a child topic could use a keyref based on a keydef to the parent topic.
Otherwise you need to create a key for each inner topic like:
Code: Select all
<keyref href="topic.dita#innerTopicID" keys="innerTopicKey"/>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 4
- Joined: Wed Oct 23, 2024 4:41 pm
Re: Reference to topic of topic
OK, so I'm going to have to set up keydefs to all these child topics, and I'll put them in their own map.
I need cross document links to this content, which would normally be with keyscopes.
But, surely I could just incorporate the keydef map in any other document that needs to link to it? Making sure that it is all resource-only.
That would define the necessary keys, but not pull the content in.
Why bother with keyscopes? One way or another, it is necessary to tell the second document where to go to resolve the keys.
Am I missing something?
Thanks once again.
I need cross document links to this content, which would normally be with keyscopes.
But, surely I could just incorporate the keydef map in any other document that needs to link to it? Making sure that it is all resource-only.
That would define the necessary keys, but not pull the content in.
Why bother with keyscopes? One way or another, it is necessary to tell the second document where to go to resolve the keys.
Am I missing something?
Thanks once again.
Last edited by dhollis on Thu Oct 24, 2024 6:12 pm, edited 1 time in total.
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)
- ↳ 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