Triger reformatting
Post here questions and problems related to oXygen frameworks/document types.
Triger reformatting
When document is opened in Author mode, until it is modified no XML formatting takes place. Can I somehow force this via code and reformat several files in bulk?
I am able to open files via my plugin class implementing AuthorOperation:
As I couldn't find any formatting trigger, I am trying inserting and removing XML fragment to zero position. But this approach fails (Premature end of file).
Any idea?
I am able to open files via my plugin class implementing AuthorOperation:
As I couldn't find any formatting trigger, I am trying inserting and removing XML fragment to zero position. But this approach fails (Premature end of file).
Code: Select all
Reader reader = new InputStreamReader(new FileInputStream(processedFile), "UTF-8");
authorAccess.getEditorAccess().reloadContent(reader);
// inserting and removing content
authorAccess.getDocumentController().insertXMLFragment("<?pi?>", 0); --> Error: Premature end of file.
authorAccess.getDocumentController().delete(0, 6);
Re: Triger reformatting
Hi,
If you want to make bulk format and indent changes, in the Oxygen Project view you can right click on a folder linked there and then choose "Format and Indent Files".
In addition, the Oxygen Preferences->"Editor / Edit Modes / Author" page has a "Format and indent->The entire document" radio button which should always format and indent the entire document when the contents are saved.
About what you are trying to do right now, you should try to insert the processing instruction at offset "1", we consider offset "0" to be the "document" node (which contains all comments, PIs and the root element) and you cannot insert anything before the "document" node.
Regards,
Radu
If you want to make bulk format and indent changes, in the Oxygen Project view you can right click on a folder linked there and then choose "Format and Indent Files".
In addition, the Oxygen Preferences->"Editor / Edit Modes / Author" page has a "Format and indent->The entire document" radio button which should always format and indent the entire document when the contents are saved.
About what you are trying to do right now, you should try to insert the processing instruction at offset "1", we consider offset "0" to be the "document" node (which contains all comments, PIs and the root element) and you cannot insert anything before the "document" node.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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