[
Lists Home |
Date Index |
Thread Index
]
- To: "James Clark" <jjc@jclark.com>
- Subject: RE: [xml-dev] Bolt-in Type Systems (RE: [xml-dev] Relax NG and Web Services (formerly Joining the church))
- From: "Dare Obasanjo" <dareo@microsoft.com>
- Date: Fri, 11 Jul 2003 20:46:00 -0700
- Cc: "Bullard, Claude L \(Len\)" <clbullar@ingr.com>,<xml-dev@lists.xml.org>
- Thread-index: AcNIHl03DWx2qiYoSWm4EmIfW50ZnAABzIgP
- Thread-topic: [xml-dev] Bolt-in Type Systems (RE: [xml-dev] Relax NG and Web Services (formerly Joining the church))
I'm not sure what you are asking for. If you want a standard place where classes can be registered and discovered by applications there's the Global Assembly Cache (GAC)[0]. If you are asking about a place to store configuration information that is visible to .NET Framework applications there are various standard configuration files[1].
It seems what you are asking for is a way to enumerate all the assemblies on a particular machine and query each for a particular resource file. I'd prefer using a config file for this or maybe even the registry.
[0] http://msdn.microsoft.com/library/en-us/cpguide/html/cpconglobalassemblycache.asp
[1] http://msdn.microsoft.com/library/en-us/cpguide/html/cpconconfigurationfiles.asp
________________________________
From: James Clark [mailto:jjc@jclark.com]
Sent: Fri 7/11/2003 7:35 PM
To: Dare Obasanjo
Cc: Bullard, Claude L (Len); xml-dev@lists.xml.org
Subject: Re: [xml-dev] Bolt-in Type Systems (RE: [xml-dev] Relax NG and Web Services (formerly Joining the church))
> 2.) A RELAX NG can dynamically learn how to validate a type library by
> dereferencing the namespace URI. I've heard there are Java interfaces
> type library authors can implement so arbitrary RELAX NG validators can
> support them. In this case there should be no problem as long as the
dataype
> library is discoverable and implements the correct interfaces.
It doesn't actually dereference the namespace URI in the sense of
retrieving it. The way it works is:
- There's an (unofficial) standard API that provides an interface
org.relaxng.datatype.DatatypeLibraryFactory; this has a method
createDatatypeLibrary(x) that says "give me an implementation of the
datatypeLibrary with URI x", which may succeed or fail.
- An implementation must provide a class that implements this interface.
Let's suppose it's com.example.MyDatatypeLibraryFactory. The class files
must be collected into a jar file and the jar file must also contain a
text file META-INF/services/org.relaxng.datatype.DatatypeLibraryFactory
which contains a single line "com.example.MyDatatypeLibraryFactory".
- Users must put the jar files for the datatype libraries they want to
use on their classpath.
- When a validator encounters a schema that uses datatype library with
URI X, it reads the files on its classpath called
META-INF/services/org.relaxng.datatype.DatatypeLibraryFactory to
discover the names of the implementing classes. It then instantiates
each in turn calling its createDatatypeLibrary method until it finds one
that can provide an implementation of the required datatype library.
This is a pretty standard pattern in the Java world. How would you do
this sort of thing in .NET?
It doesn't support automatic downloading of datatype library
implementations. I guess you do this by allowing the namespace URI to
point to an RDDL document that somehow identifies the JAR file providing
the implementation, download that and then run it in a sandbox. As far
as I know, no implementations yet support this sort of thing.
James
|