Comments (7)
awful.zip
This is not restricted to gaulois-pipe, and can be reproduced with xmlresolver and Saxon together ;
Configuration config = Configuration.newConfiguration();
config.setURIResolver(new Resolver(new Catalog("src/test/resources/awfulDtd/awful-catalog.xml")));
Processor proc = new Processor(config);
DocumentBuilder builder = proc.newDocumentBuilder();
builder.build(new File("src/test/resources/awfulDtd/inputFile.xml"));
Produces :
2018-05-17 14:08:38,807 TRACE [main] org.xmlresolver.Catalog - Default properties: XMLResolver.properties;CatalogManager.properties
2018-05-17 14:08:38,809 DEBUG [main] org.xmlresolver.Catalog - Loaded xmlresolver.properties from classpath: jar:file:/home/ext-cmarchand/.m2/repository/org/xmlresolver/xmlresolver/0.12.4/xmlresolver-0.12.4.jar!/xmlresolver.properties
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.369 sec <<< FAILURE!
testCatalog(fr.efl.chaine.xslt.CatalogTest) Time elapsed: 0.32 sec <<< ERROR!
net.sf.saxon.s9api.SaxonApiException: I/O error reported by XML parser processing file:/home/ext-cmarchand/devel/github/gaulois-pipe/gaulois-pipe/src/test/resources/awfulDtd/inputFile.xml: /fakepath/awful.dtd (Aucun fichier ou dossier de ce type)
from gaulois-pipe.
Maybe you should try with class ResolvingXMLReader (according to saxon doc: https://www.saxonica.com/html/documentation/sourcedocs/xml-catalogs.html):
ResolvingXMLReader resolvingXMLReader = new ResolvingXMLReader(new Resolver(new Catalog("src/test/resources/awfulDtd/awful-catalog.xml")));
resolvingXMLReader.parse("src/test/resources/awfulDtd/inputFile.xml");
from gaulois-pipe.
@etourdot : the problem is I use xmlresolver from Norman Walsh, and these classes come from Apache xml-common-resolver (hum, also written by Norman Walsh), and I do not want to add another dependency for resolver.
Setting resolver as a EntityResolver on XMLReader should work, but doesn't. @ndw should have a look at it.
from gaulois-pipe.
Why adding another dependency ?
ResolvingXMLReader is included in xml-common-resolver : https://xerces.apache.org/xml-commons/components/apidocs/resolver/org/apache/xml/resolver/tools/ResolvingXMLReader.html
Description is: "This class implements a SAX XMLReader that performs entity resolution using the CatalogResolver."
Btw, it's quoted in the ยง "How to use XML Resolver" in website xmlresolver
from gaulois-pipe.
Because I do not have xml-commons-resolver as dependency in gaulois-pipe.
Because I use another resolver, which is much reliable ; xmlresolver.org
Best,
Christophe
from gaulois-pipe.
I misspoke, ResolvingXMLReader is also included in xmlresolver:
https://github.com/ndw/xmlresolver/blob/master/src/main/java/org/xmlresolver/tools/ResolvingXMLReader.java
from gaulois-pipe.
Problem is solved by setting an EntityResolver (i.e. an instance of org.xmlresolver.Resolver) in the XMLReader that's used to parse source File.
That solves partially the problem, only for files that go through pipe. But it doesn't solve the problem for files load by fn:document(...)
or fn:doc(...)
. Still some work to do.
from gaulois-pipe.
Related Issues (20)
- static-base-uri is lost when using compiled XSL
- if config file is specified with cp:/ URI, URLStreamHandler is not used HOT 1
- The convert() method for an atomic Datatype should not (always) split the input value HOT 4
- Exception in executesPipeOnMultiThread is not processed
- Gaulois raise Exception InvalidSyntax when folder does not exists HOT 1
- Error when calling external xslt file HOT 14
- Offer a way to load a schema into Saxon configuration HOT 2
- bug when inputFile has no extension HOT 2
- It seems output directories are not always created HOT 1
- tee is forbidden in choose, but schema allows it HOT 1
- Add control to config to check that schema URI are valid and point to an available schema HOT 1
- Running GP in a JavaEE container fails
- Map parameters are not accepted. They should be.
- Saxon9.9 compliance
- Looking for source in non-existing directory HOT 1
- Config checks enhancements HOT 1
- Java Step is ignored when it is the first Step of a choose/when or a tee/pipe
- Vulnerabilities introduced by Jetty
- [HttpListener] This feature has nothing to do with GauloisPipe HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gaulois-pipe.