[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: validating against a dtd with GSXMLParser?
From: |
Richard Frith-Macdonald |
Subject: |
Re: validating against a dtd with GSXMLParser? |
Date: |
Sat, 22 Dec 2001 13:01:12 +0000 |
On Saturday, December 22, 2001, at 12:13 PM, e.sammer wrote:
all:
is it possible to validate an xml document against a dtd using
GSXMLParser? i noticed the [-doValidityChecking:(BOOL)] method (i think
that was it), but no matter what, it doesn't seem to check against the
dtd. i'm not doing anything overly complex - just like:
parser = [GSXMLParser parserWithContentsOfFile:aFile];
[parser doValidityChecking:YES];
if ([parser parse] == NO) {
...
}
etc...
am i missing something?
thanks in advance.
I suspect not ... I discovered a bug in that a few days ago, when I
noticed that a parse of
an invalid document worked. This bug is fixed in the CVS repository.
NB. to validate, the parse must be able to find the DTD. It does this
by loading the DTD
from a file, and you probably need to override the loadEntity:at: method
to return the
filename to be used (or there is builtin support to look for DTDs
locally in the DTDs
subdirectories of the bundle resources of applications, where the name
of the DTD file
is the entity URL with all path separators replaced by underscores).