When a XML file has a DTD declared which is not accessible to the parser, what would happen?

Showing Answers 1 - 12 of 12 Answers

prashant

  • Aug 24th, 2005
 

the document is not parsed.

  Was this answer useful?  Yes

sloth_ll

  • Aug 22nd, 2006
 

Everything should be fine.  DTD is used for validation, parsing doesn't require DTD or schema.

  Was this answer useful?  Yes

Mathan

  • Oct 18th, 2006
 

The Parser will not be able to parse the XML file without the DTD and will throw a file not found  exception.

  Was this answer useful?  Yes

Mallikarjun

  • Jul 13th, 2007
 

DTD is must. if the file is not found at location specified you will get following error
java.io.FileNotFoundException: ....AddrBook.dtd (The system cannot find
 the file specified)
        at org.apache.crimson.parser.Parser2.fatal(Unknown Source)
        at org.apache.crimson.parser.Parser2.externalParameterEntity(Unknown Sou
rce)
        at org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Unknown Source)
        at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
        at org.apache.crimson.parser.Parser2.parse(Unknown Source)
        at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
        at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
        at XMLInfo.main(XMLInfo.java:18)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions