File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javascript library which can convert html form to an xml ?

 
Edward Chen
Ranch Hand
Posts: 798
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to use DWR to work on a html form. Do we have any javascript library which can convert html form elements/values to an xml ?

Thanks.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What, specifically, are you trying to do? It's unusual you'd need to do this.
 
Bart Stanz
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean taking form output and saving it as an xml file?
 
Edward Chen
Ranch Hand
Posts: 798
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:What, specifically, are you trying to do? It's unusual you'd need to do this.


Using DWR Ajax to call server, I want to send xml in and get xml out. so I need to get user form input and convert it into xml. I did some research, found XForm will achieve this, but XForm is not that much supported in browser. Do we have a javascript library, like JQuery.., to convert this ?

Thanks.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reason you do not send up a normal form submission to the server?

Eric
 
Edward Chen
Ranch Hand
Posts: 798
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric Pascarello wrote:Reason you do not send up a normal form submission to the server?


to achieve a kind of SOA, decouple UI from server, in the service side, we use XML-in-and-XML-out, then we will have no any pain to develop a desktop UI.

My design is like this, service side accept XML in, then use XStream map to Object, finish business logic, use XStream decode Object to XML and return it to user. In html client, we use DWR to call this service, In Desktop client, use web service to call service.

Usually we can easily get user form input in JSon format, but this is not XML, then in service side, I have to use another convert...
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.docunext.com/blog/2009/01/convert-form-data-to-xml-with-jquery.html

Although really I'd do this on the server side by making JSON and XML request handlers (and HTML as well, in case the client has JavaScript turned off).
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with David, if you need to do the XML, that means your users will have to have JavaScript enabled.

I still think that it should be done on the server, seems logical to me to do it there.

How are you going to do the validation and such with the server? Seems like you are making more work to make it simplifier to make a client app.

You can look at stuff like http://xmljs.sourceforge.net/, but it would be a lot easier to just build it yourself.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic