Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve DTD for validation #51

Open
1stone opened this issue Oct 5, 2018 · 1 comment
Open

Resolve DTD for validation #51

1stone opened this issue Oct 5, 2018 · 1 comment

Comments

@1stone
Copy link

1stone commented Oct 5, 2018

I'm trying to validate a bunch of XML files, organized in a multi-directory filesystem structure, against a DTD.

From what I understand from #46 and #47 that should still be possible with 1.0.2 if a DOCTYPE decl is present on the XML files.
So, given this definition in the XML files

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE acme PUBLIC "acme.dtd" "acme.dtd">
...

I would like to validate against that acme.dtd which is located in the root of the validationSet directory.
But unfortunately, the validation fails with While parsing /.../vroot/path/to/this.xml: /.../vroot/path/to/acme.dtd (No such file or directory), with vroot being the directory in the validationSet and where acme.dtd is located.

I tried to "register" the DTD file via a catalog setting, but to no avail.
Is there any way to configure the plugin in a way, that all XML files with DOCTYPE acme will be validated against the DTD file in the vroot?

This is the current plugin config for reference:

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>xml-maven-plugin</artifactId>
          <version>1.0.2</version>
          <configuration>
            <validationSets>
              <validationSet>
                <dir>${project.build.xml.directory}</dir>
                <validating>true</validating>
              </validationSet>
            </validationSets>
            <catalogs>
              <catalog>${project.build.xml.directory}/acme.dtd</catalog>
            </catalogs>
            <catalogHandling>strict</catalogHandling>
          </configuration>
        </plugin>
@rosslamont
Copy link
Contributor

Hi there,

Have a read of catalog files. Your configuration shows a catalog called acme.dtd which is almost certainly not a catalog file. A catalog is a defined standard which provides a way for the plugin to map where a local copy of a remote schema or dtd can be found.

Out of interest, do you get an error message with the configuration shown above? Would you be able to post it in a comment - we try to clean up awkward error messages.

Cheers
Ross

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants