changeset 10:c5a4aa5067af

~ implement a pseudo catalog
author Alexandre Bertails <bertails@w3.org>
date Sat, 27 Feb 2010 02:35:12 -0500
parents e78e1c992f1c
children 4438cf9210c6
files dtds/catalog.xml project/build/Project.scala
diffstat 2 files changed, 14 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/dtds/catalog.xml	Fri Feb 26 18:49:59 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE catalog PUBLIC "-//GlobalTransCorp//DTD XML Catalogs V1.0-Based Extension V1.0//EN"
-    "http://globaltranscorp.org/oasis/catalog/xml/tr9401.dtd">
-
-<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
-         xmlns:soc="urn:oasis:names:tc:entity:xmlns:tr9401:catalog"
-         xmlns:unk="urn:oasis:names:tc:entity:xmlns:unknown"
-         >
-<group prefer="public">
-<!-- Oasis entity catalog for Extensible HTML 1.0 -->
-<public publicId="-//W3C//DTD XHTML 1.0 Strict//EN" uri="xhtml1-strict.dtd"/>
-<soc:dtddecl publicId="-//W3C//DTD XHTML 1.0 Strict//EN" uri="xhtml1.dcl"/>
-<!--public publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" uri="xhtml1-transitional.dtd"/>
-<soc:dtddecl publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" uri="xhtml1.dcl"/>
-<public publicId="-//W3C//DTD XHTML 1.0 Frameset//EN" uri="xhtml1-frameset.dtd"/>
-<soc:dtddecl publicId="-//W3C//DTD XHTML 1.0 Frameset//EN" uri="xhtml1.dcl"/-->
-<!-- ISO latin 1 entity set for Extensible HTML (XML 1.0 format) -->
-<!-- The entities are stored in another directory -->
-<!-- PUBLIC	"-//W3C//ENTITIES Latin 1 for XHTML//EN" "xhtml-lat1.ent" -->
-<!-- PUBLIC	"-//W3C//ENTITIES Symbols for XHTML//EN" "xhtml-symbol.ent" -->
-<!-- PUBLIC	"-//W3C//ENTITIES Special for XHTML//EN" "xhtml-special.ent" -->
-<!-- Replaced by the DTDDECL above -->
-<!-- SGMLDECL "xhtml1.dcl" -->
-</group>
-</catalog>
--- a/project/build/Project.scala	Fri Feb 26 18:49:59 2010 -0500
+++ b/project/build/Project.scala	Sat Feb 27 02:35:12 2010 -0500
@@ -2,6 +2,20 @@
 
 class Project(info: ProjectInfo) extends DefaultProject(info) {
 
+  import java.net._
+  import java.io._
+  case class MyResponseCache() extends ResponseCache {
+    def get(uri:URI, rqstMethod:String, rqstHeaders:java.util.Map[java.lang.String,java.util.List[java.lang.String]]) =
+      if ("http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" == uri.toString)
+	new CacheResponse {
+          def getBody() = new FileInputStream(new File("dtds/xhtml1-strict.dtd"))
+          def getHeaders() = null
+	}
+      else null
+    def put(uri:URI, conn:URLConnection) = null
+  }
+  ResponseCache.setDefault(MyResponseCache())
+
   val scalatools = "scala-tools" at "http://scala-tools.org/repo-snapshots"
   val smackRepo = "m2-repository-smack" at "http://maven.reucon.com/public"
   val databinder_net = "databinder.net repository" at "http://databinder.net/repo"
Set up and maintained by W3C Systems Team, please report bugs to sysreq@w3.org.

W3C would like to thank Microsoft who donated the server that allows us to run this service.