Comments (2)
Hi @josecaster ,
The predefined schemas in the library are specifically used only for the control structures (UNB>UNG>UNH or UNB>UNH). As you are processing the input data, your application must set the transaction schema when it encounters the UNH segment (reader.setTransactionSchema). The reason for this design is that an application may not know the correct message schema to use until reading up to the UNH segment.
Instead of a schema file with interchange
, you will want to create your XML with a transaction
element only (plus all of the types you need). There is an example CONTRL schema in the test folder that might help: https://github.com/xlate/staedi/blob/master/src/test/resources/EDIFACT/CONTRL-v4r02.xml. Your transaction schema should not contain the UNH/UNT segments, as they are already handled by the predefined control schema.
Please note that if the DAM segment is nested in GRP5>GRP6, you will continue to receive unexpected segment errors unless you define all of preceding segments. Based on the schema you linked on the Truugo site, your high level schema will be something like this (note that UNH and UNT are not mentioned):
<schema xmlns="http://xlate.io/EDISchema/v3">
<transaction>
<sequence>
<segment type="BGM" minOccurs="1" maxOccurs="1" />
<segment type="FTX" maxOccurs="9" />
<segment type="RFF" maxOccurs="9" />
<loop code="GRP1" minOccurs="0" maxOccurs="1">
<sequence>
<!-- omitted -->
</sequence>
</loop>
<loop code="GRP2" minOccurs="1" maxOccurs="9">
<sequence>
<!-- omitted -->
</sequence>
</loop>
<loop code="GRP3" minOccurs="0" maxOccurs="999">
<sequence>
<!-- omitted -->
</sequence>
</loop>
<loop code="GRP5" minOccurs="1" maxOccurs="999">
<sequence>
<segment type="EQD" minOccurs="1" maxOccurs="1" />
<!-- omitted RFF through EQA -->
<loop code="GRP6" minOccurs="1" maxOccurs="999">
<segment type="DAM" minOccurs="1" maxOccurs="1" />
</loop>
<!-- omitted GRP7 and NAD -->
</sequence>
</loop>
<segment type="CNT" minOccurs="1" maxOccurs="1" />
</sequence>
</transaction>
<!-- elementType, compositeType, and segmentType for the items in the transaction -->
</schema>
from staedi.
Thanks Mike,
Once again. my question has been answered.
I get it now.
from staedi.
Related Issues (20)
- Support to Split mulitple GS into separate EDI files HOT 9
- Repetition Elements are not being correctly identified HOT 3
- Error reported when reading ANSI encoded txt file HOT 27
- Missing Mandatory Segments HOT 8
- Does enumerated elements really requires minLength and maxLength? HOT 12
- Reporting a vulnerability HOT 2
- How to apply relational condition in schema HOT 11
- X12 unexpected segment error occurred when first segment of loop is missing HOT 5
- Support multiple ISA segments in an X12 EDI file
- Validator should be reset at end of interchange
- titles for segments like BGN, ST, INS are not accessible in 834 EDI HOT 1
- Adding condition to writeSegment HOT 4
- Option to ignore repetition separator in the ST/SE segments HOT 8
- default decimal mark is point (.) when UNA segment is not present HOT 2
- HL Segment is not interpreted correctly by ReaderService HOT 17
- How to define element inside element in schema? HOT 7
- How to process large EDI files in reader service HOT 5
- staedi api : EDIStreamReader fail to parse if segment element has accent marks . HOT 12
- Edi 835 Never Emitting a START_TRANSACTION HOT 3
- dots in an element in the ISA results in ELEMENT_OCCURRENCE_ERROR HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from staedi.