How to get current document type

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
manojdcoder
Posts: 67
Joined: Thu Oct 29, 2020 12:01 am

How to get current document type

Post by manojdcoder »

Is it possible to get current document type, whether its DITA or DocBook etc., especially from JavaScript side?

I see getDocument().documentType in AuthorEditingSupport[1] but it reads the documentType property of document always returns null

[1]https://www.oxygenxml.com/maven/com/oxy ... pport.html
cristi_talau
Posts: 517
Joined: Thu Sep 04, 2014 4:22 pm

Re: How to get current document type

Post by cristi_talau »

The Document.documentType property is specified by this property: https://www.w3.org/TR/DOM-Level-2-Core/ ... -412266927 , but Web Author does not support this part of the DOM specification.

To identity the document type you can look at the document structure. For example, for DITA there is a "DITAArchVersion" attribute on the root. For DocBook, the namespace of the root element is "http://docbook.org/ns/docbook" and so on.
Post Reply