This is an automated email from the ASF dual-hosted git repository. igarashitm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push: new 693c94beec feat(extension): Add camel-dfdl JVM only extension (#7222) 693c94beec is described below commit 693c94beec7e0031d87e05e6ed631670f5b53245 Author: Tomohisa Igarashi <tm.igara...@gmail.com> AuthorDate: Thu Apr 3 12:07:26 2025 -0400 feat(extension): Add camel-dfdl JVM only extension (#7222) Fixes: #7188 --- .github/dependabot.yml | 1 + catalog/pom.xml | 13 + docs/modules/ROOT/examples/components/dfdl.yml | 13 + docs/modules/ROOT/examples/dataformats/dfdl.yml | 13 + docs/modules/ROOT/nav.adoc | 1 + .../ROOT/pages/reference/extensions/dfdl.adoc | 69 ++ extensions-jvm/dfdl/deployment/pom.xml | 63 ++ .../component/dfdl/deployment/DfdlProcessor.java | 46 + extensions-jvm/dfdl/pom.xml | 39 + extensions-jvm/dfdl/runtime/pom.xml | 100 ++ .../dfdl/runtime/src/main/doc/limitations.adoc | 22 + .../main/resources/META-INF/quarkus-extension.yaml | 34 + extensions-jvm/pom.xml | 1 + integration-tests-jvm/dfdl/pom.xml | 139 +++ .../quarkus/component/dfdl/it/DfdlResource.java | 95 ++ .../component/dfdl/it/DfdlRouteBuilder.java | 31 + .../dfdl/src/main/resources/X12-837P.dfdl.xsd | 1154 ++++++++++++++++++++ .../camel/quarkus/component/dfdl/it/DfdlTest.java | 96 ++ .../src/test/resources/X12-837P-message.edi.txt | 46 + .../dfdl/src/test/resources/X12-837P-message.xml | 330 ++++++ integration-tests-jvm/pom.xml | 1 + pom.xml | 2 + poms/bom-test/pom.xml | 5 + poms/bom/pom.xml | 26 + poms/bom/src/main/generated/flattened-full-pom.xml | 21 + .../src/main/generated/flattened-reduced-pom.xml | 21 + .../generated/flattened-reduced-verbose-pom.xml | 21 + 27 files changed, 2403 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1c73bf485d..f9ca13df1b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -50,6 +50,7 @@ updates: - dependency-name: "org.hamcrest:hamcrest" - dependency-name: "org.hamcrest:hamcrest-core" - dependency-name: "org.seleniumhq.selenium:htmlunit-driver" + - dependency-name: "org.xmlunit:xmlunit-core" - dependency-name: "org.zeroturnaround:zt-exec" # Maven plugins - dependency-name: "*:*-maven-plugin" diff --git a/catalog/pom.xml b/catalog/pom.xml index 3c26176d94..a0bc2f486f 100644 --- a/catalog/pom.xml +++ b/catalog/pom.xml @@ -1124,6 +1124,19 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-dfdl</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>*</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-digitalocean</artifactId> diff --git a/docs/modules/ROOT/examples/components/dfdl.yml b/docs/modules/ROOT/examples/components/dfdl.yml new file mode 100644 index 0000000000..9cab71680e --- /dev/null +++ b/docs/modules/ROOT/examples/components/dfdl.yml @@ -0,0 +1,13 @@ +# Do not edit directly! +# This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page +cqArtifactId: camel-quarkus-dfdl +cqArtifactIdBase: dfdl +cqNativeSupported: false +cqStatus: Preview +cqDeprecated: false +cqJvmSince: 3.22.0 +cqNativeSince: n/a +cqCamelPartName: dfdl +cqCamelPartTitle: DFDL +cqCamelPartDescription: Transforms fixed format data such as EDI message from/to XML using a Data Format Description Language (DFDL). +cqExtensionPageTitle: DFDL diff --git a/docs/modules/ROOT/examples/dataformats/dfdl.yml b/docs/modules/ROOT/examples/dataformats/dfdl.yml new file mode 100644 index 0000000000..9dba9ee5d0 --- /dev/null +++ b/docs/modules/ROOT/examples/dataformats/dfdl.yml @@ -0,0 +1,13 @@ +# Do not edit directly! +# This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page +cqArtifactId: camel-quarkus-dfdl +cqArtifactIdBase: dfdl +cqNativeSupported: false +cqStatus: Preview +cqDeprecated: false +cqJvmSince: 3.22.0 +cqNativeSince: n/a +cqCamelPartName: dfdl +cqCamelPartTitle: DFDL +cqCamelPartDescription: Handle DFDL (Data Format Description Language) transformation. +cqExtensionPageTitle: DFDL diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 514996bc90..bf9b6dd9ca 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -99,6 +99,7 @@ *** xref:reference/extensions/couchbase.adoc[Couchbase] *** xref:reference/extensions/cron.adoc[Cron] *** xref:reference/extensions/crypto.adoc[Crypto (JCE)] +*** xref:reference/extensions/dfdl.adoc[DFDL] *** xref:reference/extensions/dns.adoc[DNS] *** xref:reference/extensions/dsl-modeline.adoc[DSL Modeline] *** xref:reference/extensions/dataformat.adoc[Data Format] diff --git a/docs/modules/ROOT/pages/reference/extensions/dfdl.adoc b/docs/modules/ROOT/pages/reference/extensions/dfdl.adoc new file mode 100644 index 0000000000..6e2fa2439f --- /dev/null +++ b/docs/modules/ROOT/pages/reference/extensions/dfdl.adoc @@ -0,0 +1,69 @@ +// Do not edit directly! +// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page +[id="extensions-dfdl"] += DFDL +:linkattrs: +:cq-artifact-id: camel-quarkus-dfdl +:cq-native-supported: false +:cq-status: Preview +:cq-status-deprecation: Preview +:cq-description: Transforms fixed format data such as EDI message from/to XML using a Data Format Description Language (DFDL). +:cq-deprecated: false +:cq-jvm-since: 3.22.0 +:cq-native-since: n/a + +ifeval::[{doc-show-badges} == true] +[.badges] +[.badge-key]##JVM since##[.badge-supported]##3.22.0## [.badge-key]##Native##[.badge-unsupported]##unsupported## +endif::[] + +Transforms fixed format data such as EDI message from/to XML using a Data Format Description Language (DFDL). + +[id="extensions-dfdl-whats-inside"] +== What's inside + +* xref:{cq-camel-components}::dfdl-component.adoc[DFDL component], URI syntax: `dfdl:schemaUri` +* xref:{cq-camel-components}:dataformats:dfdl-dataformat.adoc[DFDL data format] + +Please refer to the above links for usage and configuration details. + +[id="extensions-dfdl-maven-coordinates"] +== Maven coordinates + +[source,xml] +---- +<dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-dfdl</artifactId> +</dependency> +---- +ifeval::[{doc-show-user-guide-link} == true] +Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications. +endif::[] + +[id="extensions-dfdl-camel-quarkus-limitations"] +== Camel Quarkus limitations + +While `camel-dfdl` component requires Scala version 2.12, Quarkus BOM enforces Scala version 2.13, which causes `camel-dfdl` to fail. In order to make it work, the application POM needs to override the scala version. You can do that by adding `<dependencyManagement>` in your application POM: +[source,xml] +---- +<properties> + <scala.version>2.12.20</scala.version> +</properties> +... +<dependencyManagement> + <dependencies> + <dependency> + <groupId>org.scala-lang</groupId> + <artifactId>scala-library</artifactId> + <version>${scala.version}</version> + </dependency> + <dependency> + <groupId>org.scala-lang</groupId> + <artifactId>scala-reflect</artifactId> + <version>${scala.version}</version> + </dependency> + </dependencies> +</dependencyManagement> +---- + diff --git a/extensions-jvm/dfdl/deployment/pom.xml b/extensions-jvm/dfdl/deployment/pom.xml new file mode 100644 index 0000000000..23b08bb008 --- /dev/null +++ b/extensions-jvm/dfdl/deployment/pom.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-dfdl-parent</artifactId> + <version>3.22.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-dfdl-deployment</artifactId> + <name>Camel Quarkus :: DFDL :: Deployment</name> + + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-core-deployment</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-dfdl</artifactId> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <annotationProcessorPaths> + <path> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-extension-processor</artifactId> + <version>${quarkus.version}</version> + </path> + </annotationProcessorPaths> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/extensions-jvm/dfdl/deployment/src/main/java/org/apache/camel/quarkus/component/dfdl/deployment/DfdlProcessor.java b/extensions-jvm/dfdl/deployment/src/main/java/org/apache/camel/quarkus/component/dfdl/deployment/DfdlProcessor.java new file mode 100644 index 0000000000..fd9643f9d9 --- /dev/null +++ b/extensions-jvm/dfdl/deployment/src/main/java/org/apache/camel/quarkus/component/dfdl/deployment/DfdlProcessor.java @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.dfdl.deployment; + +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.annotations.ExecutionTime; +import io.quarkus.deployment.annotations.Record; +import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild; +import org.apache.camel.quarkus.core.JvmOnlyRecorder; +import org.jboss.logging.Logger; + +class DfdlProcessor { + + private static final Logger LOG = Logger.getLogger(DfdlProcessor.class); + private static final String FEATURE = "camel-dfdl"; + + @BuildStep + FeatureBuildItem feature() { + return new FeatureBuildItem(FEATURE); + } + + /** + * Remove this once this extension starts supporting the native mode. + */ + @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class) + @Record(value = ExecutionTime.RUNTIME_INIT) + void warnJvmInNative(JvmOnlyRecorder recorder) { + JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time + recorder.warnJvmInNative(FEATURE); // warn at runtime + } +} diff --git a/extensions-jvm/dfdl/pom.xml b/extensions-jvm/dfdl/pom.xml new file mode 100644 index 0000000000..787f49ddb1 --- /dev/null +++ b/extensions-jvm/dfdl/pom.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-extensions-jvm</artifactId> + <version>3.22.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-dfdl-parent</artifactId> + <name>Camel Quarkus :: DFDL</name> + <packaging>pom</packaging> + + <modules> + <module>deployment</module> + <module>runtime</module> + </modules> +</project> diff --git a/extensions-jvm/dfdl/runtime/pom.xml b/extensions-jvm/dfdl/runtime/pom.xml new file mode 100644 index 0000000000..45f71afc9f --- /dev/null +++ b/extensions-jvm/dfdl/runtime/pom.xml @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-dfdl-parent</artifactId> + <version>3.22.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-dfdl</artifactId> + <name>Camel Quarkus :: DFDL :: Runtime</name> + <description>Transforms fixed format data such as EDI message from/to XML using a Data Format Description Language (DFDL).</description> + + <properties> + <camel.quarkus.jvmSince>3.22.0</camel.quarkus.jvmSince> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-dfdl</artifactId> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-extension-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <annotationProcessorPaths> + <path> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-extension-processor</artifactId> + <version>${quarkus.version}</version> + </path> + </annotationProcessorPaths> + </configuration> + </plugin> + </plugins> + </build> + + + <profiles> + <profile> + <id>full</id> + <activation> + <property> + <name>!quickly</name> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-maven-plugin</artifactId> + <executions> + <execution> + <id>update-extension-doc-page</id> + <goals> + <goal>update-extension-doc-page</goal> + </goals> + <phase>process-classes</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> diff --git a/extensions-jvm/dfdl/runtime/src/main/doc/limitations.adoc b/extensions-jvm/dfdl/runtime/src/main/doc/limitations.adoc new file mode 100644 index 0000000000..ad97a17b3b --- /dev/null +++ b/extensions-jvm/dfdl/runtime/src/main/doc/limitations.adoc @@ -0,0 +1,22 @@ +While `camel-dfdl` component requires Scala version 2.12, Quarkus BOM enforces Scala version 2.13, which causes `camel-dfdl` to fail. In order to make it work, the application POM needs to override the scala version. You can do that by adding `<dependencyManagement>` in your application POM: +[source,xml] +---- +<properties> + <scala.version>2.12.20</scala.version> +</properties> +... +<dependencyManagement> + <dependencies> + <dependency> + <groupId>org.scala-lang</groupId> + <artifactId>scala-library</artifactId> + <version>${scala.version}</version> + </dependency> + <dependency> + <groupId>org.scala-lang</groupId> + <artifactId>scala-reflect</artifactId> + <version>${scala.version}</version> + </dependency> + </dependencies> +</dependencyManagement> +---- diff --git a/extensions-jvm/dfdl/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions-jvm/dfdl/runtime/src/main/resources/META-INF/quarkus-extension.yaml new file mode 100644 index 0000000000..e9636cf2a4 --- /dev/null +++ b/extensions-jvm/dfdl/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -0,0 +1,34 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# This is a generated file. Do not edit directly! +# To re-generate, run the following command from the top level directory: +# +# mvn -N cq:update-quarkus-metadata +# +--- +name: "Camel DFDL" +description: "Transforms fixed format data such as EDI message from/to XML using a Data Format Description Language (DFDL)" +metadata: + icon-url: "https://raw.githubusercontent.com/apache/camel-website/main/antora-ui-camel/src/img/logo-d.svg" + sponsor: "Apache Software Foundation" + unlisted: true + guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/dfdl.html" + categories: + - "integration" + status: + - "preview" diff --git a/extensions-jvm/pom.xml b/extensions-jvm/pom.xml index 92bc83596a..5e5ddd22b7 100644 --- a/extensions-jvm/pom.xml +++ b/extensions-jvm/pom.xml @@ -51,6 +51,7 @@ <module>cometd</module> <module>console</module> <module>couchbase</module> + <module>dfdl</module> <module>djl</module> <module>dns</module> <module>drill</module> diff --git a/integration-tests-jvm/dfdl/pom.xml b/integration-tests-jvm/dfdl/pom.xml new file mode 100644 index 0000000000..cc0e4164a0 --- /dev/null +++ b/integration-tests-jvm/dfdl/pom.xml @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-build-parent-it</artifactId> + <version>3.22.0-SNAPSHOT</version> + <relativePath>../../poms/build-parent-it/pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-integration-test-dfdl</artifactId> + <name>Camel Quarkus :: Integration Tests :: DFDL</name> + <description>Integration tests for Camel Quarkus DFDL extension</description> + + <dependencyManagement> + <dependencies> + <!-- Quarkus BOM enforces Scala 2.13 where Daffodil requires 2.12, need to override here --> + <dependency> + <groupId>org.scala-lang</groupId> + <artifactId>scala-library</artifactId> + <version>${dfdl-scala.version}</version> + </dependency> + <dependency> + <groupId>org.scala-lang</groupId> + <artifactId>scala-reflect</artifactId> + <version>${dfdl-scala.version}</version> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-direct</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-xml-jaxp</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-dfdl</artifactId> + </dependency> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-resteasy</artifactId> + </dependency> + + <!-- test dependencies --> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-junit5</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>io.rest-assured</groupId> + <artifactId>rest-assured</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.xmlunit</groupId> + <artifactId>xmlunit-core</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + + <profiles> + <profile> + <id>virtualDependencies</id> + <activation> + <property> + <name>!noVirtualDependencies</name> + </property> + </activation> + <dependencies> + <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory --> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-dfdl-deployment</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>*</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-direct-deployment</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>*</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-xml-jaxp-deployment</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>*</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + </profile> + </profiles> +</project> diff --git a/integration-tests-jvm/dfdl/src/main/java/org/apache/camel/quarkus/component/dfdl/it/DfdlResource.java b/integration-tests-jvm/dfdl/src/main/java/org/apache/camel/quarkus/component/dfdl/it/DfdlResource.java new file mode 100644 index 0000000000..35ea1d4e5e --- /dev/null +++ b/integration-tests-jvm/dfdl/src/main/java/org/apache/camel/quarkus/component/dfdl/it/DfdlResource.java @@ -0,0 +1,95 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.dfdl.it; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import org.apache.camel.CamelContext; +import org.apache.camel.FluentProducerTemplate; +import org.jboss.logging.Logger; + +@Path("/dfdl") +@ApplicationScoped +public class DfdlResource { + + private static final Logger LOG = Logger.getLogger(DfdlResource.class); + + private static final String COMPONENT_DFDL = "dfdl"; + private static final String DATAFORMAT_DFDL = "dfdl"; + @Inject + CamelContext context; + @Inject + FluentProducerTemplate fluentProducerTemplate; + + @Path("/load/component/dfdl") + @GET + @Produces(MediaType.TEXT_PLAIN) + public Response loadComponentDfdl() throws Exception { + /* This is an autogenerated test */ + if (context.getComponent(COMPONENT_DFDL) != null) { + return Response.ok().build(); + } + LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_DFDL); + return Response.status(500, COMPONENT_DFDL + " could not be loaded from the Camel context").build(); + } + + @Path("/parse") + @POST + @Produces(MediaType.TEXT_PLAIN) + public String parse(String ediString) throws Exception { + return fluentProducerTemplate.to("direct:parse").withBody(ediString).request(String.class); + } + + @Path("/unparse") + @POST + @Produces(MediaType.TEXT_PLAIN) + public String unparse(String xmlString) throws Exception { + return fluentProducerTemplate.to("direct:unparse").withBody(xmlString).request(String.class); + } + + @Path("/load/dataformat/dfdl") + @GET + @Produces(MediaType.TEXT_PLAIN) + public Response loadDataformatDfdl() throws Exception { + /* This is an autogenerated test */ + if (context.resolveDataFormat(DATAFORMAT_DFDL) != null) { + return Response.ok().build(); + } + LOG.warnf("Could not load [%s] from the Camel context", DATAFORMAT_DFDL); + return Response.status(500, DATAFORMAT_DFDL + " could not be loaded from the Camel context").build(); + } + + @Path("/marshal") + @POST + @Produces(MediaType.TEXT_PLAIN) + public String marshal(String xmlString) throws Exception { + return fluentProducerTemplate.to("direct:marshal").withBody(xmlString).request(String.class); + } + + @Path("/unmarshal") + @POST + @Produces(MediaType.TEXT_PLAIN) + public String unmarshal(String ediString) throws Exception { + return fluentProducerTemplate.to("direct:unmarshal").withBody(ediString).request(String.class); + } +} diff --git a/integration-tests-jvm/dfdl/src/main/java/org/apache/camel/quarkus/component/dfdl/it/DfdlRouteBuilder.java b/integration-tests-jvm/dfdl/src/main/java/org/apache/camel/quarkus/component/dfdl/it/DfdlRouteBuilder.java new file mode 100644 index 0000000000..7f348e7b3e --- /dev/null +++ b/integration-tests-jvm/dfdl/src/main/java/org/apache/camel/quarkus/component/dfdl/it/DfdlRouteBuilder.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.dfdl.it; + +import org.apache.camel.builder.RouteBuilder; + +public class DfdlRouteBuilder extends RouteBuilder { + + @Override + public void configure() throws Exception { + from("direct:parse").to("dfdl:X12-837P.dfdl.xsd"); + from("direct:unparse").to("dfdl:X12-837P.dfdl.xsd?parseDirection=UNPARSE"); + from("direct:marshal").marshal().dfdl("X12-837P.dfdl.xsd"); + from("direct:unmarshal").unmarshal().dfdl("X12-837P.dfdl.xsd"); + } + +} diff --git a/integration-tests-jvm/dfdl/src/main/resources/X12-837P.dfdl.xsd b/integration-tests-jvm/dfdl/src/main/resources/X12-837P.dfdl.xsd new file mode 100644 index 0000000000..2ddd6eba35 --- /dev/null +++ b/integration-tests-jvm/dfdl/src/main/resources/X12-837P.dfdl.xsd @@ -0,0 +1,1154 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"> + + <xs:annotation> + <xs:appinfo source="http://www.ogf.org/dfdl/"> + <dfdl:defineVariable defaultValue="~%NL; ~" name="SegmentTerminator" type="xs:string" /> + <dfdl:defineVariable + defaultValue="*" name="FieldSeparator" type="xs:string" /> + <!-- ISA-16 is supposed to override this --> + <dfdl:defineVariable + defaultValue=":" name="CompositeSeparator" type="xs:string" /> + <dfdl:defineVariable + defaultValue="." name="DecimalSeparator" type="xs:string" /> + <dfdl:format + encoding="UTF-8" + ignoreCase="no" + byteOrder="{$dfdl:byteOrder}" + representation="text" + textStringJustification="left" + truncateSpecifiedLengthString="no" + decimalSigned="yes" + textNumberCheckPolicy="lax" + textNumberJustification="right" + textZonedSignStyle="asciiStandard" + textBooleanJustification="left" + sequenceKind="ordered" + choiceLengthKind="implicit" + separator="" separatorSuppressionPolicy="trailingEmpty" separatorPosition="infix" + initiator="" + terminator="" + documentFinalTerminatorCanBeMissing="no" + lengthUnits="characters" + lengthKind="delimited" + textPadKind="none" + textTrimKind="none" + textStringPadCharacter="%SP;" + textNumberPadCharacter="%SP;" + textBooleanPadCharacter="%SP;" + textStandardBase="10" + textStandardDecimalSeparator="{$DecimalSeparator}" + textStandardExponentCharacter="E" + alignment="1" alignmentUnits="bytes" leadingSkip="0" trailingSkip="0" fillByte="0" + initiatedContent="no" + textNumberRep="standard" + textStandardZeroRep="" + textNumberRoundingMode="roundUp" + nilValueDelimiterPolicy="none" + emptyValueDelimiterPolicy="none" + textStandardInfinityRep="Inf" + textStandardNaNRep="NaN" + textNumberRounding="pattern" + calendarPatternKind="implicit" + calendarPattern="yyyy-MM-dd'T'HH:mm:ss" + calendarCheckPolicy="lax" + calendarTimeZone="UTC" + calendarObserveDST="yes" + calendarFirstDayOfWeek="Monday" + calendarDaysInFirstWeek="4" + calendarCenturyStart="53" + calendarLanguage="en-US" + textCalendarJustification="left" + textBooleanTrueRep="true" + textBooleanFalseRep="false" + textCalendarPadCharacter="%SP;" + occursCountKind="implicit" + outputNewLine="%CR;%LF;" + binaryFloatRep="ieee" + textBidi="no" + nilKind="literalValue" + useNilForDefault="no" + floating="no" + /> + <dfdl:defineFormat name="SegmentFormat"> + <dfdl:format terminator="{$SegmentTerminator}" emptyValueDelimiterPolicy="both" /> + </dfdl:defineFormat> + <dfdl:defineFormat + name="SegmentSequenceFormat"> + <dfdl:format terminator="" separator="{$FieldSeparator}" separatorPosition="prefix" + /> + </dfdl:defineFormat> + <dfdl:defineFormat + name="CompositeSequenceFormat"> + <dfdl:format terminator="" separator="{$CompositeSeparator}" + separatorPosition="infix" /> + </dfdl:defineFormat> + </xs:appinfo> + </xs:annotation> + + <!-- Root Element: X12_837P --> + <xs:element name="X12_837P"> + <xs:complexType> + <xs:sequence> + <!-- Header --> + <xs:element name="Header"> + <xs:complexType> + <xs:sequence> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="ISA" name="ISA" + type="ISAType" minOccurs="1" maxOccurs="1" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="GS" name="GS" + type="GSType" minOccurs="1" maxOccurs="1" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="ST" name="ST" + type="STType" minOccurs="1" maxOccurs="1" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="BHT" name="BHT" + type="BHTType" minOccurs="1" maxOccurs="1" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="REF" name="REF" + type="REFType" minOccurs="0" maxOccurs="3" /> + </xs:sequence> + <xs:element name="Loop1000" minOccurs="0" maxOccurs="10"> + <xs:complexType> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="NM1" + name="NM1" minOccurs="1" maxOccurs="1" type="NM1Type" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="N2" + name="N2" minOccurs="0" maxOccurs="2" type="N2Type" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="N3" + name="N3" minOccurs="0" maxOccurs="2" type="N3Type" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="N4" + name="N4" minOccurs="0" maxOccurs="1" type="N4Type" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="REF" + name="REF" minOccurs="0" maxOccurs="2" type="REFType" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="PER" + name="PER" minOccurs="0" maxOccurs="2" type="PERType" /> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + + <!-- Claim Information --> + <xs:element name="Loop2000" minOccurs="1" maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="HL" name="HL" + minOccurs="1" maxOccurs="1" type="HLType" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="PRV" name="PRV" + minOccurs="0" maxOccurs="1" type="PRVType" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="SBR" name="SBR" + minOccurs="0" maxOccurs="1" type="SBRType" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="PAT" name="PAT" + minOccurs="0" maxOccurs="1" type="PATType" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="DTP" name="DTP" + minOccurs="0" maxOccurs="1" type="DTPType" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="CUR" name="CUR" + minOccurs="0" maxOccurs="1" type="CURType" /> + </xs:sequence> + <xs:element name="Loop2010" minOccurs="0" maxOccurs="10"> + <xs:complexType> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="NM1" + name="NM1" minOccurs="1" maxOccurs="1" type="NM1Type" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="N2" + name="N2" minOccurs="0" maxOccurs="2" type="N2Type" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="N3" + name="N3" minOccurs="0" maxOccurs="2" type="N3Type" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="N4" + name="N4" minOccurs="0" maxOccurs="1" type="N4Type" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="DMG" + name="DMG" minOccurs="0" maxOccurs="1" type="DMGType" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="REF" + name="REF" minOccurs="0" maxOccurs="20" type="REFType" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="PER" + name="PER" minOccurs="0" maxOccurs="2" type="PERType" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="LUI" + name="LUI" minOccurs="0" maxOccurs="1" type="LUIType" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="Loop2300" minOccurs="0" maxOccurs="100"> + <xs:complexType> + <xs:sequence> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CLM" + name="CLM" minOccurs="1" maxOccurs="1" + type="CLMType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="DTP" + name="DTP" minOccurs="0" maxOccurs="150" + type="DTPType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CL1" + name="CL1" minOccurs="0" maxOccurs="1" + type="CL1Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="DN1" + name="DN1" minOccurs="0" maxOccurs="1" + type="DN1Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="DN2" + name="DN2" minOccurs="0" maxOccurs="35" + type="DN2Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="PWK" + name="PWK" minOccurs="0" maxOccurs="10" + type="PWKType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CN1" + name="CN1" minOccurs="0" maxOccurs="1" + type="CN1Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="DSB" + name="DSB" minOccurs="0" maxOccurs="1" + type="DSBType" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="UR" + name="UR" minOccurs="0" maxOccurs="1" type="URType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="AMT" + name="AMT" minOccurs="0" maxOccurs="40" + type="AMTType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="REF" + name="REF" minOccurs="0" maxOccurs="30" + type="REFType" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="K3" + name="K3" minOccurs="0" maxOccurs="10" type="K3Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="NTE" + name="NTE" minOccurs="0" maxOccurs="20" + type="NTEType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CR1" + name="CR1" minOccurs="0" maxOccurs="1" + type="CR1Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CR2" + name="CR2" minOccurs="0" maxOccurs="1" + type="CR2Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CR3" + name="CR3" minOccurs="0" maxOccurs="1" + type="CR3Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CR4" + name="CR4" minOccurs="0" maxOccurs="3" + type="CR4Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CR5" + name="CR5" minOccurs="0" maxOccurs="1" + type="CR5Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CR6" + name="CR6" minOccurs="0" maxOccurs="1" + type="CR6Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CR8" + name="CR8" minOccurs="0" maxOccurs="9" + type="CR8Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CRC" + name="CRC" minOccurs="0" maxOccurs="100" + type="CRCType" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="HI" + name="HI" minOccurs="0" maxOccurs="25" type="HIType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="QTY" + name="QTY" minOccurs="0" maxOccurs="10" + type="QTYType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="HCP" name="HCP" minOccurs="0" + maxOccurs="1" type="HCPType" /> + </xs:sequence> + <xs:element name="Loop2305" minOccurs="0" maxOccurs="6"> + <xs:complexType> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CR7" name="CR7" + minOccurs="1" maxOccurs="1" type="CR7Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="HSD" name="HSD" + minOccurs="0" maxOccurs="12" type="HSDType" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="Loop2310" minOccurs="0" maxOccurs="9"> + <xs:complexType> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="NM1" name="NM1" + minOccurs="1" maxOccurs="1" type="NM1Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="PRV" name="PRV" + minOccurs="0" maxOccurs="1" type="PRVType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="N2" name="N2" + minOccurs="0" maxOccurs="2" type="N2Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="N3" name="N3" + minOccurs="0" maxOccurs="2" type="N3Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="N4" name="N4" + minOccurs="0" maxOccurs="1" type="N4Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="REF" name="REF" + minOccurs="0" maxOccurs="20" type="REFType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="PER" name="PER" + minOccurs="0" maxOccurs="2" type="PERType" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="Loop2320" minOccurs="0" maxOccurs="10"> + <xs:complexType> + <xs:sequence> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="SBR" name="SBR" + minOccurs="1" maxOccurs="1" + type="SBRType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CAS" name="CAS" + minOccurs="0" maxOccurs="99" + type="CASType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="RAS" name="RAS" + minOccurs="0" maxOccurs="99" + type="RASType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="AMT" name="AMT" + minOccurs="0" maxOccurs="15" + type="AMTType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="DMG" name="DMG" + minOccurs="0" maxOccurs="1" + type="DMGType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="DI" name="OI" + minOccurs="0" maxOccurs="1" + type="OIType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="MIA" name="MIA" + minOccurs="0" maxOccurs="1" + type="MIAType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="MOA" name="MOA" + minOccurs="0" maxOccurs="1" + type="MOAType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="HI" name="HI" + minOccurs="0" maxOccurs="1" + type="HIType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="LQ" name="LQ" + minOccurs="0" maxOccurs="99" + type="LQType" /> + </xs:sequence> + <xs:element name="Loop2330" minOccurs="0" + maxOccurs="10"> + <xs:complexType> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="NM1" + name="MN1" minOccurs="1" + maxOccurs="1" type="NM1Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="N2" + name="N2" minOccurs="0" + maxOccurs="2" type="N2Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="N3" + name="N3" minOccurs="0" + maxOccurs="2" type="N3Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="N4" + name="N4" minOccurs="0" + maxOccurs="1" type="N4Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="PER" + name="PER" minOccurs="0" + maxOccurs="2" type="PERType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="DTP" + name="DTP" minOccurs="0" + maxOccurs="9" type="DTPType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="REF" + name="REF" minOccurs="0" + maxOccurs="99" type="REFType" /> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="Loop2400" minOccurs="0" + maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="LX" name="LX" + minOccurs="1" maxOccurs="1" + type="LXType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="SV1" name="SV1" + minOccurs="0" maxOccurs="1" + type="SV1Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="SV2" name="SV2" + minOccurs="0" maxOccurs="1" + type="SV2Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="SV3" name="SV3" + minOccurs="0" maxOccurs="1" + type="SV3Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="TOO" name="TOO" + minOccurs="0" maxOccurs="32" + type="TOOType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="SV4" name="SV4" + minOccurs="0" maxOccurs="1" + type="SV4Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="SV5" name="SV5" + minOccurs="0" maxOccurs="1" + type="SV5Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="SV6" name="SV6" + minOccurs="0" maxOccurs="1" + type="SV6Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="SV7" name="SV7" + minOccurs="0" maxOccurs="1" + type="SV7Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="HI" name="HI" + minOccurs="0" maxOccurs="25" + type="HIType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="PWK" name="PWK" + minOccurs="0" maxOccurs="10" + type="PWKType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CR1" name="CR1" + minOccurs="0" maxOccurs="1" + type="CR1Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CR2" name="CR2" + minOccurs="0" maxOccurs="5" + type="CR2Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CR3" name="CR3" + minOccurs="0" maxOccurs="1" + type="CR3Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CR4" name="CR4" + minOccurs="0" maxOccurs="3" + type="CR4Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CR5" name="CR5" + minOccurs="0" maxOccurs="1" + type="CR5Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CRC" name="CRC" + minOccurs="0" maxOccurs="3" + type="CRCType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="DTP" name="DTP" + minOccurs="0" maxOccurs="15" + type="DTPType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="QTY" name="QTY" + minOccurs="0" maxOccurs="5" + type="QTYType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="MEA" name="MEA" + minOccurs="0" maxOccurs="20" + type="MEAType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CN1" name="CN1" + minOccurs="0" maxOccurs="1" + type="CN1Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="REF" name="REF" + minOccurs="0" maxOccurs="30" + type="REFType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="AMT" name="AMT" + minOccurs="0" maxOccurs="15" + type="AMTType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="K3" name="K3" + minOccurs="0" maxOccurs="10" + type="K3Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="NTE" name="NTE" + minOccurs="0" maxOccurs="10" + type="NTEType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="PS1" name="PS1" + minOccurs="0" maxOccurs="1" + type="PS1Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="IMM" name="IMM" + minOccurs="0" maxOccurs="unbounded" + type="IMMType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="HSD" name="HSD" + minOccurs="0" maxOccurs="1" + type="HSDType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="HCP" name="HCP" + minOccurs="0" maxOccurs="1" + type="HCPType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CR8" name="CR8" + minOccurs="0" maxOccurs="unbounded" + type="CR8Type" /> + </xs:sequence> + <xs:element name="Loop2410" minOccurs="0" + maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="LIN" + name="LIN" minOccurs="1" + maxOccurs="1" type="LINType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CTP" + name="CTP" minOccurs="0" + maxOccurs="1" type="CTPType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="REF" + name="REF" minOccurs="0" + maxOccurs="1" type="REFType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="SV4" + name="SV4" minOccurs="0" + maxOccurs="1" type="SV4Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="SV7" + name="SV7" minOccurs="0" + maxOccurs="1" type="SV7Type" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="Loop2420" minOccurs="0" + maxOccurs="10"> + <xs:complexType> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="NM1" + name="NM1" minOccurs="1" + maxOccurs="1" type="NM1Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="PRV" + name="PRV" minOccurs="0" + maxOccurs="1" type="PRVType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="N2" + name="N2" minOccurs="0" + maxOccurs="2" type="N2Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="N3" + name="N3" minOccurs="0" + maxOccurs="2" type="N3Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="N4" + name="N4" minOccurs="0" + maxOccurs="1" type="N4Type" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="REF" + name="REF" minOccurs="0" + maxOccurs="20" type="REFType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="PER" + name="PER" minOccurs="0" + maxOccurs="2" type="PERType" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="Loop2430" minOccurs="0" + maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="SVD" + name="SVD" minOccurs="1" + maxOccurs="1" type="SVDType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="CAS" + name="CAS" minOccurs="0" + maxOccurs="99" type="CASType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="RAS" + name="RAS" minOccurs="0" + maxOccurs="99" type="RASType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="DTP" + name="DTP" minOccurs="0" + maxOccurs="9" type="DTPType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="AMT" + name="AMT" minOccurs="0" + maxOccurs="20" type="AMTType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="LQ" + name="LQ" minOccurs="0" + maxOccurs="99" type="LQType" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="LS" name="LS" + minOccurs="0" maxOccurs="1" + type="LSType" /> + </xs:sequence> + <xs:element name="Loop2440" minOccurs="0" + maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="LQ" + name="LQ" minOccurs="1" + maxOccurs="1" type="LQType" /> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="FRM" + name="FRM" minOccurs="1" + maxOccurs="99" type="FRMType" /> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" + dfdl:initiator="LE" name="LE" + minOccurs="0" maxOccurs="1" + type="LEType" /> + </xs:sequence> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + + <!-- Trailer --> + <xs:sequence dfdl:initiatedContent="yes"> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="SE" name="SE" type="SEType" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="GE" name="GE" type="GEType" /> + <xs:element dfdl:ref="SegmentFormat" dfdl:initiator="IEA" name="IEA" type="IEAType" /> + </xs:sequence> + </xs:sequence> + </xs:complexType> + </xs:element> + + <!-- Segment Types --> + <xs:complexType name="AMTType"> + <xs:sequence></xs:sequence> + </xs:complexType> + <xs:complexType name="BHTType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="BHT-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="BHT-02" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="BHT-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="BHT-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="BHT-05" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="BHT-06" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="CASType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="CLMType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="CLM-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="CLM-02" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-05" minOccurs="0" maxOccurs="1" type="C023Type" /> + <xs:element name="CLM-06" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-07" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-08" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-09" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-10" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-11" minOccurs="0" maxOccurs="1" type="C024Type" /> + <xs:element name="CLM-12" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-13" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-14" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-15" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-16" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-17" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-18" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-19" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-20" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="CLM-21" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="CL1Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="CN1Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="CR1Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="CR2Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="CR3Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="CR4Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="CR5Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="CR6Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="CR7Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="CR8Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="CRCType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="CTPType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="CURType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="DMGType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="DMG-01" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="DMG-02" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="DMG-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="DMG-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="DMG-05" minOccurs="0" maxOccurs="1" type="C056Type" /> + <xs:element name="DMG-06" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="DMG-07" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="DMG-08" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="DMG-09" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="DMG-10" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="DMG-11" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="DMG-12" type="xs:string" minOccurs="0" maxOccurs="1" /> + + </xs:sequence> + </xs:complexType> + <xs:complexType name="DN1Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="DN2Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="DSBType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="DTPType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="DTP-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="DTP-02" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="DTP-03" type="xs:string" minOccurs="1" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="FRMType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="GEType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="GE-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="GE-02" type="xs:string" minOccurs="1" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="GSType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="GS-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="GS-02" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="GS-03" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="GS-04" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="GS-05" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="GS-06" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="GS-07" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="GS-08" type="xs:string" minOccurs="1" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="HCPType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="HIType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="HI-01" minOccurs="1" maxOccurs="1" type="C022Type" /> + <xs:element name="HI-02" minOccurs="0" maxOccurs="1" type="C022Type" /> + <xs:element name="HI-03" minOccurs="0" maxOccurs="1" type="C022Type" /> + <xs:element name="HI-04" minOccurs="0" maxOccurs="1" type="C022Type" /> + <xs:element name="HI-05" minOccurs="0" maxOccurs="1" type="C022Type" /> + <xs:element name="HI-06" minOccurs="0" maxOccurs="1" type="C022Type" /> + <xs:element name="HI-07" minOccurs="0" maxOccurs="1" type="C022Type" /> + <xs:element name="HI-08" minOccurs="0" maxOccurs="1" type="C022Type" /> + <xs:element name="HI-09" minOccurs="0" maxOccurs="1" type="C022Type" /> + <xs:element name="HI-10" minOccurs="0" maxOccurs="1" type="C022Type" /> + <xs:element name="HI-11" minOccurs="0" maxOccurs="1" type="C022Type" /> + <xs:element name="HI-12" minOccurs="0" maxOccurs="1" type="C022Type" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="HLType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="HL-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="HL-02" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="HL-03" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="HL-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="HSDType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="IEAType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="IEA-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="IEA-02" type="xs:string" minOccurs="1" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="IMMType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="ISAType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="ISA-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-02" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-03" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-04" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-05" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-06" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-07" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-08" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-09" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-10" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-11" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-12" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-13" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-14" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-15" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ISA-16" type="xs:string" minOccurs="1" maxOccurs="1"> + <xs:annotation> + <xs:appinfo source="http://www.ogf.org/dfdl/"> + <dfdl:setVariable ref="CompositeSeparator" value="{.}" /> + </xs:appinfo> + </xs:annotation> + </xs:element> + </xs:sequence> + </xs:complexType> + <xs:complexType name="K3Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="LEType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="LINType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="LQType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="LSType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="LUIType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="LXType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="LX-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="MEAType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="MIAType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="MOAType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="NM1Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="NM1-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="NM1-02" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="NM1-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="NM1-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="NM1-05" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="NM1-06" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="NM1-07" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="NM1-08" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="NM1-09" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="NM1-10" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="NM1-11" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="NM1-12" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="NTEType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="N2Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="N3Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="N3-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="N3-02" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="N4Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="N4-01" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="N4-02" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="N4-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="N4-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="N4-05" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="N4-06" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="N4-07" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="N4-08" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="OIType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="PATType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="PAT-01" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PAT-02" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PAT-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PAT-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PAT-05" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PAT-06" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PAT-07" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PAT-08" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PAT-09" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="PERType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="PER-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="PER-02" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PER-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PER-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PER-05" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PER-06" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PER-07" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PER-08" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PER-09" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="PRVType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="PRV-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="PRV-02" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PRV-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PRV-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="PRV-05" minOccurs="0" maxOccurs="1" type="C035Type" /> + <xs:element name="PRV-06" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="PS1Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="PWKType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="QTYType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="RASType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="REFType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="REF-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="REF-02" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="REF-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="REF-04" type="C040Type" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="STType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="ST-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ST-02" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="ST-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="SBRType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="SBR-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="SBR-02" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SBR-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SBR-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SBR-05" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SBR-06" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SBR-07" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SBR-08" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SBR-09" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SBR-10" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="SEType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="SE-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="SE-02" type="xs:string" minOccurs="1" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="SVDType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="SV1Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"> + <xs:element name="SV1-01" type="C003Type" minOccurs="1" maxOccurs="1" /> + <xs:element name="SV1-02" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-05" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-06" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-07" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-08" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-09" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-10" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-11" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-12" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-13" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-14" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-15" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-16" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-17" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-18" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-19" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-20" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="SV1-21" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="SV2Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="SV3Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="SV4Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="SV5Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="SV6Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="SV7Type"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="TOOType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + <xs:complexType name="URType"> + <xs:sequence dfdl:ref="SegmentSequenceFormat"></xs:sequence> + </xs:complexType> + + <!-- Element Types, mostly composite elements --> + <xs:complexType name="C003Type"> + <xs:sequence dfdl:ref="CompositeSequenceFormat"> + <xs:element name="C003-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="C003-02" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="C003-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C003-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C003-05" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C003-06" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C003-07" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C003-08" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C003-09" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C003-10" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C003-11" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C003-12" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="C022Type"> + <xs:sequence dfdl:ref="CompositeSequenceFormat"> + <xs:element name="C022-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="C022-02" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="C022-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C022-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C022-05" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C022-06" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C022-07" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C022-08" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C022-09" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C022-10" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="C023Type"> + <xs:sequence dfdl:ref="CompositeSequenceFormat"> + <xs:element name="C023-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="C023-02" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="C023-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="C024Type"> + <xs:sequence dfdl:ref="CompositeSequenceFormat"> + <xs:element name="C024-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="C024-02" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C024-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C024-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C024-05" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="C035Type"> + <xs:sequence dfdl:ref="CompositeSequenceFormat"> + <xs:element name="C035-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="C035-02" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C035-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="C040Type"> + <xs:sequence dfdl:ref="CompositeSequenceFormat"> + <xs:element name="C040-01" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="C040-02" type="xs:string" minOccurs="1" maxOccurs="1" /> + <xs:element name="C040-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C040-04" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C040-05" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C040-06" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="C056Type"> + <xs:sequence dfdl:ref="CompositeSequenceFormat"> + <xs:element name="C056-01" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C056-02" type="xs:string" minOccurs="0" maxOccurs="1" /> + <xs:element name="C056-03" type="xs:string" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> +</xs:schema> \ No newline at end of file diff --git a/integration-tests-jvm/dfdl/src/test/java/org/apache/camel/quarkus/component/dfdl/it/DfdlTest.java b/integration-tests-jvm/dfdl/src/test/java/org/apache/camel/quarkus/component/dfdl/it/DfdlTest.java new file mode 100644 index 0000000000..c8599e0deb --- /dev/null +++ b/integration-tests-jvm/dfdl/src/test/java/org/apache/camel/quarkus/component/dfdl/it/DfdlTest.java @@ -0,0 +1,96 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.dfdl.it; + +import java.nio.charset.StandardCharsets; + +import io.quarkus.test.junit.QuarkusTest; +import io.restassured.RestAssured; +import org.apache.commons.io.IOUtils; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.xmlunit.builder.DiffBuilder; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; + +@QuarkusTest +class DfdlTest { + private static String EDI_STRING; + private static String XML_STRING; + + @BeforeAll + public static void beforeAll() throws Exception { + var ediStream = DfdlTest.class.getResourceAsStream("/X12-837P-message.edi.txt"); + EDI_STRING = IOUtils.toString(ediStream, StandardCharsets.UTF_8); + var xmlStream = DfdlTest.class.getResourceAsStream("/X12-837P-message.xml"); + XML_STRING = IOUtils.toString(xmlStream, StandardCharsets.UTF_8); + } + + @Test + public void loadComponentDfdl() { + /* A simple autogenerated test */ + RestAssured.get("/dfdl/load/component/dfdl") + .then() + .statusCode(200); + } + + @Test + public void testParse() { + var response = RestAssured.given().body(EDI_STRING).post("/dfdl/parse").asString(); + assertFalse(DiffBuilder.compare(XML_STRING).withTest(response).ignoreComments().ignoreWhitespace().build() + .hasDifferences()); + } + + @Test + public void testUnparse() { + var response = RestAssured.given().body(XML_STRING).post("/dfdl/unparse").asString(); + var testArray = response.split("\\r?\\n|\\r"); + var compArray = EDI_STRING.split("\\r?\\n|\\r"); + assertEquals(compArray.length, testArray.length); + for (int i = 0; i < testArray.length; i++) { + assertEquals(compArray[i], testArray[i], "Line " + i); + } + } + + @Test + public void loadDataformatDfdl() { + /* A simple autogenerated test */ + RestAssured.get("/dfdl/load/dataformat/dfdl") + .then() + .statusCode(200); + } + + @Test + public void testMarshal() { + var response = RestAssured.given().body(XML_STRING).post("/dfdl/marshal").asString(); + var testArray = response.split("\\r?\\n|\\r"); + var compArray = EDI_STRING.split("\\r?\\n|\\r"); + assertEquals(compArray.length, testArray.length); + for (int i = 0; i < testArray.length; i++) { + assertEquals(compArray[i], testArray[i], "Line " + i); + } + } + + @Test + public void testUnmarshal() { + var response = RestAssured.given().body(EDI_STRING).post("/dfdl/unmarshal").asString(); + assertFalse(DiffBuilder.compare(XML_STRING).withTest(response).ignoreComments().ignoreWhitespace().build() + .hasDifferences()); + } + +} diff --git a/integration-tests-jvm/dfdl/src/test/resources/X12-837P-message.edi.txt b/integration-tests-jvm/dfdl/src/test/resources/X12-837P-message.edi.txt new file mode 100644 index 0000000000..510e1a808e --- /dev/null +++ b/integration-tests-jvm/dfdl/src/test/resources/X12-837P-message.edi.txt @@ -0,0 +1,46 @@ +ISA*00* *00* *ZZ*PREMIER BILLING SERVICE *ZZ*KEY INSURANCE COMPANY *20061015*1023*U*005010X222*000000001*0*P*:~ +GS*HP*PREMIER BILLING SERVICE*KEY INSURANCE COMPANY*20061015*1023*1*X*005010X222~ +ST*837*0021*005010X222~ +BHT*0019*00*244579*20061015*1023*CH~ +NM1*41*2*PREMIER BILLING SERVICE*****46*TGJ23~ +PER*IC*JERRY*TE*3055552222*EX*231~ +NM1*40*2*KEY INSURANCE COMPANY*****46*66783JJT~ +HL*1**20*1~ +PRV*BI*PXC*203BF0100Y~ +NM1*85*2*BEN KILDARE SERVICE*****XX*9876543210~ +N3*234 SEAWAY ST~ +N4*MIAMI*FL*33111~ +REF*EI*587654321~ +NM1*87*2~ +N3*2345 OCEAN BLVD~ +N4*MIAMI*FL*33111~ +HL*2*1*22*1~ +SBR*P**2222-SJ******CI~ +NM1*IL*1*SMITH*JANE****MI*JS00111223333~ +DMG*D8*19430501*F~ +NM1*PR*2*KEY INSURANCE COMPANY*****PI*999996666~ +REF*G2*KA6663~ +HL*3*2*23*0~ +PAT*19~ +NM1*QC*1*SMITH*TED~ +N3*236 N MAIN ST~ +N4*MIAMI*FL*33413~ +DMG*D8*19730501*M~ +CLM*26463774*100***11:B:1*Y*A*Y*I~ +REF*D9*17312345600006351~ +HI*BK:0340*BF:V7389~ +LX*1~ +SV1*HC:99213*40*UN*1***1~ +DTP*472*D8*20061003~ +LX*2~ +SV1*HC:87070*15*UN*1***1~ +DTP*472*D8*20061003~ +LX*3~ +SV1*HC:99214*35*UN*1***2~ +DTP*472*D8*20061010~ +LX*4~ +SV1*HC:86663*10*UN*1***2~ +DTP*472*D8*20061010~ +SE*42*0021~ +GE*1*1~ +IEA*1*000000001~ \ No newline at end of file diff --git a/integration-tests-jvm/dfdl/src/test/resources/X12-837P-message.xml b/integration-tests-jvm/dfdl/src/test/resources/X12-837P-message.xml new file mode 100644 index 0000000000..1759e7467d --- /dev/null +++ b/integration-tests-jvm/dfdl/src/test/resources/X12-837P-message.xml @@ -0,0 +1,330 @@ +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<X12_837P> + <Header> + <ISA> + <ISA-01>00</ISA-01> + <ISA-02> </ISA-02> + <ISA-03>00</ISA-03> + <ISA-04> </ISA-04> + <ISA-05>ZZ</ISA-05> + <ISA-06>PREMIER BILLING SERVICE </ISA-06> + <ISA-07>ZZ</ISA-07> + <ISA-08>KEY INSURANCE COMPANY </ISA-08> + <ISA-09>20061015</ISA-09> + <ISA-10>1023</ISA-10> + <ISA-11>U</ISA-11> + <ISA-12>005010X222</ISA-12> + <ISA-13>000000001</ISA-13> + <ISA-14>0</ISA-14> + <ISA-15>P</ISA-15> + <ISA-16>:</ISA-16> + </ISA> + <GS> + <GS-01>HP</GS-01> + <GS-02>PREMIER BILLING SERVICE</GS-02> + <GS-03>KEY INSURANCE COMPANY</GS-03> + <GS-04>20061015</GS-04> + <GS-05>1023</GS-05> + <GS-06>1</GS-06> + <GS-07>X</GS-07> + <GS-08>005010X222</GS-08> + </GS> + <ST> + <ST-01>837</ST-01> + <ST-02>0021</ST-02> + <ST-03>005010X222</ST-03> + </ST> + <BHT> + <BHT-01>0019</BHT-01> + <BHT-02>00</BHT-02> + <BHT-03>244579</BHT-03> + <BHT-04>20061015</BHT-04> + <BHT-05>1023</BHT-05> + <BHT-06>CH</BHT-06> + </BHT> + <Loop1000> + <NM1> + <NM1-01>41</NM1-01> + <NM1-02>2</NM1-02> + <NM1-03>PREMIER BILLING SERVICE</NM1-03> + <NM1-08>46</NM1-08> + <NM1-09>TGJ23</NM1-09> + </NM1> + <PER> + <PER-01>IC</PER-01> + <PER-02>JERRY</PER-02> + <PER-03>TE</PER-03> + <PER-04>3055552222</PER-04> + <PER-05>EX</PER-05> + <PER-06>231</PER-06> + </PER> + </Loop1000> + <Loop1000> + <NM1> + <NM1-01>40</NM1-01> + <NM1-02>2</NM1-02> + <NM1-03>KEY INSURANCE COMPANY</NM1-03> + <NM1-08>46</NM1-08> + <NM1-09>66783JJT</NM1-09> + </NM1> + </Loop1000> + </Header> + <Loop2000> + <HL> + <HL-01>1</HL-01> + <HL-03>20</HL-03> + <HL-04>1</HL-04> + </HL> + <PRV> + <PRV-01>BI</PRV-01> + <PRV-02>PXC</PRV-02> + <PRV-03>203BF0100Y</PRV-03> + </PRV> + <Loop2010> + <NM1> + <NM1-01>85</NM1-01> + <NM1-02>2</NM1-02> + <NM1-03>BEN KILDARE SERVICE</NM1-03> + <NM1-08>XX</NM1-08> + <NM1-09>9876543210</NM1-09> + </NM1> + <N3> + <N3-01>234 SEAWAY ST</N3-01> + </N3> + <N4> + <N4-01>MIAMI</N4-01> + <N4-02>FL</N4-02> + <N4-03>33111</N4-03> + </N4> + <REF> + <REF-01>EI</REF-01> + <REF-02>587654321</REF-02> + </REF> + </Loop2010> + <Loop2010> + <NM1> + <NM1-01>87</NM1-01> + <NM1-02>2</NM1-02> + </NM1> + <N3> + <N3-01>2345 OCEAN BLVD</N3-01> + </N3> + <N4> + <N4-01>MIAMI</N4-01> + <N4-02>FL</N4-02> + <N4-03>33111</N4-03> + </N4> + </Loop2010> + </Loop2000> + <Loop2000> + <HL> + <HL-01>2</HL-01> + <HL-02>1</HL-02> + <HL-03>22</HL-03> + <HL-04>1</HL-04> + </HL> + <SBR> + <SBR-01>P</SBR-01> + <SBR-03>2222-SJ</SBR-03> + <SBR-09>CI</SBR-09> + </SBR> + <Loop2010> + <NM1> + <NM1-01>IL</NM1-01> + <NM1-02>1</NM1-02> + <NM1-03>SMITH</NM1-03> + <NM1-04>JANE</NM1-04> + <NM1-08>MI</NM1-08> + <NM1-09>JS00111223333</NM1-09> + </NM1> + <DMG> + <DMG-01>D8</DMG-01> + <DMG-02>19430501</DMG-02> + <DMG-03>F</DMG-03> + </DMG> + </Loop2010> + <Loop2010> + <NM1> + <NM1-01>PR</NM1-01> + <NM1-02>2</NM1-02> + <NM1-03>KEY INSURANCE COMPANY</NM1-03> + <NM1-08>PI</NM1-08> + <NM1-09>999996666</NM1-09> + </NM1> + <REF> + <REF-01>G2</REF-01> + <REF-02>KA6663</REF-02> + </REF> + </Loop2010> + </Loop2000> + <Loop2000> + <HL> + <HL-01>3</HL-01> + <HL-02>2</HL-02> + <HL-03>23</HL-03> + <HL-04>0</HL-04> + </HL> + <PAT> + <PAT-01>19</PAT-01> + </PAT> + <Loop2010> + <NM1> + <NM1-01>QC</NM1-01> + <NM1-02>1</NM1-02> + <NM1-03>SMITH</NM1-03> + <NM1-04>TED</NM1-04> + </NM1> + <N3> + <N3-01>236 N MAIN ST</N3-01> + </N3> + <N4> + <N4-01>MIAMI</N4-01> + <N4-02>FL</N4-02> + <N4-03>33413</N4-03> + </N4> + <DMG> + <DMG-01>D8</DMG-01> + <DMG-02>19730501</DMG-02> + <DMG-03>M</DMG-03> + </DMG> + </Loop2010> + <Loop2300> + <CLM> + <CLM-01>26463774</CLM-01> + <CLM-02>100</CLM-02> + <CLM-05> + <C023-01>11</C023-01> + <C023-02>B</C023-02 + ><C023-03>1</C023-03> + </CLM-05> + <CLM-06>Y</CLM-06> + <CLM-07>A</CLM-07> + <CLM-08>Y</CLM-08> + <CLM-09>I</CLM-09> + </CLM> + <REF> + <REF-01>D9</REF-01> + <REF-02>17312345600006351</REF-02> + </REF> + <HI> + <HI-01> + <C022-01>BK</C022-01> + <C022-02>0340</C022-02> + </HI-01> + <HI-02> + <C022-01>BF</C022-01> + <C022-02>V7389</C022-02> + </HI-02> + </HI> + <Loop2400> + <LX> + <LX-01>1</LX-01> + </LX> + <SV1> + <SV1-01> + <C003-01>HC</C003-01> + <C003-02>99213</C003-02> + </SV1-01> + <SV1-02>40</SV1-02> + <SV1-03>UN</SV1-03> + <SV1-04>1</SV1-04> + <SV1-07>1</SV1-07> + </SV1> + <DTP> + <DTP-01>472</DTP-01> + <DTP-02>D8</DTP-02> + <DTP-03>20061003</DTP-03> + </DTP> + </Loop2400> + <Loop2400> + <LX> + <LX-01>2</LX-01> + </LX> + <SV1> + <SV1-01> + <C003-01>HC</C003-01> + <C003-02>87070</C003-02> + </SV1-01> + <SV1-02>15</SV1-02> + <SV1-03>UN</SV1-03> + <SV1-04>1</SV1-04> + <SV1-07>1</SV1-07> + </SV1> + <DTP> + <DTP-01>472</DTP-01> + <DTP-02>D8</DTP-02> + <DTP-03>20061003</DTP-03> + </DTP> + </Loop2400> + <Loop2400> + <LX> + <LX-01>3</LX-01> + </LX> + <SV1> + <SV1-01> + <C003-01>HC</C003-01> + <C003-02>99214</C003-02> + </SV1-01> + <SV1-02>35</SV1-02> + <SV1-03>UN</SV1-03> + <SV1-04>1</SV1-04> + <SV1-07>2</SV1-07> + </SV1> + <DTP> + <DTP-01>472</DTP-01> + <DTP-02>D8</DTP-02> + <DTP-03>20061010</DTP-03> + </DTP> + </Loop2400> + <Loop2400> + <LX> + <LX-01>4</LX-01> + </LX> + <SV1> + <SV1-01> + <C003-01>HC</C003-01> + <C003-02>86663</C003-02> + </SV1-01> + <SV1-02>10</SV1-02> + <SV1-03>UN</SV1-03> + <SV1-04>1</SV1-04> + <SV1-07>2</SV1-07> + </SV1> + <DTP> + <DTP-01>472</DTP-01> + <DTP-02>D8</DTP-02> + <DTP-03>20061010</DTP-03 + ></DTP> + </Loop2400> + </Loop2300> + </Loop2000> + <SE> + <SE-01>42</SE-01> + <SE-02>0021</SE-02> + </SE> + <GE> + <GE-01>1</GE-01> + <GE-02>1</GE-02> + </GE> + <IEA> + <IEA-01>1</IEA-01> + <IEA-02>000000001</IEA-02> + </IEA> +</X12_837P> \ No newline at end of file diff --git a/integration-tests-jvm/pom.xml b/integration-tests-jvm/pom.xml index 974f1f62e5..e83f3a35c4 100644 --- a/integration-tests-jvm/pom.xml +++ b/integration-tests-jvm/pom.xml @@ -50,6 +50,7 @@ <module>console</module> <module>controlbus-statistics</module> <module>couchbase</module> + <module>dfdl</module> <module>djl</module> <module>dns</module> <module>drill</module> diff --git a/pom.xml b/pom.xml index f9fed5845b..eab9093cf9 100644 --- a/pom.xml +++ b/pom.xml @@ -178,6 +178,7 @@ <!-- Test dependency versions (keep sorted alphabetically) --> <consul-client.version>${consul-client-version}</consul-client.version> + <dfdl-scala.version>2.12.20</dfdl-scala.version> <ftpserver.version>${ftpserver-version}</ftpserver.version> <hamcrest.version>3.0</hamcrest.version><!-- Awaitility and Wiremock --> <htmlunit-driver.version>4.13.0</htmlunit-driver.version> @@ -185,6 +186,7 @@ <sshd.version>2.12.1</sshd.version><!-- @sync io.quarkus:quarkus-bom:${quarkus.version} dep:org.apache.sshd:sshd-common --> <unboundid-ldapsdk.version>7.0.2</unboundid-ldapsdk.version> <wiremock.version>3.12.1</wiremock.version> + <xmlunit.version>2.10.0</xmlunit.version> <zt-exec.version>1.12</zt-exec.version> <!-- Tooling dependency versions (keep sorted alphabetically) --> diff --git a/poms/bom-test/pom.xml b/poms/bom-test/pom.xml index ca27009599..407e61a7d0 100644 --- a/poms/bom-test/pom.xml +++ b/poms/bom-test/pom.xml @@ -404,6 +404,11 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.xmlunit</groupId> + <artifactId>xmlunit-core</artifactId> + <version>${xmlunit.version}</version> + </dependency> <dependency> <groupId>org.zeroturnaround</groupId> <artifactId>zt-exec</artifactId> diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml index c18f0d3285..76bdbd4f69 100644 --- a/poms/bom/pom.xml +++ b/poms/bom/pom.xml @@ -884,6 +884,22 @@ <artifactId>camel-debug</artifactId> <version>${camel.version}</version> </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-dfdl</artifactId> + <version>${camel.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-dfdl</artifactId> + <version>${camel.version}</version> + <exclusions> + <exclusion> + <groupId>xml-apis</groupId> + <artifactId>xml-apis</artifactId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-digitalocean</artifactId> @@ -3867,6 +3883,16 @@ <artifactId>camel-quarkus-debug-deployment</artifactId> <version>${camel-quarkus.version}</version> </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-dfdl</artifactId> + <version>${camel-quarkus.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-dfdl-deployment</artifactId> + <version>${camel-quarkus.version}</version> + </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-digitalocean</artifactId> diff --git a/poms/bom/src/main/generated/flattened-full-pom.xml b/poms/bom/src/main/generated/flattened-full-pom.xml index ffde262f3a..da63ebd0c1 100644 --- a/poms/bom/src/main/generated/flattened-full-pom.xml +++ b/poms/bom/src/main/generated/flattened-full-pom.xml @@ -821,6 +821,17 @@ <artifactId>camel-debug</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <version>4.11.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> </dependency> + <dependency> + <groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <artifactId>camel-dfdl</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <version>4.11.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <exclusions> + <exclusion> + <groupId>xml-apis</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <artifactId>xml-apis</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <artifactId>camel-digitalocean</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> @@ -3791,6 +3802,16 @@ <artifactId>camel-quarkus-debug-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <version>3.22.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <artifactId>camel-quarkus-dfdl</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <version>3.22.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <artifactId>camel-quarkus-dfdl-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <version>3.22.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <artifactId>camel-quarkus-digitalocean</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> diff --git a/poms/bom/src/main/generated/flattened-reduced-pom.xml b/poms/bom/src/main/generated/flattened-reduced-pom.xml index 301bb9b2d6..9ebbf382c1 100644 --- a/poms/bom/src/main/generated/flattened-reduced-pom.xml +++ b/poms/bom/src/main/generated/flattened-reduced-pom.xml @@ -821,6 +821,17 @@ <artifactId>camel-debug</artifactId> <version>4.11.0</version> </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-dfdl</artifactId> + <version>4.11.0</version> + <exclusions> + <exclusion> + <groupId>xml-apis</groupId> + <artifactId>xml-apis</artifactId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-digitalocean</artifactId> @@ -3781,6 +3792,16 @@ <artifactId>camel-quarkus-debug-deployment</artifactId> <version>3.22.0-SNAPSHOT</version> </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-dfdl</artifactId> + <version>3.22.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-dfdl-deployment</artifactId> + <version>3.22.0-SNAPSHOT</version> + </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-digitalocean</artifactId> diff --git a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml index 1648d3fab3..88f3bd1441 100644 --- a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml +++ b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml @@ -821,6 +821,17 @@ <artifactId>camel-debug</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <version>4.11.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> </dependency> + <dependency> + <groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <artifactId>camel-dfdl</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <version>4.11.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <exclusions> + <exclusion> + <groupId>xml-apis</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <artifactId>xml-apis</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>org.apache.camel</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <artifactId>camel-digitalocean</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> @@ -3781,6 +3792,16 @@ <artifactId>camel-quarkus-debug-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <version>3.22.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <artifactId>camel-quarkus-dfdl</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <version>3.22.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <artifactId>camel-quarkus-dfdl-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + <version>3.22.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> + </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} --> <artifactId>camel-quarkus-digitalocean</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->