Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 183114 Details for
Bug 86507
hyperlink navigation does not handle multiple schema bindings in one schemalocation attribute
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
86507.patch (text/plain), 4.62 KB, created by
Rakesh
on 2010-11-15 06:03:32 EST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Rakesh
Created:
2010-11-15 06:03:32 EST
Size:
4.62 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.xml.ui >Index: src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java,v >retrieving revision 1.23 >diff -u -r1.23 XMLHyperlinkDetector.java >--- src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java 11 Oct 2008 01:05:25 -0000 1.23 >+++ src/org/eclipse/wst/xml/ui/internal/hyperlink/XMLHyperlinkDetector.java 15 Nov 2010 10:58:06 -0000 >@@ -19,6 +19,7 @@ > import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.IPath; > import org.eclipse.core.runtime.Path; >+import org.eclipse.jface.text.BadLocationException; > import org.eclipse.jface.text.IDocument; > import org.eclipse.jface.text.IRegion; > import org.eclipse.jface.text.ITextViewer; >@@ -43,9 +44,11 @@ > import org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl; > import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery; > import org.eclipse.wst.xml.core.internal.contentmodel.util.DOMNamespaceHelper; >+import org.eclipse.wst.xml.core.internal.document.AttrImpl; > import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil; > import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr; > import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; >+import org.eclipse.wst.xml.ui.internal.Logger; > import org.w3c.dom.Attr; > import org.w3c.dom.DocumentType; > import org.w3c.dom.Element; >@@ -112,7 +115,7 @@ > String uriString = null; > if (currentNode.getNodeType() == Node.DOCUMENT_TYPE_NODE) { > // doctype nodes >- uriString = getURIString(currentNode, document); >+ uriString = getURIString(currentNode, document, region); > } > else if (currentNode.getNodeType() == Node.ELEMENT_NODE) { > // element nodes >@@ -120,7 +123,7 @@ > if (currentAttr != null) { > // try to find link for current attribute > // resolve attribute value >- uriString = getURIString(currentAttr, document); >+ uriString = getURIString(currentAttr, document, region); > // verify validity of uri string > if ((uriString == null) || !isValidURI(uriString)) { > // reset current attribute >@@ -131,7 +134,7 @@ > // try to find a linkable attribute within element > currentAttr = getLinkableAttr((Element) currentNode); > if (currentAttr != null) { >- uriString = getURIString(currentAttr, document); >+ uriString = getURIString(currentAttr, document, region); > } > } > currentNode = currentAttr; >@@ -400,7 +403,7 @@ > * @param node - > * assumes not null > */ >- private String getURIString(Node node, IDocument document) { >+ private String getURIString(Node node, IDocument document, IRegion region) { > String resolvedURI = null; > // need the base location, publicId, and systemId for URIResolver > String baseLoc = null; >@@ -436,10 +439,37 @@ > else if ((XSI_NAMESPACE_URI.equals(DOMNamespaceHelper.getNamespaceURI(attrNode))) && (SCHEMA_LOCATION.equals(unprefixedName))) { > // for now just use the first pair > // need to look into being more precise >+ >+ //Being precise now >+ String attrText = ""; //$NON-NLS-1$ >+ int relativeOffset = -1; >+ if (node instanceof AttrImpl) { >+ relativeOffset = region.getOffset() - ((AttrImpl)node).getStartOffset(); >+ try { >+ attrText = document.get(((AttrImpl)node).getStartOffset(), ((AttrImpl)node).getLength()); >+ } catch (BadLocationException e) { >+ Logger.logException(e); >+ } >+ } > StringTokenizer st = new StringTokenizer(attrValue); >- publicId = st.hasMoreTokens() ? st.nextToken() : null; >- systemId = st.hasMoreTokens() ? st.nextToken() : null; >+ while (st.hasMoreElements()) { >+ publicId = st.hasMoreTokens() ? st.nextToken() : null; >+ systemId = st.hasMoreTokens() ? st.nextToken() : null; >+ int startOffset = -1; >+ int endOffset = -1; >+ if (publicId != null) { >+ startOffset = attrText.indexOf(publicId); >+ if (systemId != null) { >+ endOffset = attrText.indexOf(systemId) + systemId.length(); >+ } >+ else { >+ endOffset = attrText.indexOf(publicId) + publicId.length(); >+ } >+ } >+ if (startOffset <= relativeOffset && relativeOffset <= endOffset) >+ break; > // else check if xmlns publicId = value >+ } > } > else { > systemId = attrValue;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
nsand.dev
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 86507
:
130950
|
131530
| 183114