0

Rust – Read EPCIS 1.2 XML Into Struct Instance

This post is about reading an EPCIS 1.2 XML in a Struct instance.

Requirements

These are the things used for this post.

Input XML

We will use a sample EPCIS 1.2 XML  sample-epcis1.2-xml.xml  in https://github.com/Turreta/Rust-Read-EPCIS-1.2-XML-Into-Struct-Instance.

EPCIS Structs

EPCISDocument

It represents the whole XML document.

EPCISHeader

It represents the EPCIS header and uses several header-related structs.

StandardBusinessDocumentHeader

Sender/Receiver Identifiers

DocumentIdentification

EPCISBody

It represents the EPCIS body and uses other structs.

For this post, we only have structs for ObjectEvent  and AggregationEvent  elements.

ObjectEvent

AggregationEvent

Other Struts

main.rs  Codes

Output

The complete console output is available as output.txt in https://github.com/Turreta/Rust-Read-EPCIS-1.2-XML-Into-Struct-Instance.

Karl San Gabriel

Karl San Gabriel

Professional Software Developer