NEW DATE! Bugzilla will undergo maintenance 2024-03-28 18h00 CET. Bugzilla will be placed in read-only mode at that time.

Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 482929 - Add support for basic reading and writing of the internal subset
Summary: Add support for basic reading and writing of the internal subset
Status: CLOSED MOVED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-24 11:35 EST by Florian Thienel CLA
Modified: 2015-12-02 16:03 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Thienel CLA 2015-11-24 11:35:26 EST
The internal subset of the DTD is currently ignored when a document is loaded and when the document is saved, the internal subset gets lost.

The following is a coarse list of things that have to be done to add support for the internal subset:
(1) Add a representation of the internal subset to our DOM. One possibility would be to add a member to the Document node type to store the textual represenation of the internal subset.
(2) Make the DocumentBuilder class read the internal subset and store the information in the DOM (see (1))
(3) Extend the DocumentWriter class to actually output the internal subset when saving the document.
Comment 1 Aaron Spike CLA 2015-12-02 13:43:38 EST
I'm happy to say that the files you mention are exactly where I ended up when reading through the code.

Before I proceed, I would like to take a moment to discuss my specific application for this feature, to make sure I'm using the right words and working toward the eventual goal. My intent is to utilize a separate entities file to introduce entities into my DocBook documents. Each DocBook file would look like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter [
<!ENTITY % myentities SYSTEM "../myentities.ent" >
%myentities;
]>
<chapter 
  xml:lang="en" 
  xmlns="http://docbook.org/ns/docbook" 
  version="5.0" 
  xmlns:xi="http://www.w3.org/2001/XInclude" 
  xmlns:xl="http://www.w3.org/1999/xlink">
    <info>
    	<title>Chapter Title</title>
    </info>
	<section>
		<title>Section Title</title>
		<para>This is a paragraph.</para>
	</section>
</chapter>

Following the example at http://www.sagehill.net/docbookxsl/Db5Entities.html . I have tried this and it works well with DEP4E. But there are at least two problems when editing and saving the files with VEX. 
1. The XML declaration and the DOCTYPE are removed in entirety
2. All referenced entities are replaced with their value

I'm relatively inexperienced in the world of XML and it seems DTD are relatively complex and featureful. Am I correctly referring to this as the internal subset? Do you expect this new feature will address my problem or are there other things I should put on my list to address?
Comment 2 Florian Thienel CLA 2015-12-02 16:03:37 EST
(In reply to Aaron Spike from comment #1)
You're in the right way, Aaron, it is in fact the internal subset you are talking about. Your first point (removal of the DOCTYPE declaration) is exactly the thing that this bug tries to address.

The second point is a bit more complicated, since there is currently no representation of named entities in our DOM. They are replaced by their actual value when the document is parsed (in DocumentBuilder). Since proper handling of named entities is a big topic, I would rather handle this in a separate bug.

Nevertheless, the expected result of this bug here (reading and writing of the internal subset) is a required prerequisite for handling of named entities.
Comment 3 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
Mylyn has been restructured, and our issue tracking has moved to GitHub [1].

We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub.

[1] https://github.com/orgs/eclipse-mylyn