Display xreflabel attribute contents in link text
Oxygen general issues.
-
- Posts: 58
- Joined: Sat Aug 01, 2009 12:57 am
Display xreflabel attribute contents in link text
According to DocBook docs, (http://www.docbook.org/tdg5/en/html/xref.html) when a link (xref, link, ... ) is pointing to an element that has xreflabel attribute defined, the link text should match the content of the xreflabel attribute.
I cannot seem to find a way to do that in Author view. The CSS does not seem to allow something like that. Is there a way to do it with extension/plugins?
I cannot seem to find a way to do that in Author view. The CSS does not seem to allow something like that. Is there a way to do it with extension/plugins?
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Display xreflabel attribute contents in link text
Post by sorin_ristache »
Hello,
That is not possible in the current version. We will consider that for a future version.
Regards,
Sorin
That is not possible in the current version. We will consider that for a future version.
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Display xreflabel attribute contents in link text
Post by sorin_ristache »
Hello,
There is no substring function in CSS. We will consider adding a CSS extension function for finding the substring of a string but the problem will be solved by xref taking the display text from the xreflabel attribute of the target element.
Regards,
Sorin
There is no substring function in CSS. We will consider adding a CSS extension function for finding the substring of a string but the problem will be solved by xref taking the display text from the xreflabel attribute of the target element.
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Display xreflabel attribute contents in link text
Post by sorin_ristache »
It was not planned for a version number. It will be probably implemented in one of the future versions.
Regards,
Sorin
Regards,
Sorin
-
- Posts: 58
- Joined: Sat Aug 01, 2009 12:57 am
Re: Display xreflabel attribute contents in link text
I was reading the development docs and it seems like I should be able to do this by implementing AuthorReferenceResolver interface. It seems suited exactly for that purpose.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Display xreflabel attribute contents in link text
Post by sorin_ristache »
You can set the content property of the link element using a ro.sync.ecss.extensions.api.StylesFilter implementation that you provide with ro.sync.ecss.extensions.api.ExtensionsBundle.createAuthorStylesFilter(). You call setProperty(KEY_MIXED_CONTENT, yourInstanceOf_StringContent) on the ro.sync.ecss.css.Styles parameter of StylesFilter.filter() for overriding the content property of the link element specified in the CSS stylesheet. yourInstanceOf_StringContent is an object of type ro.sync.ecss.css.StringContent that contains the displayed text of the link element when it is rendered in Author mode. In your case the displayed text should be the xreflabel attribute of the target element which you find with an XPath expression executed with ro.sync.ecss.extensions.api.AuthorAccess.getDocumentController().findNodesByXPath(). You get an AuthorAccess object in a listener of type ro.sync.ecss.extensions.api.AuthorExtensionStateListener that you provide in the method ro.sync.ecss.extensions.api.ExtensionsBundle.createAuthorExtensionStateListener().
It seems complicated but there are just a few lines of code because the Author API provides the entire infrastructure and hook points. Please let me know if it is not clear.
Regards,
Sorin
It seems complicated but there are just a few lines of code because the Author API provides the entire infrastructure and hook points. Please let me know if it is not clear.
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Display xreflabel attribute contents in link text
Post by sorin_ristache »
We will add this to the Simple Documentation Framework included in Author SDK as another example of using the Author API.
Regards,
Sorin
Regards,
Sorin
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