Is there any method in jaxb to read the xml tags dynamically.For example i have two xml files both have diffrent tagnames and attributes.I want to read these two xml files using a single method.I don want to use getelementByTagname and all.All i need to read the xml tags dynamically.Does JAXB support this or there is any other concepts which can do this.Thanks in advance
Share
You can create a single
JAXBContextthat represents multiple models. As long as the root objects are annotated with@XmlRootElement(or@XmlElementDecl) then your JAXB (JSR-222) implementation will instantiate the correct objects based on the XML input.