856 XML to EDI N1 Loop

Hello,

I'm working on the 856 and have to use LoopN1 twice: for Ship To and Ship From and wrote Inline XSLT in Scripting functiod:

<xsl:element name="ns0:N1Loop1">

<xsl:element name="ns0:N1">
<xsl:element name="N101">SF</xsl:element>
<xsl:element name="N102"></xsl:element>
<xsl:element name="N103"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipFromN1/SupplierIdentifier"/></xsl:element>
<xsl:element name="N104"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipFromN1/IdentificationCode"/></xsl:element>

</xsl:element>

<xsl:element name="ns0:N4">
<xsl:element name="N401"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipFromN1/ShipFromCity"/></xsl:element>
<xsl:element name="N403"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipFromN1/ShipFromPostalCode"/></xsl:element>
<xsl:element name="N404"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/n1loopSF/ShipFromCountryCode"/></xsl:element>
</xsl:element>

<xsl:element name="ns0:N1">
<xsl:element name="N101">ST</xsl:element>
<xsl:element name="N103"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipToN1/ShipToIDQualifier"/></xsl:element>
<xsl:element name="N104"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipToN1/ShipToIDCode"/></xsl:element>
</xsl:element>

<xsl:element name="ns0:N4">
<xsl:element name="N401"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipToN1/ShipToCity"/></xsl:element>
<xsl:element name="N403"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipToN1/ShipToPostalCode"/></xsl:element>
<xsl:element name="N404"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipToN1/ShipToCountryCode"/></xsl:element>
</xsl:element>
</xsl:element>

While testing I got an errors:

Error 5 Native serialization error: Segment level  : Segment ID - N1 : Position - 2 : [7] Segment Not In Proper Sequence
Error 6 Native serialization error: Segment level  : Segment ID - N1 : Position - 2 : [2] Unexpected segment

Please help.

July 16th, 2015 5:30pm

Hi,

You can refer to article, how N1 Looping works: BizTalk Server: N1 Loop Mapping

Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 1:24am

Mahesh is correct ,In addition to it you can also look below blog post

http://biztalk.stottcreations.com/2007/07/extracting_data_from_the_second_iteration_and_beyond_of_a/

Thanks

Abhishek

July 17th, 2015 2:11am

Hi,

You can refer to article, how N1 Looping works: BizTalk Server: N1 Loop Mapping

Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 5:20am

Hi,

You can refer to article, how N1 Looping works: BizTalk Server: N1 Loop Mapping

July 17th, 2015 5:20am

Hi,

You can refer to article, how N1 Looping works: BizTalk Server: N1 Loop Mapping

  • Proposed as answer by Rachit Sikroria Friday, July 17, 2015 5:40 AM
  • Marked as answer by akolons2011 Monday, July 20, 2015 2:47 PM
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 5:20am

Hi,

You can refer to article, how N1 Looping works: BizTalk Server: N1 Loop Mapping

  • Proposed as answer by Rachit Sikroria Friday, July 17, 2015 5:40 AM
  • Marked as answer by akolons2011 Monday, July 20, 2015 2:47 PM
July 17th, 2015 5:20am

Hi,

You can refer to article, how N1 Looping works: BizTalk Server: N1 Loop Mapping

  • Proposed as answer by Rachit Sikroria Friday, July 17, 2015 5:40 AM
  • Marked as answer by akolons2011 Monday, July 20, 2015 2:47 PM
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 5:20am

Hi,

You can refer to article, how N1 Looping works: BizTalk Server: N1 Loop Mapping

  • Proposed as answer by Rachit Sikroria Friday, July 17, 2015 5:40 AM
  • Marked as answer by akolons2011 Monday, July 20, 2015 2:47 PM
July 17th, 2015 5:20am

Mahesh is correct ,In addition to it you can also look below blog post

http://biztalk.stottcreations.com/2007/07/extracting_data_from_the_second_iteration_and_beyond_of_a/

Thanks

Abhishek

  • Marked as answer by akolons2011 16 hours 17 minutes ago
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 6:07am

Mahesh is correct ,In addition to it you can also look below blog post

http://biztalk.stottcreations.com/2007/07/extracting_data_from_the_second_iteration_and_beyond_of_a/

Thanks

Abhishek

  • Marked as answer by akolons2011 Monday, July 20, 2015 2:47 PM
July 17th, 2015 6:07am

Mahesh is correct ,In addition to it you can also look below blog post

http://biztalk.stottcreations.com/2007/07/extracting_data_from_the_second_iteration_and_beyond_of_a/

Thanks

Abhishek

  • Marked as answer by akolons2011 Monday, July 20, 2015 2:47 PM
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 6:07am

Mahesh is correct ,In addition to it you can also look below blog post

http://biztalk.stottcreations.com/2007/07/extracting_data_from_the_second_iteration_and_beyond_of_a/

Thanks

Abhishek

  • Marked as answer by akolons2011 Monday, July 20, 2015 2:47 PM
July 17th, 2015 6:07am

Mahesh is correct ,In addition to it you can also look below blog post

http://biztalk.stottcreations.com/2007/07/extracting_data_from_the_second_iteration_and_beyond_of_a/

Thanks

Abhishek

  • Marked as answer by akolons2011 Monday, July 20, 2015 2:47 PM
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 6:07am

For clarity, the OP is asking about mapping to N1Loop1. The examples provided cover mapping from N1Loop1.

The problem with the XSL is N1Loop1 itself must repeat.  In the sample, only the Elements repeat.

So, you need to create a second N1Loop1.

</xsl:element> <!-- Close first N1Loop1 --> 
<xsl:element name="ns0:N1Loop1"> <!-- Open Second N1Loop1 -->
Or, you can create first class elements for ShipFrom and ShipTo by following the steps in Creating Custom Fields in this Wiki Article:  BizTalk: EDI Features Not Just For HIPAA
July 17th, 2015 7:55am

Thanks Johns-305 for your reply. I opened a second N1Loop1:

<xsl:element name="ns0:N1Loop1">

<xsl:element name="ns0:N1">
<xsl:element name="N101">SF</xsl:element>
<xsl:element name="N102"></xsl:element>
<xsl:element name="N103"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipFromN1/SupplierIdentifier"/></xsl:element>
<xsl:element name="N104"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipFromN1/IdentificationCode"/></xsl:element>
</xsl:element>

<xsl:element name="ns0:N4">
<xsl:element name="N401"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipFromN1/ShipFromCity"/></xsl:element>
<xsl:element name="N403"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipFromN1/ShipFromPostalCode"/></xsl:element>
<xsl:element name="N404"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/n1loopSF/ShipFromCountryCode"/></xsl:element>
</xsl:element>
</xsl:element>

<xsl:element name="ns0:N1Loop1">
<xsl:element name="ns0:N1">
<xsl:element name="N101">ST</xsl:element>
<xsl:element name="N103"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipToN1/ShipToIDQualifier"/></xsl:element>
<xsl:element name="N104"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipToN1/ShipToIDCode"/></xsl:element>
</xsl:element>

<xsl:element name="ns0:N4">
<xsl:element name="N401"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipToN1/ShipToCity"/></xsl:element>
<xsl:element name="N403"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipToN1/ShipToPostalCode"/></xsl:element>
<xsl:element name="N404"><xsl:value-of select="/Transaction_856/PACKAGE/Loop_HLShipping/Segment_ShipToN1/ShipToCountryCode"/></xsl:element>
</xsl:element>
</xsl:element>

but still got the same error. Please advise

Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 11:50am

For clarity, the OP is asking about mapping to N1Loop1. The examples provided cover mapping from N1Loop1.

The problem with the XSL is N1Loop1 itself must repeat.  In the sample, only the Elements repeat.

So, you need to create a second N1Loop1.

</xsl:element> <!-- Close first N1Loop1 --> 
<xsl:element name="ns0:N1Loop1"> <!-- Open Second N1Loop1 -->
Or, you can create first class elements for ShipFrom and ShipTo by following the steps in Creating Custom Fields in this Wiki Article:  BizTalk: EDI Features Not Just For HIPAA
July 17th, 2015 11:51am

For clarity, the OP is asking about mapping to N1Loop1. The examples provided cover mapping from N1Loop1.

The problem with the XSL is N1Loop1 itself must repeat.  In the sample, only the Elements repeat.

So, you need to create a second N1Loop1.

</xsl:element> <!-- Close first N1Loop1 --> 
<xsl:element name="ns0:N1Loop1"> <!-- Open Second N1Loop1 -->
Or, you can create first class elements for ShipFrom and ShipTo by following the steps in Creating Custom Fields in this Wiki Article:  BizTalk: EDI Features Not Just For HIPAA
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 11:51am

For clarity, the OP is asking about mapping to N1Loop1. The examples provided cover mapping from N1Loop1.

The problem with the XSL is N1Loop1 itself must repeat.  In the sample, only the Elements repeat.

So, you need to create a second N1Loop1.

</xsl:element> <!-- Close first N1Loop1 --> 
<xsl:element name="ns0:N1Loop1"> <!-- Open Second N1Loop1 -->
Or, you can create first class elements for ShipFrom and ShipTo by following the steps in Creating Custom Fields in this Wiki Article:  BizTalk: EDI Features Not Just For HIPAA
July 17th, 2015 11:51am

For clarity, the OP is asking about mapping to N1Loop1. The examples provided cover mapping from N1Loop1.

The problem with the XSL is N1Loop1 itself must repeat.  In the sample, only the Elements repeat.

So, you need to create a second N1Loop1.

</xsl:element> <!-- Close first N1Loop1 --> 
<xsl:element name="ns0:N1Loop1"> <!-- Open Second N1Loop1 -->
Or, you can create first class elements for ShipFrom and ShipTo by following the steps in Creating Custom Fields in this Wiki Article:  BizTalk: EDI Features Not Just For HIPAA
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 11:51am

For clarity, the OP is asking about mapping to N1Loop1. The examples provided cover mapping from N1Loop1.

The problem with the XSL is N1Loop1 itself must repeat.  In the sample, only the Elements repeat.

So, you need to create a second N1Loop1.

</xsl:element> <!-- Close first N1Loop1 --> 
<xsl:element name="ns0:N1Loop1"> <!-- Open Second N1Loop1 -->
Or, you can create first class elements for ShipFrom and ShipTo by following the steps in Creating Custom Fields in this Wiki Article:  BizTalk: EDI Features Not Just For HIPAA
July 17th, 2015 11:51am

For clarity, the OP is asking about mapping to N1Loop1. The examples provided cover mapping from N1Loop1.

The problem with the XSL is N1Loop1 itself must repeat.  In the sample, only the Elements repeat.

So, you need to create a second N1Loop1.

</xsl:element> <!-- Close first N1Loop1 --> 
<xsl:element name="ns0:N1Loop1"> <!-- Open Second N1Loop1 -->
Or, you can create first class elements for ShipFrom and ShipTo by following the steps in Creating Custom Fields in this Wiki Article:  BizTalk: EDI Features Not Just For HIPAA
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 11:51am

Then you need to debug it like any other problem.

When testing, set the output the Xml and see hat the map produces.  The problem may be obvious.

You can then validate the xml against the EDI Schema.

July 17th, 2015 1:26pm

Then you need to debug it like any other problem.

When testing, set the output the Xml and see hat the map produces.  The problem may be obvious.

You can then validate the xml against the EDI Schema.

  • Marked as answer by akolons2011 16 hours 17 minutes ago
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 5:22pm

Then you need to debug it like any other problem.

When testing, set the output the Xml and see hat the map produces.  The problem may be obvious.

You can then validate the xml against the EDI Schema.

  • Marked as answer by akolons2011 Monday, July 20, 2015 2:48 PM
July 17th, 2015 5:22pm

Then you need to debug it like any other problem.

When testing, set the output the Xml and see hat the map produces.  The problem may be obvious.

You can then validate the xml against the EDI Schema.

  • Marked as answer by akolons2011 Monday, July 20, 2015 2:48 PM
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 5:22pm

Then you need to debug it like any other problem.

When testing, set the output the Xml and see hat the map produces.  The problem may be obvious.

You can then validate the xml against the EDI Schema.

  • Marked as answer by akolons2011 Monday, July 20, 2015 2:48 PM
July 17th, 2015 5:22pm

Then you need to debug it like any other problem.

When testing, set the output the Xml and see hat the map produces.  The problem may be obvious.

You can then validate the xml against the EDI Schema.

  • Marked as answer by akolons2011 Monday, July 20, 2015 2:48 PM
Free Windows Admin Tool Kit Click here and download it now
July 17th, 2015 5:22pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics