ref.gs1.org

The Global Language of Business

EPCIS XSL Transformation Tools

Support for downscaling and upscaling between versions 1.2 and 2.0

Background

In EPCIS 2.0, there are no <extension> wrappers around any standard event type, including TransformationEvent and AssociationEvent.

This can be perceived as a disruptive change to implementers. This tool was built to help implementers easily migrate from EPCIS 1.2 to EPCIS 2.0 XML documents and vice versa.

Prerequisite for tool

Install Apache Xalan-C++

XSL Version 2.0

To allow for more concise templates and mode based processing, an XSL 2.0 transformation tool is required. Testing a Makefile is based on the Apache Xalan XSL toolchain.

Running and Testing

EPCIS 2.0 to 1.2 conversion(downscaling)

run Xalan

Xalan ../XML/Example_9.6.1-ObjectEvent-2020_06_18a.xml ./convert-2.0-to-1.2.xsl

run Xalan and beautify using xmllint

Xalan ../XML/Example_9.6.1-ObjectEvent-2020_06_18a.xml ./convert-2.0-to-1.2.xsl | xmllint --format -

run Xalan and validate transformation to EPCIS 1.2 using xmllint

Xalan ../XML/Example_9.6.1-ObjectEvent-2020_06_18a.xml ./convert-2.0-to-1.2.xsl | xmllint --format - | xmllint --schema ./1.2/XSD/EPCglobal-epcis-1_2.xsd -

EPCIS 1.2 to 2.0 conversion(upscaling)

run Xalan

Xalan 1.2/XML/ObjectEvent.xml ./convert-1.2-to-2.0.xsl

run Xalan and beautify using xmllint

Xalan 1.2/XML/ObjectEvent.xml ./convert-1.2-to-2.0.xsl | xmllint --format -

run Xalan and validate transformation to EPCIS 1.2 using xmllint

Xalan 1.2/XML/ObjectEvent.xml ./convert-1.2-to-2.0.xsl | xmllint --format - | xmllint --schema ../XSD/EPCglobal-epcis-2_0.xsd -

EPCIS Version 1.2

To support the transformation and validation toolchain, some changes to the EPCIS 1.2 XSD were needed:

Revised EPCIS 1.2 XSD

The following XML elements should be added to existing 1.2 extensions:

Note The inclusion of these elements is controlled by setting the appropriate variables in convert-2.0-to-1.2.xsl:

Files