XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: Is there a Maven plugin for XML Schema validation?

Hi Roger, 

You can use xml-maven-plugin which can perform XSLT transformations but also schema validation : 
https://www.mojohaus.org/xml-maven-plugin/examples/validate-schema.html

You can specify the schema to apply in the pom.xml as in this example but you can also let the plugin check for xml-model PI in your XML as explain in https://github.com/mojohaus/xml-maven-plugin/issues/21 

We also use this plugin for other validation models : Relax NG, NVDL and Schematron, but we had to adapt a few dependencies : 
    <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>xml-maven-plugin</artifactId>
          <version>1.0.2</version>
          <dependencies>
            <!-- xml-model PI handling-->
            <dependency>
              <groupId>com.jimetevenard.xml</groupId>
              <artifactId>intrinsic-jaxp-validator</artifactId>
              <version>1.0.0</version>
            </dependency>
            <!-- Jing Wrapper : SchemaFactories for RNG, RNC, Schematron (1.5 and ISO), NVDL-->
            <dependency>
              <groupId>com.jimetevenard.xml</groupId>
              <artifactId>Jing-JAXP-Wrapper</artifactId>
              <version>1.0.0</version>
            </dependency>
            <!-- Recent Jing for ISO schematron -->
            <dependency>
              <groupId>eu.els.oss</groupId>
              <artifactId>jing</artifactId>
              <version>20190204</version>
            </dependency>
            <!-- Needed by ELS's Jing -->
            <dependency>
              <groupId>com.google.code.gson</groupId>
              <artifactId>gson</artifactId>
              <version>2.3.1</version>
            </dependency>
            <!-- for ISO schematron -->
            <dependency>
              <groupId>extern.net.sf.saxon</groupId>
              <artifactId>saxonee</artifactId>
              <type>jar</type>
              <version>9.8.0.12</version>
            </dependency>
            <dependency>
              <groupId>extern.net.sf.saxon</groupId>
              <artifactId>saxonee-license</artifactId>
              <version>9.8.2018</version>
            </dependency>
          </dependencies>
        </plugin>

HTH

Cheers, 

Matthieu Ricaud-Dussarget

-----Message d'origine-----
De : Roger L Costello <costello@mitre.org> 
Envoyé : vendredi 20 novembre 2020 15:42
À : xml-dev@lists.xml.org
Objet : [xml-dev] Is there a Maven plugin for XML Schema validation?

Hi Folks,

I want to use Maven to automate the validation of XML instances against an XML Schema.

Is there a Maven plugin for XML Schema validation?

/Roger

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS to support XML implementation and development. To minimize spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS