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 124978 Details for
Bug 263976
[content type] XMLRootElementContentDescriber2 need support for schema version
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed patch against HEAD to support contentType version
contentTypeVersion.txt (text/plain), 4.60 KB, created by
Karen Butzke
on 2009-02-06 12:11:25 EST
(
hide
)
Description:
proposed patch against HEAD to support contentType version
Filename:
MIME Type:
Creator:
Karen Butzke
Created:
2009-02-06 12:11:25 EST
Size:
4.60 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.contenttype >Index: src/org/eclipse/core/internal/content/XMLRootHandler.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/XMLRootHandler.java,v >retrieving revision 1.4 >diff -u -r1.4 XMLRootHandler.java >--- src/org/eclipse/core/internal/content/XMLRootHandler.java 1 Feb 2008 15:23:28 -0000 1.4 >+++ src/org/eclipse/core/internal/content/XMLRootHandler.java 6 Feb 2009 17:09:33 -0000 >@@ -72,6 +72,8 @@ > * successful to the point of finding the top-level element. > */ > private String namespaceFound = null; >+ >+ private String versionFound = null; > > public XMLRootHandler(boolean checkRoot) { > this.checkRoot = checkRoot; >@@ -162,6 +164,11 @@ > return namespaceFound; > } > >+ public String getVersion() { >+ return this.versionFound; >+ } >+ >+ > public boolean parseContents(InputSource contents) throws IOException, ParserConfigurationException, SAXException { > // Parse the file into we have what we need (or an error occurs). > try { >@@ -219,6 +226,7 @@ > public final void startElement(final String uri, final String elementName, final String qualifiedName, final Attributes attributes) throws SAXException { > elementFound = elementName; > namespaceFound = uri; >+ versionFound = attributes.getValue("version"); > throw new StopParsingException(); > } > >Index: src/org/eclipse/core/runtime/content/XMLRootElementContentDescriber2.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.contenttype/src/org/eclipse/core/runtime/content/XMLRootElementContentDescriber2.java,v >retrieving revision 1.1 >diff -u -r1.1 XMLRootElementContentDescriber2.java >--- src/org/eclipse/core/runtime/content/XMLRootElementContentDescriber2.java 1 Feb 2008 15:23:28 -0000 1.1 >+++ src/org/eclipse/core/runtime/content/XMLRootElementContentDescriber2.java 6 Feb 2009 17:09:33 -0000 >@@ -32,7 +32,7 @@ > * </p> > * <p> > * The value of "element" is specified using such a format >- * <code>{namespace}name/dtd</code>. The namespace or dtd part >+ * <code>{namespace}name/dtd:version</code>. The namespace or dtd part > * can be omitted and accepted are values like <code>name/dtd</code>, > * <code>{ns}name</code> and <code>name</code>. > * </p> >@@ -81,11 +81,13 @@ > private String namespace; > private String element; > private String dtd; >+ private String version; > >- public QualifiedElement(String namespace, String element, String dtd) { >+ public QualifiedElement(String namespace, String element, String dtd, String version) { > this.namespace = namespace; > this.element = element; > this.dtd = dtd; >+ this.version = version; > } > > public QualifiedElement(String qualifiedElement) { >@@ -102,6 +104,12 @@ > dtd = qualifiedElement.substring(dtdSlash+1); > qualifiedElement = qualifiedElement.substring(0, dtdSlash); > } >+ // Extract version part >+ int versionSlash = qualifiedElement.indexOf(':'); >+ if (versionSlash > 0) { >+ version = qualifiedElement.substring(versionSlash + 1); >+ qualifiedElement = qualifiedElement.substring(0, versionSlash); >+ } > // Check if the name is a wildcard > element = ("*".equals(qualifiedElement) ? null : qualifiedElement); > } >@@ -117,11 +125,16 @@ > return dtd; > } > >- public boolean matches(String someNamespace, String someElement, String someDtd) { >+ public String getVersion() { >+ return version; >+ } >+ >+ public boolean matches(String someNamespace, String someElement, String someDtd, String someVersion) { > boolean nsMatch = this.namespace != null ? this.namespace.equals(someNamespace) : true; > boolean elementEquals = this.element != null ? this.element.equals(someElement) : true; > boolean dtdEquals = this.dtd != null ? this.dtd.equals(someDtd) : true; >- return nsMatch && elementEquals && dtdEquals; >+ boolean versionEquals = this.version != null ? this.version.equals(someVersion) : true; >+ return nsMatch && elementEquals && dtdEquals && versionEquals; > } > } > >@@ -154,7 +167,7 @@ > if (elementsToFind != null) { > boolean foundOne = false; > for (int i = 0; i < elementsToFind.length && !foundOne; ++i) { >- foundOne |= elementsToFind[i].matches(xmlHandler.getRootNamespace(), xmlHandler.getRootName(), xmlHandler.getDTD()); >+ foundOne |= elementsToFind[i].matches(xmlHandler.getRootNamespace(), xmlHandler.getRootName(), xmlHandler.getDTD(), xmlHandler.getVersion()); > } > if (!foundOne) > return INDETERMINATE;
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
Actions:
View
|
Diff
Attachments on
bug 263976
: 124978