This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Problem with DTD Processing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Problem with DTD Processing" Watch "Problem with DTD Processing" New topic
Author

Problem with DTD Processing

Pragati Desai
Greenhorn

Joined: Nov 14, 2003
Posts: 3
I am using a SAXParser for parsing the XML file.My DTD file does not have the encoding attribute set in the header. Its has only
<?xml version="1.0"?>
When I try to parse the XML file I get the SAXParseException "more pseudo attributes required !"
It works pefectly fine if I set the encoding attribute in the header of the DTD as
<?xml version="1.0" encoding="utf-8"?>
But I dont want to specify the encoding.
Is there any way to overcome this problem?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Which parser implementation (including a version) are you using?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
And please do not cross-post the same question to several forums.
I deleted the one moved here by Matthew.
Pragati Desai
Greenhorn

Joined: Nov 14, 2003
Posts: 3
Hi,
I am using JAXP 1.2
Pragati Desai
Greenhorn

Joined: Nov 14, 2003
Posts: 3
I tried with xerces-1_4_4 by Apache also
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Hey, is the <?xml ...?> prolog in your DTD file (i.e. not in the XML file)? Try removing that -- you don't need it there anyway.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem with DTD Processing