cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <>
Subject RE: xml -> form -> xml form to xml code
Date Mon, 10 Apr 2000 04:12:03 GMT
On Sun, 9 Apr 2000, David Duddleston wrote:

> What you have sounds cool, but is not exactly what I'm looking for. Here a
> simple example.
> You have some xml data
> <person id="1">
> 	<name>david</name>
> 	<email></email>
> </person>
> some code would convert this to an html form... could be java code, XSL or
> both.
> <html>
> <body>
> <form action="fromToXMLServlet" metho="post">
> 	<input type="text" name="/person/@id" value="1">
> 	<input type="text" name="/person/name" value="david">
> 	<input type="text" name="/person/email" value="">
> </form>

That's the innovation that Jeremy was hip on. You'd have to markup your
original XML in some fashion:

<person id="xmlform:variable" xmlform:datatype="integer">
 <name><xmlform:variable datatype="string"/></name>
 <email>xmlform:variable datatype="email"/></email>

So that the form generator program would have _something_ to work with. I
think that's probably a really nifty approach, but I don't have the time
to write it. Everything else you want, I think XMLForm could do.

> It would post to a Servlet or something that could parse the form data and
> create a new XML doc or update an existing one... probably against a Schema
> or DTD. The form elements would have to contain a formated name so that the
> form parser could match up the parameters values and place it in the right
> XML elements/attributes. Somthing like a path might work <input type="text"
> name="person/name" value="david">
> OK, this is a simple explanation, but you get the idea?

Sure. XMLForm lets you specfiy an XPath expression that points to the
location in the existing XML file that the new fragment should be put. It
can either append the new node after the specified node or replace it (and
maybe some other ops as well, I can't remember).

- donald

View raw message