How to get current document type

Posts: 63
Joined: Thu Oct 29, 2020 12:01 am

How to get current document type

Post by manojdcoder » Wed Nov 25, 2020 7:46 pm

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] ... pport.html

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

Re: How to get current document type

Post by cristi_talau » Wed Nov 25, 2020 11:06 pm

The Document.documentType property is specified by this property: ... -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 "" and so on.

Post Reply