Comments (4)
Nevermind, I read later on your page that it needs the msv.jar
Apologies for the invalid issue.
from woodstox.
Right, MSV was written by Kohsuke K, author of many of Sun-provided XML tools. But it is an external library. Glad you were able to figure it out; let me know if you have other issues.
from woodstox.
Oh, this is my POM section for XML relevant libraries:
<!-- XML relevant libraries -->
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
<version>4.4.0</version>
<exclusions>
<exclusion>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>stax2-api</artifactId>
<version>3.1.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.staxmate</groupId>
<artifactId>staxmate</artifactId>
<version>2.2.0</version>
<exclusions>
<exclusion>
<groupId>stax</groupId>
<artifactId>stax-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>
from woodstox.
Validation code:
public static boolean validate(InputStream in, String fileName)
{
XMLStreamReader2 xmlReader=null;
try{
final XMLValidationSchemaFactory factory=XMLValidationSchemaFactory.newInstance(XMLValidationSchema.SCHEMA_ID_W3C_SCHEMA);
final XMLValidationSchema schema=factory.createSchema(new File(fileName));
xmlReader=(XMLStreamReader2)JAXPUtils.XML_INPUT_FACTORY.createXMLStreamReader(in);
//validate the XML file
xmlReader.validateAgainst(schema);
//traverse the streaming document
while(xmlReader.hasNext()){
xmlReader.next();
}
} catch(Exception e){
log.error("Huh! Exception when validating XML against XSD",e);
return false;
} finally{
JAXPUtils.closeXmlStreamReaderQuietly(xmlReader);
}
return true;
}
from woodstox.
Related Issues (20)
- Add support for XMLConstants.ACCESS_EXTERNAL_DTD HOT 2
- `woodstox-core` 6.3/6.4 javac warning due to unexpected new dependency on `aQute.bnd.annotation.Resolution` HOT 6
- Illegal character entity using XMLStreamReader on value encoded by external service HOT 4
- XMLEvent.asCharacters() throws a cast error on Kotlin HOT 2
- README links https://www.studytrails.com are problematic HOT 2
- support setting ReaderConfig on WstxInputFactory HOT 2
- Scan Tool reporting Improper Restriction of XML External Entity Reference CWE ID 611 vulnerability flaw (XXE Attack) HOT 3
- After update to 6.5.0, in osgi/felix runtime the bundle is not started due to missing dependency HOT 4
- failed to parse xml: Unrecognized property `'com.ctc.wstx.maxEntityCount'` in `woodstox:6.5` HOT 2
- Vulnerability CVE-2023-34411 HOT 3
- W3CMultiSchemaFactory class needs extended to allow for custom resolving of XSD's locations HOT 2
- Woodstox should provide option to leave predefined entities i.e. "<", ">", "'", """ and "&" as it is HOT 2
- Not able to write xml to azure blob storage HOT 1
- WstxValidationException: Unknown reason (at end element </nl:nillableIntElement>) when validating a document with nillable elements HOT 14
- Update `msv-core` dependency to `2022.7`
- Notations declared in external DTD subsets are reported as undefined HOT 6
- 'Undefined ID' not thrown when validating with SimpleNsStreamWriter HOT 1
- 'Element <root> has no attribute "verbose"' not thrown from RepairingNsStreamWriter when validating against a DTD schema HOT 1
- Module `com.ctc.wstx` does not read a module that exports `com.ctc.wstx.shaded.msv.org_isorelax.verifier` HOT 6
- Remove `QNameCreator` compatibility class
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 woodstox.