OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RDDL] API Suggestions



A useful extension to the RDDL API would be a means 
to retrieve Java implementation classes suitable for 
processing a particular document.

Use case:

Imagine a situation were we're parsing an XHTML document 
containing SVG elements. We want to build a DOM tree 
for the document, but want to use SVG DOM specific 
classes if available, otherwise defaulting to a standard 
DOM impl.

Suggestion:

1. Have a network class loader for retrieving the appropriate 
JAR files from the network, the key for this could be a 
startPrefixMapping callback during a SAX2 parse.

2. Instantiate a factory class ready to create appropriate 
objects from the parsed elements.

3. Invoke the factory during the parse, resulting in construction 
of the DOM.

This seems to mandate a class loader integrated with a XMLFilter; 
a factory framework for instantiating objects during parse; and a  
'well-known' factory implementation associated with each JAR 
(e.g. using a naming convention).

I'm generally thinking of cases where we want to be able to attempt 
some kind of processing on XML documents, even if we've never 
encountered them before. e.g. the fabled XML browser.

Thoughts?

L.

-- 
Leigh Dodds, Systems Architect       | "Pluralitas non est ponenda
http://weblogs.userland.com/eclectic |    sine necessitate"
http://www.xml.com/pub/xmldeviant    |     -- William of Ockham