• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DTD seach path for Xerxes parser

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Struts and the the XML config files refer to the DTD that are stored locally on the same directory as the XML files. I refer to the DTD files from the XML using SYSTEM and the the name of the DTD file without any path element. I am using the Xerxex parser. The parser does not find the DTD and complains of a missing base URL. What am I doing wrong?
More importantly, can someone tell me what rules the parser uses when searching for a DTD in a web application as the web applications are hosted by a web container and have only the concept of a context root for its file system.
Thanks in advance,
Raj Auradkar
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But are you certain that at run-time, the XML file it is reading is really the same one you think it is? For example, are you building and running your web app as a WAR file, and the DTD files are *not* in that WAR file?
Also, it would probably help if you actually showed your DOCTYPE line from your XML file.
 
Rajendra Auradkar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Billy,
Thanks for your response, you guys are fast!!
Here is the info.
The DTD is not in the war. Below are 2 versions of the struts-config.xml file for which the parser is whining for a 'base uri'.
1. <!DOCTYPE struts-config SYSTEM "struts-config_1_1.dtd">
In this case the DTD is in the same location as the struts-config.xml
2. <!DOCTYPE struts-config SYSTEM "/webapps/onlineCredit/WEB-INF/lib/struts-config_1_1.dtd">
In this case the struts-config.xml file is in the lib directory of the web app.
THanks,
Raj Auradkar
 
Billybob Marshall
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rajendra Auradkar:

The DTD is not in the war.


My point was, if you have a WAR file from which the web app is running, then your DTDs would need to be in it, in the same "folder" as the XML files for that (1st version) doctype to work. Don't use the 2nd version, as that would force every deployment to have a physical directory named what you specified there.
 
Rajendra Auradkar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Billy,
Sorry for the mistake. The web app does not run from a war. Is it deployed in an exploded format. Does that answer the question?
Also, do you know what rules are used by the parser when it is searching for DTDs. (i am asusming the parser is context agnostic).
Thanks,
Raj Auradkar
 
Billybob Marshall
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, in the exploded deployed directory structure, is the DTD in the same directory as the XML (not necessarily where your original source XML is)?
As far as the rules, I believe they are relative directory based (relative to the referring XML). So "blah.dtd" would be expected to be in the same directory as the XML containing that reference. "foo/blah.dtd" would be expected to be in a subdirectory named foo, relative to the directory containing the XML. "/some/path/blah.dtd" would be in physical directory (not relative to the web app AFAIK) /some/path.
 
Rajendra Auradkar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, it is in the same directory.
Thanks,
Raj Auradkar
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic