How to get display name of AuthorElement

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Posts: 63
Joined: Thu Oct 29, 2020 12:01 am

How to get display name of AuthorElement

Post by manojdcoder » Tue Mar 23, 2021 12:39 am

I would like to find all possible attributes of selected element along with its display name.

I was able to use createWhatAttributesCanGoHereContext to find all possible attributes, but not sure how to get the display name. It always returns the xml name.

i.e if a topicref is selected I would like to get the editor displayed name Topic Reference.

Posts: 345
Joined: Thu Sep 04, 2014 4:22 pm

Re: How to get display name of AuthorElement

Post by cristi_talau » Wed Mar 24, 2021 9:55 am


As of Web Author version 23.1, there are two methods to retrieve the display name of an author element none of which is public API:
  • In JS code you can use sync.view.NodeRenderer.getRenderedText(node.getHtmlNode()), where node is a Node of the XML document.
  • In Java code you can use the following:

Code: Select all

String frameworkId =  authorDocumentModel.getDocumentTypeId();
If you want to avoid depending on non-documented APIs, you can parse the i18n/translation-cc.xml file in the built-in DITA framework to get the display names of elements according to the user language.


Post Reply