You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by David Duddleston <da...@i2a.com> on 2000/04/10 04:16:05 UTC

xml -> form -> xml form to xml code


I'm wondering if anyone has code that can take an XML doc with or without a
Schema and generate an HTML form. Then have code that will handle the post
and either create a new XML doc or update an existing one.

If nothing exists already, would anyone be interested if I made something
like this?

-david


RE: xml -> form -> xml form to xml code

Posted by Donald Ball <ba...@webslingerZ.com>.
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>david@i2a.com</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="david@i2a.com">
> </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>
</person>

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


RE: xml -> form -> xml form to xml code

Posted by Donald Ball <ba...@webslingerZ.com>.
Oh, whoops, responded to a response that wasn't in response to me. I'll be
going to bed here in a few. :) Hopefully my additional comments were
helpful anyway.

- donald

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>david@i2a.com</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="david@i2a.com">
> </form>
> 
> 
> 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?
> 
> -david
> 
> 
> 
> > -----Original Message-----
> > From: blur@localhost.localdomain [mailto:blur@localhost.localdomain]On
> > Behalf Of Laura Kruse
> > Sent: Sunday, April 09, 2000 7:51 PM
> > To: cocoon-users@xml.apache.org
> > Subject: Re: xml -> form -> xml form to xml code
> >
> >
> > David Duddleston wrote:
> > >
> > > I'm wondering if anyone has code that can take an XML doc with
> > or without a
> > > Schema and generate an HTML form. Then have code that will
> > handle the post
> > > and either create a new XML doc or update an existing one.
> > >
> > > If nothing exists already, would anyone be interested if I made
> > something
> > > like this?
> > >
> > > -david
> >
> > I don't know if this is what you meant exactly, but I have a xml
> > document that queries a database, makes a form to search the database
> > based on what's in the database.  Allows the user to select what the
> > want.  Send the selecting to a servlet that retuns xml to be parsed back
> > into html.
> >
> > Cheers,
> > 	Laura
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 


RE: xml -> form -> xml form to xml code

Posted by David Duddleston <da...@i2a.com>.
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>david@i2a.com</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="david@i2a.com">
</form>


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?

-david



> -----Original Message-----
> From: blur@localhost.localdomain [mailto:blur@localhost.localdomain]On
> Behalf Of Laura Kruse
> Sent: Sunday, April 09, 2000 7:51 PM
> To: cocoon-users@xml.apache.org
> Subject: Re: xml -> form -> xml form to xml code
>
>
> David Duddleston wrote:
> >
> > I'm wondering if anyone has code that can take an XML doc with
> or without a
> > Schema and generate an HTML form. Then have code that will
> handle the post
> > and either create a new XML doc or update an existing one.
> >
> > If nothing exists already, would anyone be interested if I made
> something
> > like this?
> >
> > -david
>
> I don't know if this is what you meant exactly, but I have a xml
> document that queries a database, makes a form to search the database
> based on what's in the database.  Allows the user to select what the
> want.  Send the selecting to a servlet that retuns xml to be parsed back
> into html.
>
> Cheers,
> 	Laura
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


Re: xml -> form -> xml form to xml code

Posted by Laura Kruse <lm...@cis.ksu.edu>.
David Duddleston wrote:
> 
> I'm wondering if anyone has code that can take an XML doc with or without a
> Schema and generate an HTML form. Then have code that will handle the post
> and either create a new XML doc or update an existing one.
> 
> If nothing exists already, would anyone be interested if I made something
> like this?
> 
> -david

I don't know if this is what you meant exactly, but I have a xml
document that queries a database, makes a form to search the database
based on what's in the database.  Allows the user to select what the
want.  Send the selecting to a servlet that retuns xml to be parsed back
into html.

Cheers,
	Laura

RE: xml -> form -> xml form to xml code

Posted by David Duddleston <da...@i2a.com>.
Donald, you have been a big help. We were probably writing emails at the
same time? I'm glad you relized that I was not responding to you, since what
you have is alot like what I just described ;-) Regardless, the extra info
should be helpful. I'll take a look at what you did.

Thanks again.

-david

> -----Original Message-----
> From: Donald Ball [mailto:balld@webslingerZ.com]
> Sent: Sunday, April 09, 2000 9:17 PM
> To: cocoon-users@xml.apache.org
> Subject: RE: xml -> form -> xml form to xml code
>
>
> On Sun, 9 Apr 2000, David Duddleston wrote:
>
> > Sounds like this could be what I'm looking for. I don't need
> anything real
> > fancy right now. Just something that will allow editing of basic XML
> > files... stuff that is not worth creating custom code for if
> you know what I
> > mean. I'll check it out.
> >
> > Thanks Donald.
>
> And just so you know - IBM, at least, had some "editor generator" java
> program on alphaworks a little while back that could take in a DTD or
> schema and produce a java program that would allow you to edit a document
> based on that schema. I could never make it work right, but it sounded
> interesting. My basic criticism of most XML editor and editor generators
> is that their UI is more akin to a file browser than a word processor or
> an HTML form. I like the HTML form approach because it's ubiquitous and it
> lets you offer a highly constrained editing experience.
>
> - donald
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


RE: xml -> form -> xml form to xml code

Posted by Donald Ball <ba...@webslingerZ.com>.
On Sun, 9 Apr 2000, David Duddleston wrote:

> Sounds like this could be what I'm looking for. I don't need anything real
> fancy right now. Just something that will allow editing of basic XML
> files... stuff that is not worth creating custom code for if you know what I
> mean. I'll check it out.
> 
> Thanks Donald.

And just so you know - IBM, at least, had some "editor generator" java
program on alphaworks a little while back that could take in a DTD or
schema and produce a java program that would allow you to edit a document
based on that schema. I could never make it work right, but it sounded
interesting. My basic criticism of most XML editor and editor generators
is that their UI is more akin to a file browser than a word processor or
an HTML form. I like the HTML form approach because it's ubiquitous and it
lets you offer a highly constrained editing experience.

- donald


RE: xml -> form -> xml form to xml code

Posted by David Duddleston <da...@i2a.com>.
Sounds like this could be what I'm looking for. I don't need anything real
fancy right now. Just something that will allow editing of basic XML
files... stuff that is not worth creating custom code for if you know what I
mean. I'll check it out.

Thanks Donald.

-david

> -----Original Message-----
> From: Donald Ball [mailto:balld@webslingerZ.com]
> Sent: Sunday, April 09, 2000 8:44 PM
> To: cocoon-users@xml.apache.org
> Subject: Re: xml -> form -> xml form to xml code
>
>
> On Sun, 9 Apr 2000, David Duddleston wrote:
>
> > I'm wondering if anyone has code that can take an XML doc with
> or without a
> > Schema and generate an HTML form. Then have code that will
> handle the post
> > and either create a new XML doc or update an existing one.
> >
> > If nothing exists already, would anyone be interested if I made
> something
> > like this?
>
> Yes, I have written something along these lines called XMLForm:
>
> http://www.webslingerZ.com/balld/xmlform/
>
> I haven't played with it in a while; Jeremy Quinn and I had been
> discussing ways to extend this more generically but I'm afraid I got tied
> up in actual billable work and haven't had a chance to revisit it in a
> while. The code's pretty solid. Some people feel there are security
> concerns with the approach, but my feeling is that it's no more dangerous,
> and likely less so, than letting people edit your XML content files by
> hand. Just don't open it up for the world to play with.
>
> I'm not likely to have the chance to do much else to this code for a
> while, so Jeremy, David, anyone - if you're interested in doing any
> development on or with the code, I'll be happy to check it into
> sourceforge or wherever. Jeremy had a nice thought about reworking the
> configuration - instead of forcing the author to write a form with
> specially named variables describing an XML structure, he was thinking
> that you reverse that, you could mark up a skeletal version of your XML
> with special tags that indicated how to generate a form to edit it. Matt
> Seargeant (the perl XML::Form author who inspired this work) also had some
> ideas about how he would like to revamp his perl module if you want to
> talk to him.
>
> - donald
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


Re: xml -> form -> xml form to xml code

Posted by Donald Ball <ba...@webslingerZ.com>.
On Sun, 9 Apr 2000, David Duddleston wrote:

> I'm wondering if anyone has code that can take an XML doc with or without a
> Schema and generate an HTML form. Then have code that will handle the post
> and either create a new XML doc or update an existing one.
> 
> If nothing exists already, would anyone be interested if I made something
> like this?

Yes, I have written something along these lines called XMLForm:

http://www.webslingerZ.com/balld/xmlform/

I haven't played with it in a while; Jeremy Quinn and I had been
discussing ways to extend this more generically but I'm afraid I got tied
up in actual billable work and haven't had a chance to revisit it in a
while. The code's pretty solid. Some people feel there are security
concerns with the approach, but my feeling is that it's no more dangerous,
and likely less so, than letting people edit your XML content files by
hand. Just don't open it up for the world to play with.

I'm not likely to have the chance to do much else to this code for a
while, so Jeremy, David, anyone - if you're interested in doing any
development on or with the code, I'll be happy to check it into
sourceforge or wherever. Jeremy had a nice thought about reworking the
configuration - instead of forcing the author to write a form with
specially named variables describing an XML structure, he was thinking
that you reverse that, you could mark up a skeletal version of your XML
with special tags that indicated how to generate a form to edit it. Matt
Seargeant (the perl XML::Form author who inspired this work) also had some
ideas about how he would like to revamp his perl module if you want to
talk to him.

- donald