2002/css-validator/org/w3c/css/css DocumentParser.java,1.3,1.4

Update of /sources/public/2002/css-validator/org/w3c/css/css
In directory hutz:/tmp/cvs-serv31107

Modified Files:
	DocumentParser.java 
Log Message:
added support for wap...

Index: DocumentParser.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/DocumentParser.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- DocumentParser.java	10 Dec 2008 15:25:51 -0000	1.3
+++ DocumentParser.java	18 Feb 2010 18:02:48 -0000	1.4
@@ -7,23 +7,31 @@
 
 package org.w3c.css.css;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLConnection;
-
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.HTTPURL;
 import org.w3c.css.util.Util;
-
 import org.w3c.www.mime.MimeType;
 import org.w3c.www.mime.MimeTypeFormatException;
 
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+
 /**
  * @version $Revision$
  */
 public final class DocumentParser {
 
+    public static MimeType wap;
+
+    static {
+        try {
+        wap = new MimeType("application/vnd.wap.xhtml+xml");
+        } catch (MimeTypeFormatException mex) {
+            wap = null;
+        }
+    }
+
     private StyleSheet style;
     private URL htmlURL;
     private Exception exception;
@@ -112,7 +120,8 @@
 		    parser.parseURL(ac, htmlURL, null, null, media, StyleSheetOrigin.AUTHOR);
 		    style = parser.getStyleSheet();
 		} else if ((contentType.match(MimeType.TEXT_XML) == MimeType.MATCH_SPECIFIC_SUBTYPE)
-			   || (contentType.match(MimeType.APPLICATION_XHTML_XML) == MimeType.MATCH_SPECIFIC_SUBTYPE)) {
+			   || (contentType.match(MimeType.APPLICATION_XHTML_XML) == MimeType.MATCH_SPECIFIC_SUBTYPE)
+                || (contentType.match(wap) == MimeType.MATCH_SPECIFIC_SUBTYPE)) {
 		    // TagSoup ?
 		    XMLStyleSheetHandler handler = new XMLStyleSheetHandler(htmlURL, ac);
 		    handler.parse(urlString, connection);

Received on Thursday, 18 February 2010 18:02:52 UTC