I am making application in Rails 3 in which I am parsing XML file and I
want to store one of the XML tag in XML format into Mysql database. I
have used 'TEXT' as a datatype to store XML formatted data.
I am getting the XML format Tag data but when I store it into database I
am getting an error.
Can any one please help me that how can I store XML data into database?
Have you used ruby-debug to break into the code here and see what
tag.children[9] looks like? Have a look at the Rails Guide on
debugging to see how to do this.
I am getting the whole XML Tag. But this tag is not saving into the
database. It is saving like '--0 \n'. Is there any problem with my model
or Datatype into the database??
I am getting the whole XML Tag. But this tag is not saving into the
database. It is saving like '--0 \n'. Is there any problem with my model
or Datatype into the database??
I think you'll find that tag.children[9] is just an object
representing the node, which doesn't have much meaning without the
document it belongs to. You need to call something like to_s or to_xml
on it to turn it back into a string