ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@freenet.de
Subject Re: XML Schema validation
Date Mon, 09 Sep 2002 13:52:19 GMT
I don't know, if the following link is of any help, but for me it is the only point of reference
for a clear and complete statement made about how JAXP parsers *REALLY* deal with XML Schemas:

http://java.sun.com/xml/jaxp/change-requests-11.html

I am very disappointed about how the JAXP crew tackled the issue of Schema resolution. With
dtds everything was just fine. I just had to register a custom entity-resolver with the parser
and could do anything then. 

One might think that schema resolution shouldn't be so much different from dtd resolution.
However, the JAXP crew somehow moved away from the nice approach that already existed and
towards a pretty peculiar one:
The list of namespaces that are to be resolved (in a customizable manner) has to be passed
to the parser PRIOR to its parsing process.
If the list is passed as an array of Strings, each of which contains a namespace identifier,
then for this *specific* list
of namespaces, the parser will call its usual EntityResolver, passing in the namespace string
within the "publicId" field.
How wonderful. If the parser detects references to namespaces that are not within the list,
then it tries to resolve them
on its own.
If my resolution-database contains mappings for 100 schemas then I have to pass a string to
the parser that is a mile long.
Above that, the list passed to the parser is fixed. It seems as if there is no way to get
parser callbacks for namespaces
which are to be resolved but which are not already in the list passed to the parser.

How very very unelegantly solved!!!!! ;( ;( ;(

Instead, one could have let the parser detect namespace information within the XML doc it
parses and call back on the
"ancestral" EntityResolver, passing in the namespace-id in the publicId parameter and an optional
xsi:schemaLocation
string as the systemId paramter. 

greetings
Sascha Coenen

----- original Nachricht --------



I've committed Nick Pellow's changes to xmlvalidate, which should enable us
to validate XML schema.

I say should as although I've commited the .xsd, .xml and build file to test
this, I cannot get <xmlcatalog> to map from a schema uri to a file location.
Maybe I'm getting something wrong -I'd be grateful if anyone else could take
a look at this so we can have a complete test and complete example for the
docs.

-steve


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>



--- original Nachricht Ende ----



-- 
freenet Email-Office: 
E-Mail, Kalender und 30 MB virtuelle Festplatte. 
Jetzt testen unter www.freenet.de/tipp/emo
Mime
View raw message