Plugin - Active DTD/Framework
Oxygen general issues.
-
- Posts: 96
- Joined: Mon May 09, 2011 11:54 am
Plugin - Active DTD/Framework
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
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
-
- Posts: 9472
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Plugin - Active DTD/Framework
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
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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9472
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Plugin - Active DTD/Framework
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
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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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