cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: XSP problem
Date Mon, 22 May 2000 17:43:02 GMT
On Mon, 22 May 2000, Ulrich Mayring wrote:

> Donald Ball wrote:
> > 
> > Sorry, yeah, look in the /samples/xinclude directory in CVS. I'd meant to
> > check 'em in a while back. A zip is attached for those without CVS. Oh,
> > yeah, you'll need to edit your cocoon.properties file and add this line:
> 
> Ok, I got it. It looks like I can specify what to include with an XPath
> expression - this is of course pretty powerful and I see no reason why
> it shouldn't solve the SQL taglib connection data inclusion problem.
> 
> This has set me off on another track, however: As it stands the XInclude
> processor does half of what XMLForm does, i.e. I can specify an XPath
> expression and whatever it selects is sent to another XML document for
> further manipulation. For taking that data and putting it into edit
> fields on an HTML form I don't strictly need XMLForm, I can write a
> taglib for that. So there's just one piece of the puzzle missing and
> that's writing out the changed XML. Perhaps we'd need an XOutclude
> processor (yeah, stupid name, but there it is ;-)  This processor takes
> an XPath expression and writes what it selects to a new file. We don't
> need to replace data in an existing file, like XMLForm does, because
> with XOutclude and XInclude we could do everything we want:
> 
> <xoutclude:outclude parse="xml" href="newfoo.xml#xpointer(//message)">
> 	<xinclude:include parse="xml"
> href="tmpfoo.xml#xpointer(//message[id='3'])"/>
> 	<xinclude:include parse="xml"
> href="oldfoo.xml#xpointer(//message[not(id='3')])"/>
> </xoutclude:outclude>
> 
> This example means that the user changed the message with ID 3 and in
> the first step these changes are written to a tmpfoo.xml. In the example
> above you can see that from tmpfoo.xml it is selected and written to
> newfoo.xml, whereas all unchanged messages (those with ID != 3) are
> taken from oldfoo.xml and added to newfoo.xml. We could add another
> option to rename newfoo.xml to oldfoo.xml at the end.
> 
> Perhaps the whole thing could also be encapsulated in a taglib and use
> xinclude/xoutclude only internally.

Hmm. Logically speaking, your idea makes perfect sense, though I wonder
how efficient an XML file editor that worked like this would be... don't
care too much, myself, i'm more interested in working code than efficient
code. I wonder how this would tie into Jeremy's form taglib stuff...

- donald


Mime
View raw message