Friday, October 15, 2021

How can I validate xsd using apache camel?

 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"

       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:camel="http://camel.apache.org/schema/blueprint"
       xsi:schemaLocation="
       http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
       http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/spring/camel-blueprint.xsd">

  <camelContext xmlns="http://camel.apache.org/schema/blueprint">
      <route>
          <from uri="file:flights/data-in?noop=false"/>
          <doTry>
              <to uri="validator:file:flights/schema/flight.xsd"/>
              <to uri="file:flights/data-valid"/>
              <doCatch>
                  <exception>org.apache.camel.ValidationException</exception>
                  <to uri="file:flights/data-invalid"/>
              </doCatch>
              <!--
              <doFinally>
                  <to uri="file:test/src/data/finally"/>
              </doFinally>
              -->
          </doTry>
      </route>

  </camelContext>

</blueprint>

Ref: https://stackoverflow.com/questions/28263085/how-can-i-validate-xsd-using-apache-camel

No comments:

Post a Comment

Install and use xorg-server on macOS via Homebrew

  The instructions to install and use xorg-server on macOS via Homebrew: Install Homebrew (if you haven't already): /bin/bash -c ...