You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by Aleksander Slominski <as...@cs.indiana.edu> on 2004/04/29 02:30:20 UTC

SPI API for XmlBeans views ...

Eric Vasilik wrote:

>>so it seems what i need is v2. how easy will be to add a new view on
>>    
>>
>the
>  
>
>>store such as XML Infoset? or is it hardcoded to those three views?
>>    
>>
>
>One could, in theory, 
>
yes but in practice ... as they say nothing is more practical than good 
theory :)

>add new views by implementing them on top of the
>existing views, but the overhead of doing so would probably not be worth
>it.
>  
>
still i could not do "instanceof" check right as XmlBeans impl objects 
would not implement those interfaces?

so this would be an architectural choice to now allow it?

>>how will you be able to switch between different views i.e. in case
>>    
>>
>when
>  
>
>>i have DOM Element how i can find XmlObject view on it? can i
>>dynamically for an unbound DOM element bound it (convert) to XML
>>    
>>
>Schema
>  
>
>>derived Foo type? in other words can i start with DOM (Infoset?) and
>>rebind parts of it to XmlBeans?
>>    
>>
>
>Yes, as long as the DOM element is one which I created.  If you want to
>take, for example, a Xerces DOM element and get an XmlObject on it, you
>would have to import that element.  However, I will provide ways to
>convert among the various views with out additional overhead.
>  
>
why not provide an SPI (Service Provider Interface) API that could be 
used to plugin different XML APIs (as extension to code generator)?

in Java there is plenty XML APIs that are (maybe) more popular and 
*definitely* easier to use in Java than DOM such as DOM4J (this one is 
interface based so it should be particularly easy to ).

DOM would be just one standard plugin. there are also other APIs like 
SDO ... and as we know there is no one DOM anyway as we have now DOM1, 
DOM2, and DOM3 ...

just a thought,

alek

-- 
The best way to predict the future is to invent it - Alan Kay


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/