gs1 / EPCIS

Draft files being shared for EPCIS 2.0 development
Other
20 stars 7 forks source link

backport to XML Schema 1.0 support. #408

Closed sboeckelmann closed 2 years ago

sboeckelmann commented 2 years ago

XSD and XML fixes to support existing examples TBD: mark epcList as optional

sboeckelmann commented 2 years ago

Hi @mgh128 and @RalphTro,

I have cherry picked some additional fixes to support all existing examples. I am not sure whether we decided to relax epcList and make it optional for XML in 2.0. For the time being I have added an empty epcList to the example ObjectEvent where it was missing. But I would vote for marking it optional in XSD.

RalphTro commented 2 years ago

Dear @sboeckelmann , Thanks! As to "But I would vote for marking it optional in XSD." - +1 from my side, see my comment in PR https://github.com/gs1/EPCIS/pull/406#issuecomment-1074116475

sboeckelmann commented 2 years ago

<xsd:attribute name="exception" type="xsd:anyURI" use="optional"/> was already include in this PR

Now I have also included required changes for <xsd:element name="epcList" type="epcis:EPCListType" minOccurs="0"/>

RalphTro commented 2 years ago

Dear @sboeckelmann , Thanks a lot! Through my most recent tests, I am happy to confirm the following number of improvements: (1) 'persistentDisposition' is no longer allowed in two extension wrappers in e.g. an ObjectEvent (2) ObjectEvents with an empty epcList are validated. (3) is no longer allowed in extension wrappers (4) quantityList/childQuantityList are no longer permitted in extension wrappers

I noticed the following things that still need to be adjusted: (a) In an AggregationEvent, the XSD still expects me to insert a non-empty element (similar to the issue you nicely adjusted with for the ObjectEvent. This bahaviour may also still hold true for a TransactionEvent. (b) A TransformationEvent wrapped into an is still validated. (c) An or field can still be embedded into wrappers (both ways are validated)

If you have some bandwidth to look into these things, that would be wonderful.

Kind regards, Ralph

sboeckelmann commented 2 years ago

Hi @RalphTro (b) Do you mean a TransformationEvent wrapped into an extension? (c) I do not fully understand either - can you please elaborate?

Thanks! Sven

RalphTro commented 2 years ago

Hi @sboeckelmann , I wouldn't have understood my comments myself. :-) I apologise for not having double-checked of what I wrote. As to (b): correct. A Transformation Event is validated no matter if it is enclosed in warppers or not. As to (c) what I intended to write was that eventID and errorDeclaration can be enclosed in baseExtension wrappers - it is validated in both ways (whether they are present or not). IMHO, this should not be permitted.

sboeckelmann commented 2 years ago

Hi @RalphTro I was only able to reproduce an issue with childEPCs in AggregationEventType can you please re-test using my latest changes in on this branch https://raw.githubusercontent.com/sboeckelmann/EPCIS/xml_schema_1.0_backport/XSD/EPCglobal-epcis-2_0.xsd

If you are still having issues, I think it might be easier if you could just send an email to me with the XML files that are not being validated as expected.

Cheers and have a nice evening! Sven

RalphTro commented 2 years ago

Good morning @sboeckelmann , VERY NICE! Many thanks for this. I am happy to report that almost all issues disappeared thanks to your adjustments: e.g. eventID and errorDeclaration are no longer allowed under baseExtension, childEPC can be omitted in Aggregation/TransactionEvents. The really only thing which IMHO needs to have a look at is to disallow TransformationEvents wrapped in fields. To make things easy, I provide an EPCIS Document with two X Events - the first one should be allowed, the second one should not. KInd regards, @RalphTro

RalphTro commented 2 years ago
<?xml version="1.0" encoding="UTF-8"?>
<epcis:EPCISDocument xmlns:epcis="urn:epcglobal:epcis:xsd:2" xmlns:epcglobal="urn:epcglobal:xsd:1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gs1="https://gs1.org/voc/" schemaVersion="2.0" creationDate="2019-05-27T10:01:00.000+02:00" xsi:schemaLocation="urn:epcglobal:epcis:xsd:2 EPCglobal-epcis-2_0.xsd">
    <EPCISBody>
        <EventList>
            <!--<extension>-->
                <TransformationEvent>
                    <eventTime>2019-09-10T08:40:21.3142715Z</eventTime>
                    <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
                    <inputEPCList>
                        <epc>urn:epc:id:sgtin:4047111.012345.1111</epc>
                        <epc>urn:epc:id:sgtin:4047111.012345.2222</epc>
                    </inputEPCList>
                    <outputEPCList>
                        <epc>urn:epc:id:sgtin:4047111.012345.3333</epc>
                    </outputEPCList>
                    <bizStep>urn:epcglobal:cbv:bizstep:repairing</bizStep>
                    <disposition>urn:epcglobal:cbv:disp:damaged</disposition>
                </TransformationEvent>
            <!--</extension>-->
            <extension>
                <TransformationEvent>
                    <eventTime>2019-09-10T08:40:21.3142715Z</eventTime>
                    <eventTimeZoneOffset>+02:00</eventTimeZoneOffset>
                    <inputEPCList>
                        <epc>urn:epc:id:sgtin:4047111.012345.1111</epc>
                    </inputEPCList>
                    <outputEPCList>
                        <epc>urn:epc:id:sgtin:4047111.012345.2222</epc>
                        <epc>urn:epc:id:sgtin:4047111.012345.3333</epc>
                    </outputEPCList>
                    <bizStep>urn:epcglobal:cbv:bizstep:repairing</bizStep>
                    <disposition>urn:epcglobal:cbv:disp:damaged</disposition>
                </TransformationEvent>
            </extension>
        </EventList>
    </EPCISBody>
</epcis:EPCISDocument>
sboeckelmann commented 2 years ago

Good morning @RalphTro, thank you for providing the example! I have made the required changes within EPCISEventListExtensionType. Please re-test

RalphTro commented 2 years ago

Dear @sboeckelmann , You are welcome and many thanks! Happy to report that ALL my spontaneous tests with XML Spy were successful. @mgh128 and @CraigRe : feel free to make some final tests for yourselves and merge the PR afterwards. Kind regards, @RalphTro