How to convert XML(attributes) file into a java(classes) file -


i want write java code read input xml file , generate equivalent java code.

enter code here  <codemarkers classname="codegenerator" access="public">  <methodmarker javadoc="compares 2 strings" name="stringcomparator" access="private" static="no" return="boolean">     <input name="str1" notnull="true"/>     <input name="str2" notnull="false"/>     <methodvariable name="success" type="boolean" initvalue="false"/>     <javacode>         <![cdata[         system.out.println("executing comparator");         if (str1.equals(str2)) success = boolean.true;         return success;         ]]>     </javacode> </methodmarker>  <methodmarker javadoc="database employee id" name="getemployeeid" access="public" static="yes" return="int">     <input name="employeename" notnull="true"/>     <methodvariable name="empid" type="int"/>     <dbinit>         <sqlcode>             <![cdata[             empid = select emp_id test.employee emp_id = empid;             return empid;             ]]>         </sqlcode>     </dbinit> </methodmarker> 

i need write java code convert above xml code java code ie
first line of output java code should public class codegenerator{}

enter code here                   <![cdata[             empid = select emp_id test.employee emp_id = empid;             return empid;             ]]> 

im not able put lines under cdata should used in method

thanks athreya

q2: "how data under < ![cdata][...]]"

for retriveing character data (cdata) this,

import org.w3c.dom.element;

 public static string getcharacterdatafromelement(element e) {     node child = e.getfirstchild();     if (child instanceof characterdata) {       characterdata cd = (characterdata) child;       return cd.getdata();     }     return "";   }  

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -