PDA

Click to See Complete Forum and Search --> : Creating XSD of an XML file programmatically


bnathvbdotnet
May 22nd, 2007, 04:35 PM
Howdy,

I have an xml document.

The idea is to read the content of the xml document into an oracle table.

The approach I took was to basically create an xsd document for the xml file (dont' know how to do programmatically). I was able to create xsd file using visual studio 2005.
And read the xml content. I used the following lines of code . but I would like to be able to create the xsd document programmatically.

code:
string aCashFlowsXmlFilePath = ConfigHelper.CashFlowsXmlFilePath;

//how can I create the xsd file programmatically?
string aCashFlowsXsdFilePath = ConfigHelper.CashFlowsXsdFilePath;

DataTable aDataTableCashFlows = BuildDataTableCashFlows();

DataSet aDatasetCashFlows = new DataSet();
aDatasetCashFlows.ReadXml(aCashFlowsXmlFilePath);
aDatasetCashFlows.ReadXmlSchema(aCashFlowsXsdFilePath);

DataRow[] cfDataRows;

foreach (DataRow dataRow in aDatasetCashFlows.Tables["CashFlows"].Rows)
{
cfDataRows = dataRow.GetChildRows("CashFlows_CF");

bool monthsalreadyset = false;
double months =0;

foreach (DataRow adataRowCF in cfDataRows)
{

}
}