How to add an external entity
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 12
- Joined: Sun Feb 27, 2011 10:30 am
How to add an external entity
Hello,
I would like to add programmaticaly an external unparsed entity to the doctype of my document.
The only way I have found seems to manipulate docType content string and construct a new AuthorDocumentType.
Is there a easiest way ?
Thanks for your help!
Regards,
Nicolas
I would like to add programmaticaly an external unparsed entity to the doctype of my document.
The only way I have found seems to manipulate docType content string and construct a new AuthorDocumentType.
Is there a easiest way ?

Thanks for your help!
Regards,
Nicolas
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to add an external entity
Hi Nicholas,
So you decided to use these methods:
ro.sync.ecss.ue.AuthorDocumentControllerImpl.setDoctype(AuthorDocumentType)
and:
ro.sync.ecss.ue.AuthorDocumentControllerImpl.getDoctype()
This is appropriate for what you are trying to accomplish.
The only downside (mentioned in the Javadoc) is this:
ro.sync.exml.workspace.api.editor.WSEditorBase.createContentReader()
to read the entire XML content of the page, make modifications to it and then:
ro.sync.exml.workspace.api.editor.WSEditorBase.reloadContent(Reader)
to reload the entire Author page from the modified XML content.
But this approach will clear all undoable edits made in the document prior to the reload.
With either approach we do not have in the internal model the internal DTD subset as a structure of nodes so you have to take it as a string and return it as a string.
Regards,
Radu
So you decided to use these methods:
ro.sync.ecss.ue.AuthorDocumentControllerImpl.setDoctype(AuthorDocumentType)
and:
ro.sync.ecss.ue.AuthorDocumentControllerImpl.getDoctype()
This is appropriate for what you are trying to accomplish.
The only downside (mentioned in the Javadoc) is this:
The only other approach is to use these methods:WARNING: if these modifications affect regular entities already inserted and expanded, they will not be re-parsed and their old content will remain rendered as such.
ro.sync.exml.workspace.api.editor.WSEditorBase.createContentReader()
to read the entire XML content of the page, make modifications to it and then:
ro.sync.exml.workspace.api.editor.WSEditorBase.reloadContent(Reader)
to reload the entire Author page from the modified XML content.
But this approach will clear all undoable edits made in the document prior to the reload.
With either approach we do not have in the internal model the internal DTD subset as a structure of nodes so you have to take it as a string and return it as a string.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 12
- Joined: Sun Feb 27, 2011 10:30 am
Re: How to add an external entity
Hi Radu,
Thanks for your answer and your great support!
When debugging my program I see an obfuscated structure containing the externals entities as objects.
Do you plan to open it ?
Regards,
Nicolas
Thanks for your answer and your great support!
When debugging my program I see an obfuscated structure containing the externals entities as objects.
Do you plan to open it ?

Regards,
Nicolas
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to add an external entity
Hi Nicholas,
Internally we keep a map of all unparsed entities detected from the associated DTD + we keep in the internal AuthorNode tree the nodes corresponding to each entity reference in the XML document.
I am not quite sure to what objects you are referring to, maybe you can give me a screenshot with the debugger view (you can also write us directly to support@oxygenxml.com) + the exact Oxygen version on which you are developing.
These internal structures are used only for lookup, so they are read-only by nature, so you cannot modify the internal DTD in the XML by modifying any of them, the API is the only way for this, we do not have an internal structure of the entire DTD model.
Regards,
Radu
Internally we keep a map of all unparsed entities detected from the associated DTD + we keep in the internal AuthorNode tree the nodes corresponding to each entity reference in the XML document.
I am not quite sure to what objects you are referring to, maybe you can give me a screenshot with the debugger view (you can also write us directly to support@oxygenxml.com) + the exact Oxygen version on which you are developing.
These internal structures are used only for lookup, so they are read-only by nature, so you cannot modify the internal DTD in the XML by modifying any of them, the API is the only way for this, we do not have an internal structure of the entire DTD model.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 12
- Joined: Sun Feb 27, 2011 10:30 am
Re: How to add an external entity
That's too bad Oxygen doesn't have more features on internal subset manipulation. For schema where the internal subset is used to declare graphics, for my use case I will parse, add the new graphic and serialize the doctype manually.
Thanks again for your support!
Regads,
Nicolas
Thanks again for your support!
Regads,
Nicolas
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