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

XML Catalog not used to resolve DTD when reading a document using XSLT collection() function #266

Closed
georgebina opened this Issue Dec 27, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@georgebina

georgebina commented Dec 27, 2017

(Original reporter is @wendellpiez)
It seems that the XML Catalog is not propagated to Saxon collection function. While loading an XML from a stylesheet using document() function works, as can be seen in the testing-pipeline2.xpl sample that I will attach, the same document fails when accessed through the collection() function as can be seen in testing-pipeline.xpl. The test.xpl shows the same problematic document test3.xml working fine when accessed with p:document directly from the XProc script.

@georgebina

This comment has been minimized.

georgebina commented Dec 27, 2017

@georgebina

This comment has been minimized.

georgebina commented Dec 27, 2017

Tested with xmlcalabash-1.1.16-97 from command line.

java -jar /Applications/xmlcalabash-1.1.16-97/xmlcalabash-1.1.16-97.jar -i source=testing-pipeline.xpl testing-pipeline.xpl 
WARN : collection(): failed to parse XML file [...]/test3.xml: I/O error reported by XML parser processing [...]/test3.xml: [...]/MISSING.dtd (No such file or directory)
@ndw

This comment has been minimized.

Owner

ndw commented Mar 4, 2018

Near as I can tell, this falls through to net.sf.saxon.resource.StandardCollectionFinder and that doesn't make any attempt to use the resolver.

I think that makes this a Saxon bug. But feel free to tell me why I'm wrong :-)

@georgebina

This comment has been minimized.

georgebina commented Mar 5, 2018

The problem is that the same stylesheet works fine if Saxon is called directly:

java -cp lib/saxon9ee.jar:lib/resolver.jar net.sf.saxon.Transform -s:/Users/george/Downloads/samples/testing.xsl -xsl:/Users/george/Downloads/samples/testing.xsl -catalog:/Users/george/Downloads/samples/catalog.xml
<?xml version="1.0" encoding="UTF-8"?><out><test>Test 1</test><test>Test 2</test><test>Test 3</test></out>

That is why I was thinking it may be something missing when the stylesheet is called from Calabash.

@georgebina

This comment has been minimized.

georgebina commented Mar 5, 2018

Note also that the problem is not related to getting the resources from the collection, the directory is iterated and the files are returned, the problem seems to be related to the parser used to parse each file from the collection, that seems to not have an entity resolver (based on the catalog) and thus the DTD is not found.

@ndw

This comment has been minimized.

Owner

ndw commented Mar 5, 2018

Hrrm. Ok. I'll take another look. I don't see how or why the entity resolver should vary depending on whether or not it's called from XML Calabash. But it is software after all.

ndw added a commit that referenced this issue Mar 14, 2018

ndw added a commit that referenced this issue Mar 14, 2018

@ndw

This comment has been minimized.

Owner

ndw commented Mar 15, 2018

I believe this is fixed in 1.1.20, George. Please let me know if you're still having trouble.

@ndw ndw closed this Mar 15, 2018

@wendellpiez

This comment has been minimized.

wendellpiez commented Mar 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment