On Sun, 2 Sep 2001 20:49, Paul Hammant wrote:
> Peter Donald wrote:
> >I was thinking about something as simple as current setup.
> >
> >ie
> >
> >vois storeConfiguration( String application,
> >                         String block,
> >                         Configuration config );
>
> Hmm, that forced the comp writer to have some way of constructing an
> tree of Configuration objects themselves.  I'd guess getting it right is
> a high art and buckets of code.  Though there are good points raised
> about reliance on Xpath and it's implicit underlying XML document, I
> think it's a simple think for component writers to use.

Well we could always add a helper class. Something like

MutableConfiguration config = ConfigurationHelper.clone( readOnlyConfig );
ConfigurationHelper.set( "client-connections/[EMAIL PROTECTED]'ssl']/@auth",
                         "true" );
repo.storeConfiguration( myApp, "connections", config );


This would be simplified if we used something like the recent XPath APIs in 
commons or on sourceforge. Some of them work on multiple doc types (ie 
DOM/JDOM/DOM4J/JavaBeans). Look for jxpath in commons I think.

Re: dom4j license issues. 
Ask the author (who is also a member of commons-dev IIRC) and I am sure they 
would be willing to help fix whatever needs doing.

-- 
Cheers,

Pete

*-----------------------------------------------------*
| Never argue with an idiot, they'll drag you down to |
| their level, and beat you with experience           |
*-----------------------------------------------------*

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to