Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 86507

Summary: hyperlink navigation does not handle multiple schema bindings in one schemalocation attribute
Product: [WebTools] WTP Source Editing Reporter: Amy Wu <for.work.things>
Component: wst.xmlAssignee: Rakesh <rakes123>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: for.work.things, jesper, nsand.dev, rakes123
Version: 0.7Keywords: helpwanted
Target Milestone: 3.3 M5Flags: nsand.dev: review+
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Screenshot showing correct behaviour - sortof
none
Screenshot showing problem with the last link of a xsi:schemaLocation element
none
patch nsand.dev: iplog+

Description Amy Wu CLA 2005-02-24 13:13:20 EST
I20050222

You can specify multiple schema bindings in one schemalocation attribute, but 
the hyperlink navigation always only opens the first.

Ex:
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"
            xmlns:html="http://www.w3.org/1999/xhtml"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.w3.org/1999/XSL/Transform
                                http://www.w3.org/1999/XSL/Transform.xsd
                                http://www.w3.org/1999/xhtml
                                http://www.w3.org/1999/xhtml.xsd">

when you hover over http://www.w3.org/1999/xhtml instead of openning 
http://www.w3.org/1999/xhtml.xsd  http://www.w3.org/1999/XSL/Transform.xsd is 
openned.
Comment 1 David Williams CLA 2005-06-15 01:23:57 EDT
Changed Version field given new release numbering.
Comment 2 Amy Wu CLA 2008-02-04 12:57:56 EST
mass reassignment of my bugs to xml-inbox
Comment 3 Nitin Dahyabhai CLA 2008-02-14 13:45:04 EST
May already be corrected, need to retest with M5.
Comment 4 Jesper Moller CLA 2009-04-05 17:21:24 EDT
Created attachment 130950 [details]
Screenshot showing correct behaviour - sortof

This appears to be fixed in WTP 3.1 M6, since all URIs inside schemaLocation (including the namespace names themselves) are now hyperlinkable, but there could be related bugs, since a total of three navigation suggestions appear two identical (1 and 2) and one obviously bogus (bottom link, underlined).

I'll check for dupes and comment here.
Comment 5 Jesper Moller CLA 2009-04-10 16:40:12 EDT
Turns out the fix is not complete / correct!

I was too quick in my former assessment of the bug, since the last URI in the list includes the closing quote, in this case, the link detected is http://www.w3.org/1999/xhtml.xsd"
It appears to be an off by one error of sorts. I can investigate if anyone' interested.
Comment 6 Jesper Moller CLA 2009-04-10 16:44:02 EDT
Created attachment 131530 [details]
Screenshot showing problem with the last link of a xsi:schemaLocation element
Comment 7 Jesper Moller CLA 2009-04-10 17:37:09 EDT
Argh. Please disregard comments 4-6 and rest assured that this bug still exists, and should not be closed just yet. Just turn off the platform's URL detector and possibly Mylyn's Task URL detector and see how all the links in the shemaLocation are indeed highlighted.

P.S: The problem with the closing quote is a problem in the heuristics in the URLHyperlinkDetector from platform.
Comment 8 Rakesh CLA 2010-06-07 07:08:30 EDT
Not reproducible on  I20100602-1502 build.Correct link is getting opened now.
Comment 9 Jesper Moller CLA 2010-08-23 19:49:03 EDT
Still present in 3.2.0, e.g. Helios EPP build Eclipse Java EE Developer Tools from v201006240600.

To reproduce, create an XML document, paste the contents below, open Preferences -> General -> Editors -> Text Editing -> Hyperlinks, and de-select the Link Kind 'URL', available in 'Textual Editors', and then (in the editor, Ctrl-click on  http://www.w3.org/1999/xhtml, and WTP will open the stylesheet for XSLT 2.0.
Comment 10 Rakesh CLA 2010-10-05 08:03:05 EDT
(In reply to comment #9)
> Still present in 3.2.0, e.g. Helios EPP build Eclipse Java EE Developer Tools
> from v201006240600.
> 
> To reproduce, create an XML document, paste the contents below, open
> Preferences -> General -> Editors -> Text Editing -> Hyperlinks, and de-select
> the Link Kind 'URL', available in 'Textual Editors', and then (in the editor,
> Ctrl-click on  http://www.w3.org/1999/xhtml, and WTP will open the stylesheet
> for XSLT 2.0.
I am not sure if i missed something, but if i deselect 'URL' from Text Editors , i can't click on any link.I used wtp 3.2.3 from  M20100909-0800.
Comment 11 Rakesh CLA 2010-11-15 06:03:32 EST
Created attachment 183114 [details]
patch

<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"
            xmlns:html="http://www.w3.org/1999/xhtml"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.w3.org/1999/XSL/Transform
                                http://www.w3.org/1999/XSL/Transform.xsd
                                http://www.w3.org/1999/xhtml
                                http://www.w3.org/1999/xhtml.xsd">
Now it is able to recognize where we clicked in xsi:schemaLocation.
But it is not resolved to anything. So it will now look for next attribute value that is resolvable.So instead it will open 'xmlns="http://www.w3.org/1999/XSL/Transform"'(line 1). It may look odd, but this is is functionality , so i did not remove it.Let me know if its removal is required.
Comment 12 Nick Sandonato CLA 2010-11-15 16:22:12 EST
(In reply to comment #11)
> Created an attachment (id=183114) [details]
> patch
> 
> <stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"
>             xmlns:html="http://www.w3.org/1999/xhtml"
>             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>             xsi:schemaLocation="http://www.w3.org/1999/XSL/Transform
>                                 http://www.w3.org/1999/XSL/Transform.xsd
>                                 http://www.w3.org/1999/xhtml
>                                 http://www.w3.org/1999/xhtml.xsd">
> Now it is able to recognize where we clicked in xsi:schemaLocation.
> But it is not resolved to anything. So it will now look for next attribute
> value that is resolvable.So instead it will open
> 'xmlns="http://www.w3.org/1999/XSL/Transform"'(line 1). It may look odd, but
> this is is functionality , so i did not remove it.Let me know if its removal is
> required.

I think the problem that Jesper mentioned remains. It's that each of the url's in the list all direct you to the same schema (xslt-1.0.xsd), when really xhtml should be opening xhtml.xsd.
Comment 13 Rakesh CLA 2010-11-16 06:59:36 EST
(In reply to comment #12)
> (In reply to comment #11)
> > Created an attachment (id=183114) [details] [details]
> > patch
> > 
> > <stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"
> >             xmlns:html="http://www.w3.org/1999/xhtml"
> >             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >             xsi:schemaLocation="http://www.w3.org/1999/XSL/Transform
> >                                 http://www.w3.org/1999/XSL/Transform.xsd
> >                                 http://www.w3.org/1999/xhtml
> >                                 http://www.w3.org/1999/xhtml.xsd">
> > Now it is able to recognize where we clicked in xsi:schemaLocation.
> > But it is not resolved to anything. So it will now look for next attribute
> > value that is resolvable.So instead it will open
> > 'xmlns="http://www.w3.org/1999/XSL/Transform"'(line 1). It may look odd, but
> > this is is functionality , so i did not remove it.Let me know if its removal is
> > required.
> 
> I think the problem that Jesper mentioned remains. It's that each of the url's
> in the list all direct you to the same schema (xslt-1.0.xsd), when really xhtml
> should be opening xhtml.xsd.
Hi Nick, here is explanation for this behavior:
Out of all the above links, only http://www.w3.org/1999/XSL/Transform and http://www.w3.org/1999/XSL/Transform.xsd are resolved to a file(xslt-1.0.xsd) by some plugin(not ours).
So what happens is if we hover over 'http://www.w3.org/1999/xhtml' , it is resolved to 'http://www.w3.org/1999/xhtml.xsd' , but we ignore it since we want some file in local file system. 
Now our detector again tries to find a linkable attribute, in current element .Since only above 2 mentioned links are resolved(to xslt-1.0.xsd), this xsd is opened always.
We can do either of following:
1)Try to open 'http://www.w3.org/1999/xhtml.xsd'.
2)If not 1,ignore links that are not resolved to local file system, since it could be confusing to users.
What my patch does is it differentiate between 'http://www.w3.org/1999/xhtml','http://www.w3.org/1999/XSL/Transform' but it will be of no help since 'http://www.w3.org/1999/XSL/Transform' is not resolved to local file.
If we create a Catalog using 'http://www.w3.org/1999/xhtml.xsd' as SystemId , you will notice difference.
Comment 14 Rakesh CLA 2011-01-20 03:43:37 EST
ping!
Comment 15 Nick Sandonato CLA 2011-01-21 15:51:41 EST
I see what you mean, Rakesh. Patch looks ok to me. Thanks.