Comments (3)
Indeed this is supported by saxon and is definitely a good idea to reduce memory usage of the validator. Changings this requires some rewrite of Input and InputFactory but this should not break the api.
Nevertheless, I tested a litte bit and have trouble at least with the SchemaValidationAction which is not producing errors with line and col information. I reused the XdmNode parsed in the first step (DocumentParseAction) so that the document is just read once e.g.
final Validator validator = ObjectFactory.createValidator(scenarioType.getSchema());
validator.setErrorHandler(errorHandler);
validator.validate(new DOMSource(NodeOverNodeInfo.wrap(parseDocument.getUnderlyingNode())));
With this, I miss the line and column information. When using the byte-array from Input I get them. I'd think they are useful for debugging, so I wouldn't change this until this problem is solved. Any ideas?
@rkottmann what do you think?
from validator.
Since Saxon HE has no support for schema, things are more complicated. To run the schema validation, I need to re-read the source. Nevertheless, this reduces overall footprint and is implemented in current master branch.
When using an InputStream, the re-read requires a serialization prior validation. So using a stream is somewhat suboptimal:
- The stream is read when necessary
- must be serialized prior validation
Using an URI based Input is better, since the re-read is based on a new stream. Nevertheless, unless you are using the ByteArrayInput by using the corresponding read in InputFactory the target is not read into memory. It's directly parsed to XdmNode.
I also implemented support for using java.xml.transform.Source as an Input. The actual implemenation regarding streams is in SourceInput. In future version we may extend for other Source-Implementations as well.
@JannickWeisshaupt Feel free to test this implementation. Any help on spotting errors with this is welcome.
from validator.
Fixed with Release 1.3.0
from validator.
Related Issues (20)
- Role is null in FailedAssert HOT 9
- Loading of XSLT throws exception HOT 3
- Absolute path required
- Jakarta support HOT 2
- Deamon Mode Exception at startup HOT 4
- IllegalArgumetException wenn Repository Parameter nicht angegeben HOT 2
- BR-17 BT-59 Same name fΓΌr Payee and Seller is an error since xrechnung-2.3 HOT 3
- Multi language support for reports
- Assertion results output
- Saxon throws exception with new 1.5.0 validator (Java) HOT 4
- Documentation for version 1.5.0 not updated
- ValidationTool 1.5.0 Fails with "java.lang.IllegalArgumentException: No repository location for scenario definition 'default_1'" HOT 2
- Broken matching in multiple scenario files
- maven pom doesn't specify transitive dependencies HOT 2
- Document valid on https://kositvalidator.service-bw.de/ (1.4.2) not valid locally (neither 1.4.2 nor 1.5.0) HOT 5
- Custom Level ignored in Result via Java Api HOT 1
- Update README: "Third party validation configurations"
- Command line output says "reject", validation result document says "accept" HOT 1
- Outdated API Documentation for 1.5.0
- Check result to stdout causes an exception
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 validator.