Quantcast

When using tilde(~) as segment separator edi parsing breaks

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

When using tilde(~) as segment separator edi parsing breaks

Ashok Sharma-2

Hi All,

I am getting EDI message like this

 

ISA*00*          *00*          *ZZ*D00111         *ZZ*0055           *090320*1337*U*00405*000000121*0*T*:~

GS*SM*D00111*0055*20090320*1337*1210001*X*004050~

ST*990*559200008~

B1*ABCD*12345678*20090205*A~

SE*3*559200008~

GE*1*1210001~

IEA*1*000000121~

 

To parse this file I am using below delimiters tag in edi mapping file

<medi:delimiters segment="~" field="*" component="^" sub-component=":" />

 

But in this case parsing fails with below error message

 

01-Jul-2009 19:51:23 org.milyn.smooks.edi.SmooksEDIReader getMappingModel

INFO: Parsed, validated and cached EDI mapping model [DVD Order, Version 1.0].  Target Profile(s) [org.milyn.profile.profile#default_profile].

Exception in thread "main" org.milyn.SmooksException: Unable to filter InputStream for target profile [org.milyn.profile.Profile#default_profile].

      at org.milyn.delivery.dom.SmooksDOMFilter.filter(SmooksDOMFilter.java:290)

      at org.milyn.delivery.dom.SmooksDOMFilter.doFilter(SmooksDOMFilter.java:238)

      at org.milyn.Smooks._filter(Smooks.java:341)

      at org.milyn.Smooks.filter(Smooks.java:319)

      at main.java.example.Main.runSmooksTransform(Main.java:60)

      at main.java.example.Main.main(Main.java:73)

Caused by: org.milyn.edisax.EDIParseException: EDI message processing failed [DVD Order][1.0].  Must be a minimum of 1 instances of segment [GS].  Currently at segment number 2.

      at org.milyn.edisax.EDIParser.mapSegments(EDIParser.java:300)

      at org.milyn.edisax.EDIParser.mapSegments(EDIParser.java:251)

      at org.milyn.edisax.EDIParser.parse(EDIParser.java:225)

      at org.milyn.smooks.edi.SmooksEDIReader.parse(SmooksEDIReader.java:116)

      at org.milyn.delivery.dom.DOMParser.parse(DOMParser.java:120)

      at org.milyn.delivery.dom.DOMParser.parse(DOMParser.java:87)

      at org.milyn.delivery.dom.SmooksDOMFilter.filter(SmooksDOMFilter.java:286)

      ... 5 more

 

Please help me so I can parse this edi file

 

 

Thanks & Regards,

Ashok Sharma

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: When using tilde(~) as segment separator edi parsing breaks

NiHeitz
This might not be related, but I have found in the past, when working on
Unix systems, that I had to escape the tilda character in order to use
it.  Have you tried using the ascii code in your delimiters definition?

Nick Heitz
Ashok Sharma wrote:

>
> Hi All,
>
> I am getting EDI message like this
>
>  
>
> ISA*00*          *00*          *ZZ*D00111         *ZZ*0055      
>     *090320*1337*U*00405*000000121*0*T*:~
>
> GS*SM*D00111*0055*20090320*1337*1210001*X*004050~
>
> ST*990*559200008~
>
> B1*ABCD*12345678*20090205*A~
>
> SE*3*559200008~
>
> GE*1*1210001~
>
> IEA*1*000000121~
>
>  
>
> To parse this file I am using below delimiters tag in edi mapping file
>
> <medi:delimiters segment="~" field="*" component="^" sub-component=":" />
>
>  
>
> But in this case parsing fails with below error message
>
>  
>
> 01-Jul-2009 19:51:23 org.milyn.smooks.edi.SmooksEDIReader getMappingModel
>
> INFO: Parsed, validated and cached EDI mapping model [DVD Order,
> Version 1.0].  Target Profile(s)
> [org.milyn.profile.profile#default_profile].
>
> Exception in thread "main" _org.milyn.SmooksException_: Unable to
> filter InputStream for target profile
> [org.milyn.profile.Profile#default_profile].
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:290_)
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.doFilter(_SmooksDOMFilter.java:238_)
>
>       at org.milyn.Smooks._filter(_Smooks.java:341_)
>
>       at org.milyn.Smooks.filter(_Smooks.java:319_)
>
>       at main.java.example.Main.runSmooksTransform(_Main.java:60_)
>
>       at main.java.example.Main.main(_Main.java:73_)
>
> Caused by: _org.milyn.edisax.EDIParseException_: EDI message
> processing failed [DVD Order][1.0].  Must be a minimum of 1 instances
> of segment [GS].  Currently at segment number 2.
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:300_)
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:251_)
>
>       at org.milyn.edisax.EDIParser.parse(_EDIParser.java:225_)
>
>       at
> org.milyn.smooks.edi.SmooksEDIReader.parse(_SmooksEDIReader.java:116_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:120_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:87_)
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:286_)
>
>       ... 5 more
>
>  
>
> Please help me so I can parse this edi file
>
>  
>
>  
>
> *Thanks & Regards,*
>
> Ashok Sharma
>
>  
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: When using tilde(~) as segment separator edi parsing breaks

Ashok Sharma-2
Thanks Nick,
I had tried with "&#126;" code for tilde(~) as I was using "&#10;" for LF,
but the same error was there.

Thanks & Regards,
Ashok Sharma
 
-----Original Message-----
From: Nick Heitz [mailto:[hidden email]]
Sent: Wednesday, July 01, 2009 8:14 PM
To: [hidden email]
Subject: Re: [milyn-user] When using tilde(~) as segment separator edi
parsing breaks

This might not be related, but I have found in the past, when working on
Unix systems, that I had to escape the tilda character in order to use
it.  Have you tried using the ascii code in your delimiters definition?

Nick Heitz
Ashok Sharma wrote:

>
> Hi All,
>
> I am getting EDI message like this
>
>  
>
> ISA*00*          *00*          *ZZ*D00111         *ZZ*0055      
>     *090320*1337*U*00405*000000121*0*T*:~
>
> GS*SM*D00111*0055*20090320*1337*1210001*X*004050~
>
> ST*990*559200008~
>
> B1*ABCD*12345678*20090205*A~
>
> SE*3*559200008~
>
> GE*1*1210001~
>
> IEA*1*000000121~
>
>  
>
> To parse this file I am using below delimiters tag in edi mapping file
>
> <medi:delimiters segment="~" field="*" component="^" sub-component=":" />
>
>  
>
> But in this case parsing fails with below error message
>
>  
>
> 01-Jul-2009 19:51:23 org.milyn.smooks.edi.SmooksEDIReader getMappingModel
>
> INFO: Parsed, validated and cached EDI mapping model [DVD Order,
> Version 1.0].  Target Profile(s)
> [org.milyn.profile.profile#default_profile].
>
> Exception in thread "main" _org.milyn.SmooksException_: Unable to
> filter InputStream for target profile
> [org.milyn.profile.Profile#default_profile].
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:290_)
>
>       at
>
org.milyn.delivery.dom.SmooksDOMFilter.doFilter(_SmooksDOMFilter.java:238_)

>
>       at org.milyn.Smooks._filter(_Smooks.java:341_)
>
>       at org.milyn.Smooks.filter(_Smooks.java:319_)
>
>       at main.java.example.Main.runSmooksTransform(_Main.java:60_)
>
>       at main.java.example.Main.main(_Main.java:73_)
>
> Caused by: _org.milyn.edisax.EDIParseException_: EDI message
> processing failed [DVD Order][1.0].  Must be a minimum of 1 instances
> of segment [GS].  Currently at segment number 2.
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:300_)
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:251_)
>
>       at org.milyn.edisax.EDIParser.parse(_EDIParser.java:225_)
>
>       at
> org.milyn.smooks.edi.SmooksEDIReader.parse(_SmooksEDIReader.java:116_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:120_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:87_)
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:286_)
>
>       ... 5 more
>
>  
>
> Please help me so I can parse this edi file
>
>  
>
>  
>
> *Thanks & Regards,*
>
> Ashok Sharma
>
>  
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: When using tilde(~) as segment separator edi parsing breaks

Niko-20
Hi Ashok,
Check if your EDI file has a newline at the end of each segment. If that is the case, then you might have to change the delimiter definition in the mapping model file to include newline in addition to the tilde (~) character.

Or, for testing purposes, if newline is present, just remove it and test with your current mapping model.

Thanks,
Abhinav

On Wed, Jul 1, 2009 at 10:12 AM, Ashok Sharma <[hidden email]> wrote:
Thanks Nick,
I had tried with "&#126;" code for tilde(~) as I was using "&#10;" for LF,
but the same error was there.

Thanks & Regards,
Ashok Sharma

-----Original Message-----
From: Nick Heitz [mailto:[hidden email]]
Sent: Wednesday, July 01, 2009 8:14 PM
To: [hidden email]
Subject: Re: [milyn-user] When using tilde(~) as segment separator edi
parsing breaks

This might not be related, but I have found in the past, when working on
Unix systems, that I had to escape the tilda character in order to use
it.  Have you tried using the ascii code in your delimiters definition?

Nick Heitz
Ashok Sharma wrote:
>
> Hi All,
>
> I am getting EDI message like this
>
>
>
> ISA*00*          *00*          *ZZ*D00111         *ZZ*0055
>     *090320*1337*U*00405*000000121*0*T*:~
>
> GS*SM*D00111*0055*20090320*1337*1210001*X*004050~
>
> ST*990*559200008~
>
> B1*ABCD*12345678*20090205*A~
>
> SE*3*559200008~
>
> GE*1*1210001~
>
> IEA*1*000000121~
>
>
>
> To parse this file I am using below delimiters tag in edi mapping file
>
> <medi:delimiters segment="~" field="*" component="^" sub-component=":" />
>
>
>
> But in this case parsing fails with below error message
>
>
>
> 01-Jul-2009 19:51:23 org.milyn.smooks.edi.SmooksEDIReader getMappingModel
>
> INFO: Parsed, validated and cached EDI mapping model [DVD Order,
> Version 1.0].  Target Profile(s)
> [org.milyn.profile.profile#default_profile].
>
> Exception in thread "main" _org.milyn.SmooksException_: Unable to
> filter InputStream for target profile
> [org.milyn.profile.Profile#default_profile].
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:290_)
>
>       at
>
org.milyn.delivery.dom.SmooksDOMFilter.doFilter(_SmooksDOMFilter.java:238_)
>
>       at org.milyn.Smooks._filter(_Smooks.java:341_)
>
>       at org.milyn.Smooks.filter(_Smooks.java:319_)
>
>       at main.java.example.Main.runSmooksTransform(_Main.java:60_)
>
>       at main.java.example.Main.main(_Main.java:73_)
>
> Caused by: _org.milyn.edisax.EDIParseException_: EDI message
> processing failed [DVD Order][1.0].  Must be a minimum of 1 instances
> of segment [GS].  Currently at segment number 2.
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:300_)
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:251_)
>
>       at org.milyn.edisax.EDIParser.parse(_EDIParser.java:225_)
>
>       at
> org.milyn.smooks.edi.SmooksEDIReader.parse(_SmooksEDIReader.java:116_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:120_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:87_)
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:286_)
>
>       ... 5 more
>
>
>
> Please help me so I can parse this edi file
>
>
>
>
>
> *Thanks & Regards,*
>
> Ashok Sharma
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: When using tilde(~) as segment separator edi parsing breaks

Ashok Sharma-2

You are right Niko,

There is LF in addition to tilde(~) at the end of each line.

When I removed LF then segment breaker ~ worked fine but when I use the combination of ~ and LF then parsing breaks.

My delimiter tag was like this.

<medi:delimiters segment="~\n" field="*" component="^" sub-component="]" />

I had also tried this

<medi:delimiters segment="~&#10;" field="*" component="^" sub-component="]" />

 

And also when I use only LF as segment breaker then also parsing works fine. And also when I include any other character with ~ like semicolon(;) then also parsing works fine but I am not getting why parsing fails when there is a combination of ~ and LF at the end on each segment.

 

I am using smooks 1.2 jars and edi-message-mapping-1.1.xsd

 

If you can provide me any example I would be glad.

 

Thanks for your help Niko.

 

Thanks & Regards,

Ashok Sharma

 

From: Niko [mailto:[hidden email]]
Sent: Wednesday, July 01, 2009 11:40 PM
To: [hidden email]
Subject: Re: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

Hi Ashok,
Check if your EDI file has a newline at the end of each segment. If that is the case, then you might have to change the delimiter definition in the mapping model file to include newline in addition to the tilde (~) character.

Or, for testing purposes, if newline is present, just remove it and test with your current mapping model.

Thanks,
Abhinav

On Wed, Jul 1, 2009 at 10:12 AM, Ashok Sharma <[hidden email]> wrote:

Thanks Nick,
I had tried with "&#126;" code for tilde(~) as I was using "&#10;" for LF,
but the same error was there.

Thanks & Regards,
Ashok Sharma


-----Original Message-----
From: Nick Heitz [mailto:[hidden email]]
Sent: Wednesday, July 01, 2009 8:14 PM
To: [hidden email]
Subject: Re: [milyn-user] When using tilde(~) as segment separator edi
parsing breaks

This might not be related, but I have found in the past, when working on
Unix systems, that I had to escape the tilda character in order to use
it.  Have you tried using the ascii code in your delimiters definition?

Nick Heitz
Ashok Sharma wrote:
>
> Hi All,
>
> I am getting EDI message like this
>
>
>
> ISA*00*          *00*          *ZZ*D00111         *ZZ*0055
>     *090320*1337*U*00405*000000121*0*T*:~
>
> GS*SM*D00111*0055*20090320*1337*1210001*X*004050~
>
> ST*990*559200008~
>
> B1*ABCD*12345678*20090205*A~
>
> SE*3*559200008~
>
> GE*1*1210001~
>
> IEA*1*000000121~
>
>
>
> To parse this file I am using below delimiters tag in edi mapping file
>
> <medi:delimiters segment="~" field="*" component="^" sub-component=":" />
>
>
>
> But in this case parsing fails with below error message
>
>
>
> 01-Jul-2009 19:51:23 org.milyn.smooks.edi.SmooksEDIReader getMappingModel
>
> INFO: Parsed, validated and cached EDI mapping model [DVD Order,
> Version 1.0].  Target Profile(s)
> [org.milyn.profile.profile#default_profile].
>
> Exception in thread "main" _org.milyn.SmooksException_: Unable to
> filter InputStream for target profile
> [org.milyn.profile.Profile#default_profile].
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:290_)
>
>       at
>
org.milyn.delivery.dom.SmooksDOMFilter.doFilter(_SmooksDOMFilter.java:238_)
>
>       at org.milyn.Smooks._filter(_Smooks.java:341_)
>
>       at org.milyn.Smooks.filter(_Smooks.java:319_)
>
>       at main.java.example.Main.runSmooksTransform(_Main.java:60_)
>
>       at main.java.example.Main.main(_Main.java:73_)
>
> Caused by: _org.milyn.edisax.EDIParseException_: EDI message
> processing failed [DVD Order][1.0].  Must be a minimum of 1 instances
> of segment [GS].  Currently at segment number 2.
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:300_)
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:251_)
>
>       at org.milyn.edisax.EDIParser.parse(_EDIParser.java:225_)
>
>       at
> org.milyn.smooks.edi.SmooksEDIReader.parse(_SmooksEDIReader.java:116_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:120_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:87_)
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:286_)
>
>       ... 5 more
>
>
>
> Please help me so I can parse this edi file
>
>
>
>
>
> *Thanks & Regards,*
>
> Ashok Sharma
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SV: When using tilde(~) as segment separator edi parsing breaks

Bård Langöy

Hi Ashok,

 

I can have a look at it too…

 

Could I also have a look at your edi-input-file and your config-file.

 

Regards,

Bård

 

Från: Ashok Sharma [mailto:[hidden email]]
Skickat: den 2 juli 2009 07:34
Till: [hidden email]
Ämne: RE: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

You are right Niko,

There is LF in addition to tilde(~) at the end of each line.

When I removed LF then segment breaker ~ worked fine but when I use the combination of ~ and LF then parsing breaks.

My delimiter tag was like this.

<medi:delimiters segment="~\n" field="*" component="^" sub-component="]" />

I had also tried this

<medi:delimiters segment="~&#10;" field="*" component="^" sub-component="]" />

 

And also when I use only LF as segment breaker then also parsing works fine. And also when I include any other character with ~ like semicolon(;) then also parsing works fine but I am not getting why parsing fails when there is a combination of ~ and LF at the end on each segment.

 

I am using smooks 1.2 jars and edi-message-mapping-1.1.xsd

 

If you can provide me any example I would be glad.

 

Thanks for your help Niko.

 

Thanks & Regards,

Ashok Sharma

 

From: Niko [mailto:[hidden email]]
Sent: Wednesday, July 01, 2009 11:40 PM
To: [hidden email]
Subject: Re: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

Hi Ashok,
Check if your EDI file has a newline at the end of each segment. If that is the case, then you might have to change the delimiter definition in the mapping model file to include newline in addition to the tilde (~) character.

Or, for testing purposes, if newline is present, just remove it and test with your current mapping model.

Thanks,
Abhinav

On Wed, Jul 1, 2009 at 10:12 AM, Ashok Sharma <[hidden email]> wrote:

Thanks Nick,
I had tried with "&#126;" code for tilde(~) as I was using "&#10;" for LF,
but the same error was there.

Thanks & Regards,
Ashok Sharma


-----Original Message-----
From: Nick Heitz [mailto:[hidden email]]
Sent: Wednesday, July 01, 2009 8:14 PM
To: [hidden email]
Subject: Re: [milyn-user] When using tilde(~) as segment separator edi
parsing breaks

This might not be related, but I have found in the past, when working on
Unix systems, that I had to escape the tilda character in order to use
it.  Have you tried using the ascii code in your delimiters definition?

Nick Heitz
Ashok Sharma wrote:
>
> Hi All,
>
> I am getting EDI message like this
>
>
>
> ISA*00*          *00*          *ZZ*D00111         *ZZ*0055
>     *090320*1337*U*00405*000000121*0*T*:~
>
> GS*SM*D00111*0055*20090320*1337*1210001*X*004050~
>
> ST*990*559200008~
>
> B1*ABCD*12345678*20090205*A~
>
> SE*3*559200008~
>
> GE*1*1210001~
>
> IEA*1*000000121~
>
>
>
> To parse this file I am using below delimiters tag in edi mapping file
>
> <medi:delimiters segment="~" field="*" component="^" sub-component=":" />
>
>
>
> But in this case parsing fails with below error message
>
>
>
> 01-Jul-2009 19:51:23 org.milyn.smooks.edi.SmooksEDIReader getMappingModel
>
> INFO: Parsed, validated and cached EDI mapping model [DVD Order,
> Version 1.0].  Target Profile(s)
> [org.milyn.profile.profile#default_profile].
>
> Exception in thread "main" _org.milyn.SmooksException_: Unable to
> filter InputStream for target profile
> [org.milyn.profile.Profile#default_profile].
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:290_)
>
>       at
>
org.milyn.delivery.dom.SmooksDOMFilter.doFilter(_SmooksDOMFilter.java:238_)
>
>       at org.milyn.Smooks._filter(_Smooks.java:341_)
>
>       at org.milyn.Smooks.filter(_Smooks.java:319_)
>
>       at main.java.example.Main.runSmooksTransform(_Main.java:60_)
>
>       at main.java.example.Main.main(_Main.java:73_)
>
> Caused by: _org.milyn.edisax.EDIParseException_: EDI message
> processing failed [DVD Order][1.0].  Must be a minimum of 1 instances
> of segment [GS].  Currently at segment number 2.
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:300_)
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:251_)
>
>       at org.milyn.edisax.EDIParser.parse(_EDIParser.java:225_)
>
>       at
> org.milyn.smooks.edi.SmooksEDIReader.parse(_SmooksEDIReader.java:116_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:120_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:87_)
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:286_)
>
>       ... 5 more
>
>
>
> Please help me so I can parse this edi file
>
>
>
>
>
> *Thanks & Regards,*
>
> Ashok Sharma
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: When using tilde(~) as segment separator edi parsing breaks

Ashok Sharma-2

Thanks Bård,

Attached are the mapping files and edi input file.

 

Thanks & Regards,

Ashok Sharma

 

From: Bård Langöy [mailto:[hidden email]]
Sent: Thursday, July 02, 2009 12:30 PM
To: [hidden email]
Subject: SV: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

Hi Ashok,

 

I can have a look at it too…

 

Could I also have a look at your edi-input-file and your config-file.

 

Regards,

Bård

 

Från: Ashok Sharma [mailto:[hidden email]]
Skickat: den 2 juli 2009 07:34
Till: [hidden email]
Ämne: RE: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

You are right Niko,

There is LF in addition to tilde(~) at the end of each line.

When I removed LF then segment breaker ~ worked fine but when I use the combination of ~ and LF then parsing breaks.

My delimiter tag was like this.

<medi:delimiters segment="~\n" field="*" component="^" sub-component="]" />

I had also tried this

<medi:delimiters segment="~&#10;" field="*" component="^" sub-component="]" />

 

And also when I use only LF as segment breaker then also parsing works fine. And also when I include any other character with ~ like semicolon(;) then also parsing works fine but I am not getting why parsing fails when there is a combination of ~ and LF at the end on each segment.

 

I am using smooks 1.2 jars and edi-message-mapping-1.1.xsd

 

If you can provide me any example I would be glad.

 

Thanks for your help Niko.

 

Thanks & Regards,

Ashok Sharma

 

From: Niko [mailto:[hidden email]]
Sent: Wednesday, July 01, 2009 11:40 PM
To: [hidden email]
Subject: Re: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

Hi Ashok,
Check if your EDI file has a newline at the end of each segment. If that is the case, then you might have to change the delimiter definition in the mapping model file to include newline in addition to the tilde (~) character.

Or, for testing purposes, if newline is present, just remove it and test with your current mapping model.

Thanks,
Abhinav

On Wed, Jul 1, 2009 at 10:12 AM, Ashok Sharma <[hidden email]> wrote:

Thanks Nick,
I had tried with "&#126;" code for tilde(~) as I was using "&#10;" for LF,
but the same error was there.

Thanks & Regards,
Ashok Sharma


-----Original Message-----
From: Nick Heitz [mailto:[hidden email]]
Sent: Wednesday, July 01, 2009 8:14 PM
To: [hidden email]
Subject: Re: [milyn-user] When using tilde(~) as segment separator edi
parsing breaks

This might not be related, but I have found in the past, when working on
Unix systems, that I had to escape the tilda character in order to use
it.  Have you tried using the ascii code in your delimiters definition?

Nick Heitz
Ashok Sharma wrote:
>
> Hi All,
>
> I am getting EDI message like this
>
>
>
> ISA*00*          *00*          *ZZ*D00111         *ZZ*0055
>     *090320*1337*U*00405*000000121*0*T*:~
>
> GS*SM*D00111*0055*20090320*1337*1210001*X*004050~
>
> ST*990*559200008~
>
> B1*ABCD*12345678*20090205*A~
>
> SE*3*559200008~
>
> GE*1*1210001~
>
> IEA*1*000000121~
>
>
>
> To parse this file I am using below delimiters tag in edi mapping file
>
> <medi:delimiters segment="~" field="*" component="^" sub-component=":" />
>
>
>
> But in this case parsing fails with below error message
>
>
>
> 01-Jul-2009 19:51:23 org.milyn.smooks.edi.SmooksEDIReader getMappingModel
>
> INFO: Parsed, validated and cached EDI mapping model [DVD Order,
> Version 1.0].  Target Profile(s)
> [org.milyn.profile.profile#default_profile].
>
> Exception in thread "main" _org.milyn.SmooksException_: Unable to
> filter InputStream for target profile
> [org.milyn.profile.Profile#default_profile].
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:290_)
>
>       at
>
org.milyn.delivery.dom.SmooksDOMFilter.doFilter(_SmooksDOMFilter.java:238_)
>
>       at org.milyn.Smooks._filter(_Smooks.java:341_)
>
>       at org.milyn.Smooks.filter(_Smooks.java:319_)
>
>       at main.java.example.Main.runSmooksTransform(_Main.java:60_)
>
>       at main.java.example.Main.main(_Main.java:73_)
>
> Caused by: _org.milyn.edisax.EDIParseException_: EDI message
> processing failed [DVD Order][1.0].  Must be a minimum of 1 instances
> of segment [GS].  Currently at segment number 2.
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:300_)
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:251_)
>
>       at org.milyn.edisax.EDIParser.parse(_EDIParser.java:225_)
>
>       at
> org.milyn.smooks.edi.SmooksEDIReader.parse(_SmooksEDIReader.java:116_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:120_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:87_)
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:286_)
>
>       ... 5 more
>
>
>
> Please help me so I can parse this edi file
>
>
>
>
>
> *Thanks & Regards,*
>
> Ashok Sharma
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email

 


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

mappingAndInputFiles.zip (63K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: When using tilde(~) as segment separator edi parsing breaks

Ashok Sharma-2

Hi Bard,

Did you find anything about my problem or any suggestion from your side?

 

Thanks & Regards,

Ashok Sharma

 

From: Ashok Sharma [mailto:[hidden email]]
Sent: Thursday, July 02, 2009 12:45 PM
To: [hidden email]
Subject: RE: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

Thanks Bård,

Attached are the mapping files and edi input file.

 

Thanks & Regards,

Ashok Sharma

 

From: Bård Langöy [mailto:[hidden email]]
Sent: Thursday, July 02, 2009 12:30 PM
To: [hidden email]
Subject: SV: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

Hi Ashok,

 

I can have a look at it too…

 

Could I also have a look at your edi-input-file and your config-file.

 

Regards,

Bård

 

Från: Ashok Sharma [mailto:[hidden email]]
Skickat: den 2 juli 2009 07:34
Till: [hidden email]
Ämne: RE: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

You are right Niko,

There is LF in addition to tilde(~) at the end of each line.

When I removed LF then segment breaker ~ worked fine but when I use the combination of ~ and LF then parsing breaks.

My delimiter tag was like this.

<medi:delimiters segment="~\n" field="*" component="^" sub-component="]" />

I had also tried this

<medi:delimiters segment="~&#10;" field="*" component="^" sub-component="]" />

 

And also when I use only LF as segment breaker then also parsing works fine. And also when I include any other character with ~ like semicolon(;) then also parsing works fine but I am not getting why parsing fails when there is a combination of ~ and LF at the end on each segment.

 

I am using smooks 1.2 jars and edi-message-mapping-1.1.xsd

 

If you can provide me any example I would be glad.

 

Thanks for your help Niko.

 

Thanks & Regards,

Ashok Sharma

 

From: Niko [mailto:[hidden email]]
Sent: Wednesday, July 01, 2009 11:40 PM
To: [hidden email]
Subject: Re: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

Hi Ashok,
Check if your EDI file has a newline at the end of each segment. If that is the case, then you might have to change the delimiter definition in the mapping model file to include newline in addition to the tilde (~) character.

Or, for testing purposes, if newline is present, just remove it and test with your current mapping model.

Thanks,
Abhinav

On Wed, Jul 1, 2009 at 10:12 AM, Ashok Sharma <[hidden email]> wrote:

Thanks Nick,
I had tried with "&#126;" code for tilde(~) as I was using "&#10;" for LF,
but the same error was there.

Thanks & Regards,
Ashok Sharma


-----Original Message-----
From: Nick Heitz [mailto:[hidden email]]
Sent: Wednesday, July 01, 2009 8:14 PM
To: [hidden email]
Subject: Re: [milyn-user] When using tilde(~) as segment separator edi
parsing breaks

This might not be related, but I have found in the past, when working on
Unix systems, that I had to escape the tilda character in order to use
it.  Have you tried using the ascii code in your delimiters definition?

Nick Heitz
Ashok Sharma wrote:
>
> Hi All,
>
> I am getting EDI message like this
>
>
>
> ISA*00*          *00*          *ZZ*D00111         *ZZ*0055
>     *090320*1337*U*00405*000000121*0*T*:~
>
> GS*SM*D00111*0055*20090320*1337*1210001*X*004050~
>
> ST*990*559200008~
>
> B1*ABCD*12345678*20090205*A~
>
> SE*3*559200008~
>
> GE*1*1210001~
>
> IEA*1*000000121~
>
>
>
> To parse this file I am using below delimiters tag in edi mapping file
>
> <medi:delimiters segment="~" field="*" component="^" sub-component=":" />
>
>
>
> But in this case parsing fails with below error message
>
>
>
> 01-Jul-2009 19:51:23 org.milyn.smooks.edi.SmooksEDIReader getMappingModel
>
> INFO: Parsed, validated and cached EDI mapping model [DVD Order,
> Version 1.0].  Target Profile(s)
> [org.milyn.profile.profile#default_profile].
>
> Exception in thread "main" _org.milyn.SmooksException_: Unable to
> filter InputStream for target profile
> [org.milyn.profile.Profile#default_profile].
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:290_)
>
>       at
>
org.milyn.delivery.dom.SmooksDOMFilter.doFilter(_SmooksDOMFilter.java:238_)
>
>       at org.milyn.Smooks._filter(_Smooks.java:341_)
>
>       at org.milyn.Smooks.filter(_Smooks.java:319_)
>
>       at main.java.example.Main.runSmooksTransform(_Main.java:60_)
>
>       at main.java.example.Main.main(_Main.java:73_)
>
> Caused by: _org.milyn.edisax.EDIParseException_: EDI message
> processing failed [DVD Order][1.0].  Must be a minimum of 1 instances
> of segment [GS].  Currently at segment number 2.
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:300_)
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:251_)
>
>       at org.milyn.edisax.EDIParser.parse(_EDIParser.java:225_)
>
>       at
> org.milyn.smooks.edi.SmooksEDIReader.parse(_SmooksEDIReader.java:116_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:120_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:87_)
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:286_)
>
>       ... 5 more
>
>
>
> Please help me so I can parse this edi file
>
>
>
>
>
> *Thanks & Regards,*
>
> Ashok Sharma
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SV: When using tilde(~) as segment separator edi parsing breaks

Bård Langöy

Hi Ashok,

 

Sorry for the delay… was my last week before going on summer-holiday and had tons to do at work. But now I have started my holiday and have had a look at your files. I managed to read the edi-input you sent by adding LF character to the segment delimiter.

 

<medi:delimiters segment="~&#13;&#10;" field="*" component="^" sub-component="]" />

 

Try this and let me know if it works for you too.

 

Best regards,

Bård

 

Från: Ashok Sharma [mailto:[hidden email]]
Skickat: den 3 juli 2009 11:30
Till: [hidden email]
Ämne: RE: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

Hi Bard,

Did you find anything about my problem or any suggestion from your side?

 

Thanks & Regards,

Ashok Sharma

 

From: Ashok Sharma [mailto:[hidden email]]
Sent: Thursday, July 02, 2009 12:45 PM
To: [hidden email]
Subject: RE: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

Thanks Bård,

Attached are the mapping files and edi input file.

 

Thanks & Regards,

Ashok Sharma

 

From: Bård Langöy [mailto:[hidden email]]
Sent: Thursday, July 02, 2009 12:30 PM
To: [hidden email]
Subject: SV: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

Hi Ashok,

 

I can have a look at it too…

 

Could I also have a look at your edi-input-file and your config-file.

 

Regards,

Bård

 

Från: Ashok Sharma [mailto:[hidden email]]
Skickat: den 2 juli 2009 07:34
Till: [hidden email]
Ämne: RE: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

You are right Niko,

There is LF in addition to tilde(~) at the end of each line.

When I removed LF then segment breaker ~ worked fine but when I use the combination of ~ and LF then parsing breaks.

My delimiter tag was like this.

<medi:delimiters segment="~\n" field="*" component="^" sub-component="]" />

I had also tried this

<medi:delimiters segment="~&#10;" field="*" component="^" sub-component="]" />

 

And also when I use only LF as segment breaker then also parsing works fine. And also when I include any other character with ~ like semicolon(;) then also parsing works fine but I am not getting why parsing fails when there is a combination of ~ and LF at the end on each segment.

 

I am using smooks 1.2 jars and edi-message-mapping-1.1.xsd

 

If you can provide me any example I would be glad.

 

Thanks for your help Niko.

 

Thanks & Regards,

Ashok Sharma

 

From: Niko [mailto:[hidden email]]
Sent: Wednesday, July 01, 2009 11:40 PM
To: [hidden email]
Subject: Re: [milyn-user] When using tilde(~) as segment separator edi parsing breaks

 

Hi Ashok,
Check if your EDI file has a newline at the end of each segment. If that is the case, then you might have to change the delimiter definition in the mapping model file to include newline in addition to the tilde (~) character.

Or, for testing purposes, if newline is present, just remove it and test with your current mapping model.

Thanks,
Abhinav

On Wed, Jul 1, 2009 at 10:12 AM, Ashok Sharma <[hidden email]> wrote:

Thanks Nick,
I had tried with "&#126;" code for tilde(~) as I was using "&#10;" for LF,
but the same error was there.

Thanks & Regards,
Ashok Sharma


-----Original Message-----
From: Nick Heitz [mailto:[hidden email]]
Sent: Wednesday, July 01, 2009 8:14 PM
To: [hidden email]
Subject: Re: [milyn-user] When using tilde(~) as segment separator edi
parsing breaks

This might not be related, but I have found in the past, when working on
Unix systems, that I had to escape the tilda character in order to use
it.  Have you tried using the ascii code in your delimiters definition?

Nick Heitz
Ashok Sharma wrote:
>
> Hi All,
>
> I am getting EDI message like this
>
>
>
> ISA*00*          *00*          *ZZ*D00111         *ZZ*0055
>     *090320*1337*U*00405*000000121*0*T*:~
>
> GS*SM*D00111*0055*20090320*1337*1210001*X*004050~
>
> ST*990*559200008~
>
> B1*ABCD*12345678*20090205*A~
>
> SE*3*559200008~
>
> GE*1*1210001~
>
> IEA*1*000000121~
>
>
>
> To parse this file I am using below delimiters tag in edi mapping file
>
> <medi:delimiters segment="~" field="*" component="^" sub-component=":" />
>
>
>
> But in this case parsing fails with below error message
>
>
>
> 01-Jul-2009 19:51:23 org.milyn.smooks.edi.SmooksEDIReader getMappingModel
>
> INFO: Parsed, validated and cached EDI mapping model [DVD Order,
> Version 1.0].  Target Profile(s)
> [org.milyn.profile.profile#default_profile].
>
> Exception in thread "main" _org.milyn.SmooksException_: Unable to
> filter InputStream for target profile
> [org.milyn.profile.Profile#default_profile].
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:290_)
>
>       at
>
org.milyn.delivery.dom.SmooksDOMFilter.doFilter(_SmooksDOMFilter.java:238_)
>
>       at org.milyn.Smooks._filter(_Smooks.java:341_)
>
>       at org.milyn.Smooks.filter(_Smooks.java:319_)
>
>       at main.java.example.Main.runSmooksTransform(_Main.java:60_)
>
>       at main.java.example.Main.main(_Main.java:73_)
>
> Caused by: _org.milyn.edisax.EDIParseException_: EDI message
> processing failed [DVD Order][1.0].  Must be a minimum of 1 instances
> of segment [GS].  Currently at segment number 2.
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:300_)
>
>       at org.milyn.edisax.EDIParser.mapSegments(_EDIParser.java:251_)
>
>       at org.milyn.edisax.EDIParser.parse(_EDIParser.java:225_)
>
>       at
> org.milyn.smooks.edi.SmooksEDIReader.parse(_SmooksEDIReader.java:116_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:120_)
>
>       at org.milyn.delivery.dom.DOMParser.parse(_DOMParser.java:87_)
>
>       at
> org.milyn.delivery.dom.SmooksDOMFilter.filter(_SmooksDOMFilter.java:286_)
>
>       ... 5 more
>
>
>
> Please help me so I can parse this edi file
>
>
>
>
>
> *Thanks & Regards,*
>
> Ashok Sharma
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email

 

Loading...