If you want to automate EDI validation or EDI to XML conversion using XQuery you can use the EDI analyzer API. you can read more in the
XML Converters User's Guide located in your Stylus Studio installation here
c:\Program Files\
-Stylus Studio X16 XML Enterprise Suite 64-bit\
--Components\
---XML Converters for Java\
----doc\
-----xmlconverters-ug.pdf
Please notice that Stylus Studio is strictly a design tool, if you want to deploy an automated solution you will need to license the runtime, see XML Pipeline Server at http://www.xmlpipelineserver.com
Subject:Automatic Error Detection and Quick-Fix Corrections Author:Ivan Pedruzzi Date:04 Mar 2021 12:53 AM Originally Posted: 02 Mar 2021 08:01 PM
In addition you may want to read chapter "EDI Analysis Functions" in the DataDirect XQuery User's Guide located in your Stylus Studio installation here
c:\Program Files\
-Stylus Studio X16 XML Enterprise Suite 64-bit\
--Components\
---DataDirect XQuery\
----books\
-----ddxquery\
------ddxqug\
-------ddxqug.pdf
The following is an extract from the chapter
Notice that the EDI Analyzer API can create the acknowledge message automatically.
let $edi := "EDI:tbl=yes?file:///c:/EDI/code99.x12"
let $report := ddtek:analyze-edi-from-url($edi)
let $ack := $report/AnalyzeReport/Response/Acknowledgement/X12
let $receipt := $report/AnalyzeReport/Response/Receipt/X12
let $xml := ddtek:edi-to-xml-from-url($edi, $report)
return(
ddtek:serialize-to-url($report ,"file:///c:/EDI/code99.x12.report.xml", "")
,ddtek:serialize-to-url($xml ,"file:///c:/EDI/code99.x12.xml", "")
,ddtek:serialize-to-url($receipt,"file:///c:/EDI/code99.rec.x12","method=EDI"
)
,ddtek:serialize-to-url($ack ,"file:///c:/EDI/code99.ack.x12","method=EDI")