Forum Stats

  • 3,873,279 Users
  • 2,266,531 Discussions
  • 7,911,495 Comments

Discussions

parsing xml string with DTD

843834
843834 Member Posts: 49,972
edited Jul 12, 2001 9:47AM in Java Technology & XML
hi !
I have a xml string as:

String xmlMsg=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+
"<!DOCTYPE elm1 SYSTEM \"myDTD.dtd\">"+
"<elm1>"+
"<elm2>"+
"</elm2>";
"</elm1>";

To parse it I do this:
MyHandler myHandler = new MyHandler ();
SAXParser saxParser = factory.newSAXParser();
factory.setValidating(true);
StringBufferInputStream sbis= new StringBufferInputStream(xmlMsg);
saxParser.parse( new InputSource(new StringReade (xmlMsg)), myHandler);

but I get this error which I think means that it can not find the DTD file.
org.xml.sax.SAXParseException: org.apache.crimson.parser/P-055 myDTD.dtd


appreciate any help

Comments

This discussion has been closed.