[Rails] Re: Rails magic for MySQL -> XML file -> MySQL and back agai

Tony Martin tonypmartin at hotmail.com
Tue Aug 8 20:03:26 GMT 2006


Bill,

  this thread seems to have stopped, but I wonder how far you got with your
application.  I have  been googling for some time now and the information on
handling xml files in rails is sparse.  (To be fair, rails is aimed at
database apps.) .

  I wanted to do something very much along the same lines, although not
quite so complex as your requirement.  After entering data into tables, I
want to save the summary (an order with customer detailsm and order
information) in fairly simple xml format on the (intanet) server where it
can be separately accessed as required.  Then I want to allow the user to
reload the xml file at a later date, be able to modify it and save it back. 

  If you had any helpful examples, I would be most grateful.  I am not an
xml or xslt expert, but I need to grapple with this.  I have done some xml
file handling/editing in php, but managing something similar from rails does
not seem to be quite so obvious. 

Once I have my xml file, I thought I could build an xslt to allow it to be
later viewed in a browser.  And I am also thinking towards providing the
ability to import it into  OpenOffice for off line editing.

I would be grateful for any useful links or advice you might be able to
offer.  

Tony



Bill Walton wrote:
> 
> Hi Danny,
> 
> Danny Malone wrote:
>> Bill Walton wrote:
>>
>>> My little app collects data from the user, persists it in about a dozen
>>> tables during the session, writes out / saves an XML file that's
>>> downloaded to the user's PC when they're done, then clears the db of all
>>> data entered, and deletes the XML file from the server.
>>>
>>> Now I need to allow the user to upload the same XML file they created
>>> earlier and put it back in the database so that, using the same app they
>>> used to create it, they can edit / update it and save / download it to
>>> their PC again.
>>>
>>> Can somebody point me in the right direction here, please?  What's the
>>> Rails way of approaching this?  Is there some way to 'bind' (don't know
>>> if that's the right word here) the XML file to the db?  Some Rails
>>> magic, maybe?
>>
>> Not to sure of Rails magic but you could use an xslt stylesheet to
>> transformt he xml into an sql insert query then run that to populate the
>> db.
> 
> Thanks for the suggestion!  Any example / tutorial links you could point
> me 
> to?
> 
> Best regards,
> Bill 
> 
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
> 
> 
-- 
View this message in context: http://www.nabble.com/Rails-magic-for-MySQL--%3E-XML-file--%3E-MySQL-and-back-again----tf1522315.html#a5713999
Sent from the RubyOnRails Users forum at Nabble.com.



More information about the Rails mailing list