Thanks for the kind answer Radu, You're right, I didn't explain the problem very well (my poor English knowledge doesn't help).
I have an XSD file. I compiled it with scomp command. I used the resulting classes to parse XML data generated by a remote procedure (a poor implementation of a web service, but I have no control over it). I'm writing some code to manage this XML data. Now, I am interested in testing my code. I want to write a STUB of the remote proc. I used .toString() to log the XML data, saved it on a file, and used a testing class to: - load XML from file system - feed my code with XML, simulting the remote procedure response. For the moment, I had to give up! I cannot read XML files, they are valid but something goes wrong during parsing! Does anyone have the same problem? I'll investigate further, and I'll check if I have more then one XSD file in the classpath. Thanks, Stefano --- Radu Preotiuc-Pietro <[EMAIL PROTECTED]> ha scritto: > Hard to say where you are wrong, since you give very > little detail of > what you are doing ;-) > In fact, what the "validate" implementation does is > parse the document > provided in an XmlObject, then call .validate() on > it (in addition to > parsing the Schema files of course). > > So what I can suggest is make sure that you don't > have some older/newer > compiled Schemas on your classpath when you execute > your java class, > since XmlBeans does dynamic lookup of Schema > information when validating > documents. > > Radu > > -----Original Message----- > From: Stefano Peruzzi [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 29, 2006 1:40 AM > To: [email protected] > Subject: validation error, but validate line command > says it's ok > > Hi all, > something strange is happening. When I parse my xml > file from my java > class, I obtain this error: > >> D:\[...]\documenti\sbnmarc_response.xml:0: error: > cvc-complex-type.4: Expected attribute: > schemaVersion > > Of course, the file does have the schemaVersion > attribute! > I also tried the 'validate' line command (specifying > the xsd file) and > it says: > sbnmarc_response.xml valid. > > Where am I wrong? > Maybe I should specify the xsd file to parse() o > validate() method in my class? (I don't know how) > But the parse method > is on a generated factory class, using 'scomp' > command on the same xsd. > I think XMLBeans should do the magic for me. > > Thanks for your help, > Stefano > > > > > > > ___________________________________ > Yahoo! Mail: gratis 1GB per i messaggi e allegati da > 10MB > http://mail.yahoo.it > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > _______________________________________________________________________ > Notice: This email message, together with any > attachments, may contain > information of BEA Systems, Inc., its > subsidiaries and affiliated > entities, that may be confidential, proprietary, > copyrighted and/or > legally privileged, and is intended solely for the > use of the individual > or entity named in this message. If you are not the > intended recipient, > and have received this message in error, please > immediately return this > by email and then delete it. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

