I'm trying to validate and process an EDI 834 file using Smooks 2.x in a Java test automation framework.
I'm loading raw EDI content (starting with ISA*) into a String, and configuring Smooks with a smooks-config.xml file and a programmatic registration of EDIReaderConfigurator. My goal is to map EDI segments into JavaBeans and validate them after parsing.
In my EDIProcessor class, I:
Read the EDI file into a string
Initialize Smooks using new Smooks(SMOOKS_CONFIG)
Register a DefaultResourceConfig for "edi:reader" with the correct parameters and EDIReaderConfigurator
Set up a JavaResult
Attempt to filter using smooks.filterSource(...)
However, I'm getting this error:
It appears Smooks is attempting to parse the EDI file as XML. After some digging, I realized I was using StringSource, which seems intended for XML. I'm switching to StreamSource with a StringReader instead.
Can you confirm this is the correct approach for non-XML EDI input in Smooks 2.x? And is JavaResult still supported when filtering via ExecutionContext, or do I need to work directly with the BeanContext?
Thanks in advance — happy to share code snippets if helpful.
It appears Smooks is attempting to parse the EDI file as XML. After some digging, I realized I was using StringSource, which seems intended for XML. I'm switching to StreamSource with a StringReader instead.
--
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/smooks-user/3b2ff05e-39a8-4e66-b8e1-ce6ceb9bfed6n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/smooks-user/2c4ba378-fce2-429e-a952-8f45618dc36fn%40googlegroups.com.