GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Programming  >  XML
Go To First  |  Previous Question  |  Next Question 
 XML  |  Question 4 of 40    Print  
When a XML file has a DTD declared which is not accessible to the parser, what would happen?

  
Total Answers and Comments: 6 Last Update: July 13, 2007   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 24, 2005 05:38:50   #1  
prashant        

RE: When a XML file has a DTD declared which is not accessible to the parser, what would happen?
the document is not parsed.
 
Is this answer useful? Yes | No
August 22, 2006 22:14:06   #2  
sloth_ll        

RE: When a XML file has a DTD declared which is not ac...
Everything should be fine. DTD is used for validation parsing doesn't require DTD or schema.
 
Is this answer useful? Yes | No
October 18, 2006 01:54:38   #3  
Mathan        

RE: When a XML file has a DTD declared which is not ac...
The Parser will not be able to parse the XML file without the DTD and will throw a file not found exception.
 
Is this answer useful? Yes | No
January 11, 2007 19:52:54   #4  
mrbandersnatch Member Since: January 2007   Contribution: 2    

RE: When a XML file has a DTD declared which is not ac...
Sloth_II is correct - although of course it depends on the parser being non-validating or configurable as such.

 
Is this answer useful? Yes | No
February 05, 2007 10:47:05   #5  
bowler Member Since: January 2007   Contribution: 1    

RE: When a XML file has a DTD declared which is not ac...
DTD is optional
 
Is this answer useful? Yes | No
July 13, 2007 08:00:05   #6  
Mallikarjun        

RE: When a XML file has a DTD declared which is not ac...
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)

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape