Bug 255833 - [ui] SML-IF editor creates incorrect (invalid) files
Summary: [ui] SML-IF editor creates incorrect (invalid) files
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Cosmos (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: David Whiteman CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-19 11:37 EST by John Arwe CLA
Modified: 2012-01-03 13:55 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arwe CLA 2008-11-19 11:37:25 EST
If you use the New File dialog to create an empty SMLIF, then the context menu to add existing files as instance/definition documents, the code behaves incorrectly.

First, adding a new file via the context menu only reads in the first line of the target file (first line of XML content, second physical line of file due to XML version directive).

Second, there is a prompting error.  The first add asks whether the new file is a definition or instance document.  If you select Instance, then the next add does not prompt (it assumes Definition).

Third, adding the Definition document (in my case it did guess correctly) causes the editor to correctly add the <smlif:definitions> stanza, but it places it AFTER <smlif:instances> instead of before so the SMLIF file it builds does not validate against the SMLIF schema.
Comment 1 David Whiteman CLA 2009-04-27 11:46:13 EDT
Attempted to fix this somewhat by adding an empty <defnitions> and <instances> section, but unfortunately that violates the schema validation, since it's expected you have at least one definition or instance when you have those sections.  Will have to fix this the hard way.