[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 WebServic


org.relaxng.datatype jar

> 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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.