Load XML file

71 views
Skip to first unread message

Sathish Venkatesh

unread,
Feb 23, 2012, 12:31:07 AM2/23/12
to Rhino Tools Dev
Can you please send some samples or code snippet or documentation or
articles to load XML file ?

So far I came across only text and csv files.

Jason Meckley

unread,
Feb 24, 2012, 5:22:06 PM2/24/12
to rhino-t...@googlegroups.com
care to elaborate? I can only assume you are talking about ETL. if that's that case then there aren' any built in helpers for xml. however you can easily build your Row objects using an XmlReader and XPath.

sathish venkatesh

unread,
Feb 24, 2012, 5:38:13 PM2/24/12
to rhino-t...@googlegroups.com
"
XML file with 5 different nodes with data in it. Now, Extract this XML data, Transform - compare with a DB table (using key column) and Load - put the data to another DB table(s).
" - requirement
 
At the moment, ETL the text file works fine. But my doubt is, will the same model support XML ETL (if so, thats when I was requesting some samples \ docs....)
 
But what you are suggesting, is something like the below ?
 
public
override IEnumerable<Row> Execute(IEnumerable<Row> rows)
{
    using (FileEngine file = FluentFile.For<BusinessEntity>().From("C:\datawithnodes.xml"))
    /*instead of this, have custom XmlReader + Xpath to map the data to Entity, and return the Row obj - ?*/
    {
       foreach (object obj in file)
      {
            yield return Row.FromObject(obj);
       }
    }
}
-Sathish
From: Jason Meckley <jasonm...@gmail.com>
To: rhino-t...@googlegroups.com
Sent: Friday, February 24, 2012 5:22 PM
Subject: [rhino-tools-dev] Re: Load XML file

--
You received this message because you are subscribed to the Google Groups "Rhino Tools Dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rhino-tools-dev/-/kTh7oG1ni-UJ.
To post to this group, send email to rhino-t...@googlegroups.com.
To unsubscribe from this group, send email to rhino-tools-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rhino-tools-dev?hl=en.


Reply all
Reply to author
Forward
0 new messages