[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Bolt-in Type Systems (RE: Relax NG and Web Servi
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@j...] Sent: Fri 7/11/2003 7:35 PM To: Dare Obasanjo Cc: Bullard, Claude L (Len); xml-dev@l... Subject: Re: Bolt-in Type Systems (RE: 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|