Open xatapult opened 6 years ago
Actually we only implemented the validation with catalog support on two levels:
So for the short term there are you could use the jaxp-parse()
extension function.
for the longer term..... util:parse()
is deprecated and adding the catalog feature for the parse-xml()
would be probably a good idea BUT... as far as I remember you need to restart exist-db every time when you update the catalog.xml
file on the filesystem.... the jaxp-parse()
is more flexible here.
All right, that might be a workaround, and nice that you can add catalogs as an argument. Yes, restarting eXist is necessary, it tells you in the log about the catalogs. BUT: When such a file isn't there it doesn't complain :-(
@dizzzz I think we should add validation to fn:parse-xml
(and possibly fn:parse-xml-fragment
) so that they are inline with storing into the db. Any idea how much work that would be?
I will have a look at the current code, but I think I remember there is quite some plumbing involved with the catalogs, and I do not like the end result. A long time I started a kind of re-implementation of the catalog resolver, but this got never finished. Ideally I'd like to store a catalog document inside the database.
@ndw 's work on a xmlresolver might be a good start.
In all I guess it will take some time.
I'll help if I can. I'd certainly prefer to see the xmlresolver work I've done extended or improved so that it's useful to eXist rather than having different implementations.
What is the problem
We're trying to load an XML file with a PUBLIC DTD ref in it using
file:read
and then turn this into XML usingparse-xml()
orutil:parse()
. Both report that they can't find the DTD (sorry for the Dutch in the message):To fix this I tried to add a catalog file to eXist in
conf.xml
in/exist/validation/entity-resolver
:<catalog uri="file:///C:/xdata2/jb-temp/dtd-catalog-test/dummy-catalog.xml"/>
This does not work.
To check whether the catalog was ok, I added it to my oXygen preferences. Without the catalog oXygen couldn't validate the file, with the catalog oXygen could. So I assume the catalog itself is ok.
What did you expect
That
parse-xml()
/util:parse()
would use the catalog files configured inconf.xml
OR that there was some other way to make them catalog-aware OR you can turn off the DTD validation all together (although I know that is controversial due to entity resolving).Describe how to reproduce or add a test
I added a zip file.
Context information
Please always add the following information
Zip file:
dtd-catalog-test.zip