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

catalog configuration option is not propagated to XMLReader #30

Open
northerngosling opened this issue Oct 29, 2018 · 3 comments
Open
Assignees
Labels
Milestone

Comments

@northerngosling
Copy link

Plugin Version : 2.0.0-RC3
Saxon EE Version : 9.8.0.12
Java JDK : 1.8.0 181

Short Description
The cofiguration option is not taken into account. While executing an xspec test that processes an XML file with a public DTD reference, the substitute DTD uri provided by the specified catalog is not used and thus the DTD is not resolved.

Long Description
GIVEN an XML file with the following DTD reference :

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE MY-DOCUMENT PUBLIC "-//MY-COMPANY//DTD PUBLICATION//FR" "C:/non/available/path/to/DTD/publications_V1.dtd">

AND a catalog file :

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
	<systemSuffix systemIdSuffix="publications_V1.dtd" uri="file:/D:/correct/path/to/the/DTD/publications_v1.dtd"/>
	<public publicId="-//MY-COMPANY//DTD PUBLICATION//FR" uri="file:/D:/correct/path/to/the/DTD/publications_v1.dtd"/>
</catalog>

AND an xspec-maven-plugin configuration :

<configuration>
	<generateSurefireReport>true</generateSurefireReport>
	<catalogFile>../../relative/path/to/my-catalog.xml</catalogFile>
	<saxonOptions>
		<warnings>silent</warnings>
	</saxonOptions>
	<keepGeneratedCatalog>true</keepGeneratedCatalog>
</configuration>

WHEN the xspec test is executed and an XSL transformation applied to the XML file

THEN the test fails with the stack trace provided in
catalog-error.txt

In the generated catalog file we find the correct absolute path to the specified catalog file :
<nextCatalog catalog="file:/D:/correct/absolute/path/to/my-catalog.xml"/>

@cmarchand
Copy link
Collaborator

Problem is the same than in gaulois-pipe. Just have to reuse the same code.

@cmarchand cmarchand self-assigned this Oct 29, 2018
@cmarchand cmarchand changed the title catalog configuration option not taken into account catalog configuration option is not propagated to XMLReader Oct 29, 2018
@cmarchand cmarchand added this to the 2.0.0 milestone Apr 20, 2020
@cmarchand cmarchand added the bug label Apr 20, 2020
@cmarchand
Copy link
Collaborator

cmarchand commented Apr 20, 2020

Problem reproduced in branch issues/30

@cmarchand
Copy link
Collaborator

Hi @northerngosling , could you have a look at project saxon-resolver-way-to-use and tell me if the usecase is the same you want to test. You can clone and run it simply with mvn package.
If so, I'll implement this solution in plugin

@cmarchand cmarchand modified the milestones: 2.0.0, 2.1.0 Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants