Page 1 of 1
Plugin - Active DTD/Framework
Posted: Thu Feb 06, 2014 2:14 pm
by patrick
Hi,
I want to activate certain functions in a workspace plugin only if the current file is using a specific dtd (or a specific framework is activated). Can I get these information without parsing the content by myself?
Thanks,
Patrick
Re: Plugin - Active DTD/Framework
Posted: Thu Feb 06, 2014 4:16 pm
by Radu
Hi Patrick,
Unfortunately we do not have some specific API for this. I will add an improvement request to add some because it looks like a valid use case.
In the meantime if the editor is opened in the visual Author mode you can look at the root node and possibly derive that information from there.
Or you can call the API:
ro.sync.exml.workspace.api.editor.WSEditorBase.createContentReader()
and use a SAX parser (ro.sync.exml.workspace.api.util.XMLUtilAccess.newNonValidatingXMLReader()) to parse the XML and obtain the information from there. You can stop the parsing after the root element was encountered by throwing an exception in the SAX content handler if you want fast detection.
Regards,
Radu
Re: Plugin - Active DTD/Framework
Posted: Fri May 23, 2014 3:44 pm
by Radu
Hi Patrick,
In Oxygen 16.0 we added this API "ro.sync.exml.workspace.api.editor.WSEditorBase.getDocumentTypeInformation()" which gives you details about the document type configuration used for an opened XML document.
Regards,
Radu