Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

path resolution problem for DTD file on Linux

 
jayanth babu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pals,

iam getting

FileNotFoundException: root/SetElement [no such file or directory]

when i try to parse a XML file.

My XML file starts as follows

<?xml version="1.0" ?>
<!DOCTYPE SetElement SYSTEM "SetElement.dtd" >

and i have put the SetElement.dtd in the working directory.

iam using JBuilder. On Windows it is searching for DTD file in the working directory and so works fine. But on Linux it is searching for the DTD file in the /root directory instead of working directory.

Thanks
jayanth
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried to place ./ or and see whether its works in both OS?
like
<!DOCTYPE SetElement SYSTEM "./SetElement.dtd" >

?? Just thinking... ??
 
jayanth babu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
iam not supposed to change the XML file. I should parse the same file as it is.

thanks
jayanth
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if your tasks is only parsing, and if you are not checking for Validation of xml against DTD, then you can turnoff the dtd validation in your parser using java code. I dont know what xml parser jbuilder is using, probably Xerces, if so Xerces support turning off dtd validation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic