XML : Java generate xml from multiple beans

I am trying to generate a xml file using java beans. Used JAXB to generate the xml:- LinkedHashMap consultantMap=generateXML();

              JAXBConverter jaxbConverter = new JAXBConverter();                context = JAXBContext.newInstance(Consultant.class);                String xmlStringData = jaxbConverter.pojo2Xml(consultantMap.get("220626"), context);                System.out.println("\nPOJO to XML conversion(Marshal) demonstration in Java");                System.out.println(xmlStringData);    

I am getting the xsl properly. But I have one another bean call ShowBean into picture with which we decide which fields from Consultant Bean should go into XSL. so in XSL we have some IF conditions based on that another Bean ShowBean.The XMl should have value for that bean also.I tried searching how can i send the ShowBean to JAXB but not getting any way. Thank you in advance for help and suggestions.

No comments:

Post a Comment