You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by el...@apache.org on 2002/09/04 21:02:05 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/dom DOMImplementationSourceImpl.java
elena 2002/09/04 12:02:05
Modified: java/src/org/apache/xerces/dom
DOMImplementationSourceImpl.java
Log:
Patch: the current version in the Apache repository does not support request
such as "XML 2.0 LS-Load 3.0".
Submitted by: Philippe Le Hegaret
Applied by: Elena Litani
Revision Changes Path
1.7 +37 -6 xml-xerces/java/src/org/apache/xerces/dom/DOMImplementationSourceImpl.java
Index: DOMImplementationSourceImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DOMImplementationSourceImpl.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DOMImplementationSourceImpl.java 23 Aug 2002 20:14:38 -0000 1.6
+++ DOMImplementationSourceImpl.java 4 Sep 2002 19:02:05 -0000 1.7
@@ -108,12 +108,43 @@
}
boolean testImpl(DOMImplementation impl, String features) {
+
StringTokenizer st = new StringTokenizer(features);
- while (st.hasMoreTokens()) {
- String feature = st.nextToken();
- if (!impl.hasFeature(feature, null)) {
- return false;
- }
+ String feature = null;
+ String version = null;
+
+ if (st.hasMoreTokens()) {
+ feature = st.nextToken();
+ }
+ while (feature != null) {
+ boolean isVersion = false;
+ if (st.hasMoreTokens()) {
+ char c;
+ version = st.nextToken();
+ c = version.charAt(0);
+ switch (c) {
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ isVersion = true;
+ }
+ } else {
+ version = null;
+ }
+ if (isVersion) {
+ if (!impl.hasFeature(feature, version)) {
+ return false;
+ }
+ if (st.hasMoreTokens()) {
+ feature = st.nextToken();
+ } else {
+ feature = null;
+ }
+ } else {
+ if (!impl.hasFeature(feature, null)) {
+ return false;
+ }
+ feature = version;
+ }
}
return true;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org