Bug 173447 - Generated schema description is not valid HTML
Summary: Generated schema description is not valid HTML
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M2   Edit
Assignee: Adam Archer CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, contributed
Depends on:
Blocks:
 
Reported: 2007-02-08 09:28 EST by Markus Keller CLA
Modified: 2007-09-17 15:42 EDT (History)
2 users (show)

See Also:


Attachments
mylyn/context/zip (733 bytes, application/octet-stream)
2007-08-29 19:01 EDT, Chris Aniszczyk CLA
no flags Details
patch (11.81 KB, patch)
2007-09-07 12:34 EDT, Adam Archer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-02-08 09:28:13 EST
I20070208-0010

Generated schema description is not valid HTML. E.g. validating the schema description for org.eclipse.ui.workbench.texteditor.hyperlinkDetectors yields 48 errors. Most of them are duplicate id=... attributes and nested <p> tags.

The nested <p> tags are especially bad, since they make copy-paste of examples unusable, e.g.:

<extension point=

"org.eclipse.ui.workbench.texteditor.hyperlinkDetectorTargets"

>

  

<target id=

"org.eclipse.jdt.ui.javaCode"

name=

"Java Editor"

>

    

<context type=

"org.eclipse.ui.texteditor.ITextEditor"

/>

  

</target>

</extension>
Comment 1 Wassim Melhem CLA 2007-08-29 18:49:47 EDT
This would be a high impact bugday contribution, since all HTML documents generated for all extension points in the world go through this piece of code.
Comment 2 Chris Aniszczyk CLA 2007-08-29 19:01:37 EDT
Look at SchemaTransformer in pde.core

I'm attaching a mylyn context to help people out also.
Comment 3 Chris Aniszczyk CLA 2007-08-29 19:01:41 EDT
Created attachment 77321 [details]
mylyn/context/zip
Comment 4 Chris Aniszczyk CLA 2007-09-05 17:42:09 EDT
This is a nice one to fix Adam.
Comment 5 Adam Archer CLA 2007-09-07 12:34:02 EDT
Created attachment 77896 [details]
patch

With this patch, all of the validation issues (that I could find) are resolved.

There are, however, some complications. The duplicate ids mentioned in comment 0 were actually being used to specify the CSS class to be used. This means that removing the duplicate ids also meant modifying the schema.css so that the classes do not depend on the element id.

Unfortunately, updating the css does not seem to be as trivial as one would have hoped. At first, the change just did not seem to be taking effect. I then discovered that o.e.pde.core is caching its schema.css in the workspace's .metadata. When I replaced the schema in there with my changes, everything worked as desired. After that, I noticed that PDE is first asking for the schema from o.e.platform.doc.isv and then only getting the one from pde.core if the docs didn't supply one for whatever reason. When I updated the schema.css in doc.isv, and ran on an old workspace (with the new pde.core and doc.isv in my workspace), it picked up those changes.

What I'm unsure about, at this point, is why I was ever getting the cached copy from pde.core. I would have thought the copy from doc.isv would always be available (as long as I have the plugin in my <eclipse home>/plugins).

The new doc generation in tandem with the new css fixes the validation issues, but a little bit more investigation is required to ensure that a user will never have a new doc with an old css reference. When this happens, things look very very ugly.
Comment 6 Brian Bauman CLA 2007-09-17 15:42:04 EDT
This fix is in the build as of right now.  If UA can't update the schema definitons/css file, we will have to retarget for M3.