Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Referecing a DTD within an XML file

Reply
Thread Tools

Referecing a DTD within an XML file

 
 
Stu
Guest
Posts: n/a
 
      07-09-2003
I have the following syntax in my XML file

<!DOCTYPE config SYSTEM "config.dtd">

And also have my xml file and dtd file in the same directory, yet when I use
the following XML validator

http://www.stg.brown.edu/service/xmlvalid/

to validate my document I get this error.

I:\exec\pbh\config.xml:
error (563): can't resolve System ID: config.dtd

Can somebody please give me the correct syntax on how to specify a DTD within
an XML file or is this a problem with the XML validator.

FYI, if I encapsulate the DTD within the XML file it appears to work fine.

Thanks in advance for all who answer this post.
 
Reply With Quote
 
 
 
 
C. M. Sperberg-McQueen
Guest
Posts: n/a
 
      07-09-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (Stu) writes:

> I have the following syntax in my XML file
>
> <!DOCTYPE config SYSTEM "config.dtd">
>
> And also have my xml file and dtd file in the same directory, yet when I use
> the following XML validator
>
> http://www.stg.brown.edu/service/xmlvalid/
>
> to validate my document I get this error.
>
> I:\exec\pbh\config.xml:
> error (563): can't resolve System ID: config.dtd


You're using a Web-based validator. It does not have access to your
local file system. It had BETTER not have access to the entire
directory from which you uploaded the XML file you are asking it to
validate. If it's using the normal file-upload interface, I don't
think it knows what directory the file came from (I could be wrong
here, it's been a few years since I read the spec on file uploading
from HTML forms).

So the validator is having trouble resolving the relative URL you have
specified in the system identifier. Your LOCAL validator may be
perfectly happy with it -- most XML parsers will say "well, I am
reading file F in the file system, so I'll just absolutize this to
also be a file:// URL ...", and they are right to do so. But it's
not really fair to expect the software at Brown to hack into your
local file system just to validate a document.

> Can somebody please give me the correct syntax on how to specify a DTD within
> an XML file or is this a problem with the XML validator.


You're using the correct syntax. (Or A correct syntax.)

The validator is also doing the Right Thing.

The problem appears to be what the old mainframe error-code manuals
used to call Probable Operator Error. You are expecting the wrong
thing. If you want a web-based validator to get access to files,
you either have to hand it the files (by uploading them with the
forms data) or the files have to be on the Web somewhere.

So: put the DTD on the Web somewhere, and give its full URI
in the system identifier of the XML document. And try again.
And then, when you have five minutes to spare, install RXP or SP
or expat locally.

> Thanks in advance for all who answer this post.


I hope this helps.

-C. M. Sperberg-McQueen
World Wide Web Consortium
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dealing with nested xml within nested xml within...... Ultrus Python 3 07-09-2007 09:00 PM
XML file from one DTD to another DTD test Java 2 07-28-2006 08:48 PM
How to specify DTD to DTD.getDTD for DocumentParser? Ronald Fischer Java 4 03-17-2005 09:37 AM
Removing the dtd name when using print(...) on the dtd generated class Joseph Tilian Java 0 12-21-2004 02:58 PM
Including a dtd into another dtd... possible? Asfand Yar Qazi XML 1 09-19-2003 12:10 PM



Advertisments