Buchleitner Martin wrote:Hi!I have to change an existing interface, my problem is that i do not know where to start... The Java-API gets as input an XML-File and an DTD-File to match. But in the XML-File there is not DOCTYPE specified, and - so i think - there results the error. If i assign an DTD manually, then the error isn't raised. But i can not tell all the users to assign DTDs before using this tool. [ Error-Ouptuts at the bottom of the document ] I would be glade of any information to solve this problem .. Thanks in advance, Martin I had the same problem and solved it by loading the file into a buffer, searching for the DOCTYPE statement and replacing the SYSTEM value with my own domain/dtd (http://www.amconresearch.net/foo.dtd. The DTD itself was tucked away in the program JAR so I implemented org.xml.sax.EntityResolver and attached it to the DocumentBuilder object. Each time a request was made, I checked for the domain/dtd and returned the InputStream of the DTD in the JAR. Having saved the original SYSTEM value in a StringBuffer, I simply reinserted the value during serialization to the file. All together, I believe there were less characters in writing the code than in my response, it's that easy :-) --
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Anthony Rabaa Software Developer & Network Administrator AMCon Research Inc. Ottawa, Ontario, Canada http://www.amconresearch.net |
- DOMParser - Problem Buchleitner Martin
- Re: DOMParser - Problem Anthony Rabaa
