This technique is not limited to EDIFACT, X12, and other EDI formats! Far from it ”many applications benefit from being capable of converting between XML and non-XML formats (such as other popular formats or legacy formats). You can use the same technique for the following:
The key to succeed is to properly analyze the output format and XML-ize it, or devise an XML vocabulary that works. The rule of thumb is to keep it simple. For example, I could have created a more ambitious XML mapping with a different element for each EDIFACT segment, using the EDIFACT element name such as <PRI> <C509> <S5125>AAA</S5125> <S5118>24.99</S5118> <S5375/> <S5387>SRP</S5387> </C509> </PRI> However, what's the point? It only makes the intermediate format and the formatter more complicated. Keep it simple. The goal is to move as much intelligence as possible in the XSLT style sheet. |