Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 265943 - DocumentElementNode: namespace prefix support is broken
Summary: DocumentElementNode: namespace prefix support is broken
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Chris Aniszczyk CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-24 06:51 EST by Benjamin Cabé CLA
Modified: 2009-02-24 10:57 EST (History)
1 user (show)

See Also:


Attachments
Patch (2.76 KB, patch)
2009-02-24 06:55 EST, Benjamin Cabé CLA
caniszczyk: iplog+
Details | Diff
mylyn/context/zip (1.66 KB, application/octet-stream)
2009-02-24 06:55 EST, Benjamin Cabé CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Cabé CLA 2009-02-24 06:51:57 EST
HEAD 20090224

setNamespace/getNamespace and setNamespacePrefix/getNamespacePrefix should by default rely on a field stored in DocumentElementNode. This is not the case in HEAD, thus, even if DSComponent performs a setNamespace(IDSConstants.NAMESPACE), the DocumentElementNode#writeShallow() method retrieves "" when calling getNamespace() and produces invalid XML (again!) because the prefix is used on the root element but not declared...

See:

<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="a.b.c">
   <implementation class="lmkmlk"/>
</scr:component>


This is rather severe since the component doesn't have a "DS" content-type anymore, and the DS editor is *not* opened at the end of the component creation wizard.
Comment 1 Benjamin Cabé CLA 2009-02-24 06:55:06 EST
Created attachment 126536 [details]
Patch

A proposed better handling of namespaces/prefixes
Comment 2 Benjamin Cabé CLA 2009-02-24 06:55:11 EST
Created attachment 126537 [details]
mylyn/context/zip
Comment 3 Chris Aniszczyk CLA 2009-02-24 10:57:36 EST
done.

> 20090224

This is our best option until PDE text editing fwk supports dom lvl2 or we move onto something like EMF.