| |
This page shows the generation of an XML document using an XML template file. As you can see, Some segments are grouped together to form a looping struction. Nest element grouping also used. The generated XML document can be converted back to an ISA document using an XSL file.
Input ANSI X12 Document
ISA*00* *01*PASSWORD *12*TESTUSER001 *08*TESTUSER002 *YYMMDD*HHMM*U*00304*SSNNRRFF0*0*T*:
GS*GR*1111111101*999999XXXX*960207*085415*11101*X*003040
ST*814*111010001
BGN*13*ABC123*19981111*1357**45470*RK
N1*BS*Notification Services-R-US*123456*333444555
PER*AM*First Last_Name*EM*Fist_Last_Name@acme.com*TE*212.212.5555
REF*URL*http://www.acme.com/notify
N1*DS*Big Time OEM*123456*5551212
REF*ZI*0.1
LIN*Junk*F1*1999 Hardware Catalog
REF*ACE*234*event=New Product Published;constraint=All Categories
SE*8*111010001
GE*1*11101
IEA*1*SSNNRRFF0
XML Output File Generated
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="rnet.msxsl"?>
<message version="1.0">
<segment segment-id="ISA" area="transaction-header" position="000" name="Interchange Change Control Header">
<element reference="ISA05" name="Interchange ID Qualifier">
<code name="Duns (Dun & Bradstreet)">12</code>
</element>
<element reference="ISA06" name="Interchange Sender ID">TESTUSER001</element>
<element reference="ISA07" name="Interchange ID Qualifier">
<code name="Duns (Dun & Bradstreet)">08</code>
</element>
<element reference="ISA08" name="Interchange Receiver ID">TESTUSER002</element>
<element reference="ISA09" name="Interchange Date">YYMMDD</element>
<element reference="ISA10" name="Interchange Time">HHMM</element>
<element reference="ISA11" name="Interchange Control Standards Identifier">
<code name="U.S.EDI Community of ASC X12 and UCS">U</code>
</element>
<element reference="ISA12" name="Interchange Control Version Number">
<code name="Standards Issued as ANSI X12.5-1997">00304</code>
</element>
<element reference="ISA13" name="Interchange Control Number">SSNNRRFF0</element>
<element reference="ISA14" name="Acknowledgement Requested">
<code name="No Acknowledgement Required">0</code>
</element>
<element reference="ISA15" name="Usage Indicator">
<code name="Test Data">T</code>
</element>
</segment>
<segment segment-id="GS" area="transaction-header" position="001" name="Functional Group Header">
<element reference="GS01" name="Functional Identifier Code">
<code name="General Request, Response or Confirmation">GR</code>
</element>
<element reference="GS04" name="Date">960207</element>
<element reference="GS05" name="Time">085415</element>
<element reference="GS06" name="Group Control Number">11101</element>
<element reference="GS07" name="Responsible Agent Code">
<code name="Accredited Standards Committee X12">X</code>
</element>
<element reference="GS08" name="Version/Release/Industry Identifier Code">
<code name="Draft Standards Approved for Publication by ASC X12 Procedures Review Board through October 1997">003040</code>
</element>
</segment>
<segment segment-id="ST" area="heading" position="030" name="Transaction Set Header">
<element reference="ST01" name="Transaction Set Identifier Code">
<code name="General Request, Response or Confirmation">814</code>
</element>
<element reference="ST02" name="Transaction Set Control Number">111010001</element>
</segment>
<segment segment-id="BGN" area="heading" position="020" name="Beginning Segment">
<element reference="BGN01" name="Transaction Set Purpose Code">
<code name="Request">13</code>
</element>
<element reference="BGN02" name="Reference Identification">ABC123</element>
<element reference="BGN03" name="Date">19981111</element>
<element reference="BGN04" name="Time">1357</element>
<element reference="BGN06" name="Reference Identification">45470</element>
<element reference="BGN07" name="Transaction Type Code">
<code name="Registration">RK</code>
</element>
</segment>
<loops>
<loop loop-id="N1">
<segment segment-id="N1" area="heading" position="040" name="Name">
<element reference="N101" name="Entity Identifier Code">
<code name="Notification Service (Notify Part no.1)">BS</code>
</element>
<element reference="N102" name="Name">Notification Services-R-US</element>
<element reference="N103" name="Identification Code Qualifier">
<code name="D-U-N-S Number, Dun & Bradstreet">123456</code>
</element>
<element reference="N104" name="Identification Code">333444555</element>
</segment>
<segment-group segment-id="PER" area="heading" position="080" name="Administrative Communications Contact">
<repeat-segment>
<element reference="PER01" name="Contact Function Code">
<code name="Administrator">AM</code>
</element>
<element reference="PER02" name="Name">First Last_Name</element>
<element reference="PER03" name="Communications Number Qualifier">
<code name="Electronic Mail">EM</code>
</element>
<element reference="PER04" name="Communication Number">Fist_Last_Name@acme.com</element>
<element reference="PER05" name="Communication Number Qualifier">
<code name="Telephone">TE</code>
</element>
<element reference="PER06" name="Communication Number">212.212.5555</element>
</repeat-segment>
</segment-group>
<segment-group segment-id="REF" area="heading" position="090" name="Reference Identification">
<repeat-segment>
<element reference="REF01" name="Reference Identification Number">URL</element>
<element reference="REF02" name="Reference Identification">http://www.acme.com/notify</element>
</repeat-segment>
</segment-group>
</loop>
<loop loop-id="N1">
<segment segment-id="N1" area="heading" position="040" name="Name">
<element reference="N101" name="Entity Identifier Code">
<code name="Notification Service (Notify Part no.1)">DS</code>
</element>
<element reference="N102" name="Name">Big Time OEM</element>
<element reference="N103" name="Identification Code Qualifier">
<code name="D-U-N-S Number, Dun & Bradstreet">123456</code>
</element>
<element reference="N104" name="Identification Code">5551212</element>
</segment>
<segment-group segment-id="REF" area="heading" position="090" name="Reference Identification">
<repeat-segment>
<element reference="REF01" name="Reference Identification Number">ZI</element>
<element reference="REF02" name="Reference Identification">0.1</element>
</repeat-segment>
</segment-group>
</loop>
</loops>
<loops>
<loop loop-id="LIN">
<segment segment-id="LIN" area="detail" position="010" name="Item Identification">
<element reference="LIN02" name="Product/Service ID Qualifier">
<code name="Catalog Number">F1</code>
</element>
<element reference="LIN03" name="Product/Service ID">1999 Hardware Catalog</element>
</segment>
<segment-group segment-id="REF" area="heading" position="090" name="Reference Identification">
<repeat-segment>
<element reference="REF01" name="Reference Identification Number">
<code name="Service Request Number">ACE</code>
</element>
<element reference="REF03" name="Description">event=New Product Published;constraint=All Categories</element>
</repeat-segment>
</segment-group>
</loop>
</loops>
<segment segment-id="SE" area="summary" position="10" name="Transaction Set Trailer">
<element reference="SE01" name="Number of Included Segments">8</element>
<element reference="SE02" name="Transaction Set Control Number">111010001</element>
</segment>
<segment segment-id="GE" area="transaction-trailer" position="20" name="Functional Group Trailer">
<element reference="GE01" name="Number of Transaction Sets Included">1</element>
<element reference="GE02" name="Group Control Number">11101</element>
</segment>
<segment segment-id="IEA" area="transaction-trailer" position="30" name="Interchange Control Trailer">
<element reference="IEA01" name="Number of Included Functional Grous">1</element>
<element reference="IEA02" name="Number of Included Functional Number">SSNNRRFF0</element>
</segment>
</message>
XML Format Template File
<?xml version="1.0"?>
<TEMPLATE>
<HDTXT>
<!--<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="rnet.msxsl"?>
<message version="1.0">
-->
</HDTXT>
<TLTXT>
<!--</message>-->
</TLTXT>
<!--
#
# for ANSI X12 documents
#
-->
<HEADER MATCH="ISA" SEP="KISA+0" SUB="':'" TER="p106" ALTTAG="segment" segment-id="ISA" area="transaction-header" position="000" name="Interchange Change Control Header">
<RID match="ISA">
<element GROUP="1" reference="ISA05" name="Interchange ID Qualifier">
<code name="Duns (Dun & Bradstreet)">f5</code>
</element>
<element reference="ISA06" name="Interchange Sender ID">f6</element>
<element GROUP="1" reference="ISA07" name="Interchange ID Qualifier">
<code name="Duns (Dun & Bradstreet)">f7</code>
</element>
<element reference="ISA08" name="Interchange Receiver ID">f8</element>
<element reference="ISA09" name="Interchange Date">f9</element>
<element reference="ISA10" name="Interchange Time">f10</element>
<element GROUP="1" reference="ISA11" name="Interchange Control Standards Identifier">
<code name="U.S.EDI Community of ASC X12 and UCS">f11</code>
</element>
<element GROUP="1" reference="ISA12" name="Interchange Control Version Number">
<code name="Standards Issued as ANSI X12.5-1997">f12</code>
</element>
<element reference="ISA13" name="Interchange Control Number">f13</element>
<element GROUP="1" reference="ISA14" name="Acknowledgement Requested">
<code name="No Acknowledgement Required">f14</code>
</element>
<element GROUP="1" reference="ISA15" name="Usage Indicator">
<code name="Test Data">f15</code>
</element>
</RID>
</HEADER>
<HEADER match="IEA" ALTTAG="segment" segment-id="IEA" area="transaction-trailer" position="30" name="Interchange Control Trailer">
<RID match="IEA">
<element reference="IEA01" name="Number of Included Functional Grous">f1</element>
<element reference="IEA02" name="Number of Included Functional Number">f2</element>
</RID>
</HEADER>
<!--
#
# Header for GS group header
#
-->
<HEADER match="GS" ALTTAG="segment" segment-id="GS" area="transaction-header" position="001" name="Functional Group Header">
<RID match="GS">
<element GROUP="1" reference="GS01" name="Functional Identifier Code">
<code name="General Request, Response or Confirmation">f1</code>
</element>
<element reference="GS04" name="Date">f4</element>
<element reference="GS05" name="Time">f5</element>
<element reference="GS06" name="Group Control Number">f6</element>
<element GROUP="1" reference="GS07" name="Responsible Agent Code">
<code name="Accredited Standards Committee X12">f7</code>
</element>
<element GROUP="1" reference="GS08" name="Version/Release/Industry Identifier Code">
<code name="Draft Standards Approved for Publication by ASC X12 Procedures Review Board through October 1997">f8</code>
</element>
</RID>
</HEADER>
<HEADER match="GE" ALTTAG="segment" segment-id="GE" area="transaction-trailer" position="20" name="Functional Group Trailer">
<RID match="GE">
<element reference="GE01" name="Number of Transaction Sets Included">f1</element>
<element reference="GE02" name="Group Control Number">f2</element>
</RID>
</HEADER>
<!--
#
# Header for ST document header
#
-->
<HEADER match="ST" ALTTAG="segment" segment-id="ST" area="heading" position="030" name="Transaction Set Header">
<RID match="ST">
<element GROUP="1" reference="ST01" name="Transaction Set Identifier Code">
<code name="General Request, Response or Confirmation">f1</code>
</element>
<element reference="ST02" name="Transaction Set Control Number">f2</element>
</RID>
</HEADER>
<HEADER match="SE" ALTTAG="segment" segment-id="SE" area="summary" position="10" name="Transaction Set Trailer">
<RID match="SE">
<element reference="SE01" name="Number of Included Segments">f1</element>
<element reference="SE02" name="Transaction Set Control Number">f2</element>
</RID>
</HEADER>
<HEADER match="BGN" ALTTAG="segment" segment-id="BGN" area="heading" position="020" name="Beginning Segment">
<RID match="BGN">
<element GROUP="1" reference="BGN01" name="Transaction Set Purpose Code">
<code name="Request">f1</code>
</element>
<element reference="BGN02" name="Reference Identification">f2</element>
<element reference="BGN03" name="Date">f3</element>
<element reference="BGN04" name="Time">f4</element>
<element reference="BGN06" name="Reference Identification">f6</element>
<element GROUP="1" reference="BGN07" name="Transaction Type Code">
<code name="Registration">f7</code>
</element>
</RID>
</HEADER>
<HEADER match="N1" GRPTAG="loops" ALTTAG="loop" loop-id="N1">
<RID match="N1">
<segment GROUP="1" segment-id="N1" area="heading" position="040" name="Name">
<element GROUP="1" reference="N101" name="Entity Identifier Code">
<code name="Notification Service (Notify Part no.1)">f1</code>
</element>
<element reference="N102" name="Name">f2</element>
<element GROUP="1" reference="N103" name="Identification Code Qualifier">
<code name="D-U-N-S Number, Dun & Bradstreet">f3</code>
</element>
<element reference="N104" name="Identification Code">f4</element>
</segment>
</RID>
<RID match="PER" ALTTAG="segment-group" segment-id="PER" area="heading" position="080" name="Administrative Communications Contact">
<repeat-segment GROUP="1">
<element GROUP="1" reference="PER01" name="Contact Function Code">
<code name="Administrator">f1</code>
</element>
<element reference="PER02" name="Name">f2</element>
<element GROUP="1" reference="PER03" name="Communications Number Qualifier">
<code name="Electronic Mail">f3</code>
</element>
<element reference="PER04" name="Communication Number">f4</element>
<element GROUP="1" reference="PER05" name="Communication Number Qualifier">
<code name="Telephone">f5</code>
</element>
<element reference="PER06" name="Communication Number">f6</element>
</repeat-segment>
</RID>
<RID match="REF" ALTTAG="segment-group" segment-id="REF" area="heading" position="090" name="Reference Identification">
<repeat-segment GROUP="1">
<element reference="REF01" name="Reference Identification Number">f1</element>
<element reference="REF02" name="Reference Identification">f2</element>
</repeat-segment>
</RID>
</HEADER>
<HEADER match="LIN" GRPTAG="loops" ALTTAG="loop" loop-id="LIN">
<RID match="LIN">
<segment GROUP="1" segment-id="LIN" area="detail" position="010" name="Item Identification">
<element GROUP="1" reference="LIN02" name="Product/Service ID Qualifier">
<code name="Catalog Number">f2</code>
</element>
<element reference="LIN03" name="Product/Service ID">f3</element>
</segment>
</RID>
<RID match="REF" ALTTAG="segment-group" segment-id="REF" area="heading" position="090" name="Reference Identification">
<repeat-segment GROUP="1">
<element GROUP="1" reference="REF01" name="Reference Identification Number">
<code name="Service Request Number">f1</code>
</element>
<element reference="REF03" name="Description">f3</element>
</repeat-segment>
</RID>
</HEADER>
</TEMPLATE>
|