Looking at the workaround that you say works, I am assuming that your document is using some entities that are declared in another document.
If that's the case, then what you need to do is use your own XMLReader and try setting to false the SAX features http://xml.org/sax/features/external-general-entities and http://xml.org/sax/features/external-parameter-entities Then again, without seeing your documents or the error message, it's hard to say if that's the real problem Radu -----Original Message----- From: Kaan Yamanyar [mailto:[EMAIL PROTECTED] Sent: Friday, August 04, 2006 1:42 AM To: user@xmlbeans.apache.org Subject: Declaring DTD From API Dear all, In the xml's I parsed I recieve some errors due to entities declared in dtd. In the mail list i found the solution and it really works. It works if i add "<!DOCTYPE csf-inputs SYSTEM "\C:\projects\odabul\odabul-web\WEB-INF\src\cities\WTGData.dtd">" to the XML file. But i can not add this to all xml files, i do not want to modify xml files. One solution is to add this at runtime with manipulating the stream given to the XXXDocument.Factory.parse(...,...) method. But I wonder If i can achieve this with using XmlOptions or some other way? Maybe xmlOptions.setDocumentType(..) is for this reason. But i really could not find a good documentation about this. Looking forward to hear a solution. Regards, Kaan Yamanyar --------------------------------------------------------------------- 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]