Class2XML conversion

static void Class2XML(Args _args)

{

TreeNode    treeNode = TreeNode::findNode(@’ClassesabValidation’);

TreeNode    childNode;

str nodename, code;

int  counter=1;

Boolean     foundObject;

XMLDocument xmlDoc;

XMLTextWriter xw;

;

xw = XMLTextWriter::newFile(“c:\abValidation.xml”);

//pass treeNode.AOTname() name to create a xml with the class name xw.writeStartDocument();

if (treeNode)

{

xw.writeStartElement(treeNode.AOTname());

childNode = treeNode.AOTfirstChild();

while(counter <= treeNode.AOTchildNodeCount())

{

nodename = “”;

if(childNode)

{

nodename = childNode.treeNodeName();

if(childNode.treeNodeName())

{

xw.writeStartElement(nodename);

xw.writeElementString(“Data”,childNode.AOTgetSource());

xw.writeEndElement();

}

}

childNode = childNode.AOTnextSibling(); counter++;

}

xw.writeEndElement();

xw.writeEndDocument();

xw.close();

}

Box::info(“Xml Created Successfully”);

}

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: