Xml2Class Conversion

static void Xml2Class(Args _args)

{

#define.paramsNode(“abValidation”)

XmlDocument xmlDoc;

XmlElement xmlRoot;

XmlElement xmlField;

XmlElement xmlRecord;

XmlNodeList xmlRecordList;

XmlNodeList xmlFieldList;

ClassBuild  classBuild;

DictClass   dictClass;

int i, j;

;

xmlDoc = new XmlDocument(); xmlDoc.load(@”c:\abValidation.xml”); xmlRoot = xmlDoc.getNamedElement(#paramsNode); xmlRecordList = xmlRoot.childNodes(); classBuild = new ClassBuild(“abValidation_demo”, false);

for (i=0; i<xmlRecordList.length(); i++)

{

xmlRecord = xmlRecordList.item(i);

xmlFieldList = xmlRecord.childNodes();

for (j=0; j<xmlFieldList.length(); j++)

{

xmlField = xmlFieldList.item(j);

classBuild.addMethod(xmlRecord.baseName(),xmlField.innerText());

}

}

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: