Hi,
I have 7 different XSD schemas and have sucessfully created the Java classes using xjc. When I give an XML to the unmarshaller in order to get the instance of the objects, all of them do the job in less than 1 sec. but one. This one return the instance after 72 secs of processing time.
I think that the problem is the validation. If i set validation to "false" it does the job fast, but i *need* validation. I have tried to validate the xml against the xsd using Xerces, and it does the job well (in less than 1 sec).
I have tried jaxb 1.0 and jaxb 1.0.1 with the same result. I am now trying to simplify the xsd, but ¿could someone give me a clue about this problem?
- The invocation to the unmarshaller:
String xml = "..."; // This is the xml document in a string
String enc = "ISO-8859-1";
byte[] bytes = xml.getBytes(enc);
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
JAXBContext jc = JAXBContext.newInstance("jfactory.project.xml.modelo"+MODELO);
Unmarshaller u = jc.createUnmarshaller();
u.setValidating(true);
u.setEventHandler(new EventHandler(log));
remesa = (RemesaType) u.unmarshal(bais);
- The validation made with Xerces 2.4.0
parser = new DOMParser();
setFeature("
http://xml.org/sax/features/validation", true);
setFeature("
http://apache.org/xml/features/validation/schema",true);
setFeature("
http://apache.org/xml/features/validation/schema-full-checking",true);
setProperty("
http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",xsdName);
parser.setErrorHandler (this);
parser.parse(new InputSource(new StringReader(xml)));
Thanks in advance
-----------------------------------
Jesús Ferrero
TB·Solutions
Desarrollo Web Factory
ferreroj_at_tb-solutions.com
tlf: +34 976 701 600
fax: +34 976 701 601
web:
http://www.tb-solutions.com
-----------------------------------