XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Bruce CantorSubject: Query and Sftp clent
Author: Bruce Cantor
Date: 09 Aug 2021 10:53 AM
Originally Posted: 09 Aug 2021 10:52 AM
Hi

I am having a problem with xquery and sftp client functionality.


Having this script:

declare namespace xps_sftp = "ddtekjava:com.ivitechnologies.pipeline.ext.net.SFTP";
declare variable $ediData as xs:string external;

declare variable $config := <root host="xxxx" port="22" path="/EET_Inbox" user="integration_test" password="xxxx"/>;

declare function xps_sftp:sendString($element as element(), $data as xs:string, $targetPath as xs:string) as xs:boolean external;

let $now := ddtek:format-dateTime(fn:current-dateTime(),'[Y0001][M01][D01][H01][m01][s01]') ,
$fileName := concat("S8000092.Order.",$now,'.edi')
return
xps_sftp:sendString($config,$ediData,$fileName)

This script works if I just have a pipeline where an EDIFACT file is used as input, but if I do transformations from XML to EDIFACT before applying this script nothing is placed on the ftp server and an error is thrown "No value has been bound to the external variable $edidata"

I need to apply a special name to the file, otherwise I would have just used the binding file option.

Can anyone tell me why edifact data can be parsed directly , but not as the result of an conversion?


I have attached the two pipelines, the working one and the faulty one.


Unknowndemo1_works.pipeline
demo1_works

Unknowndemo2_doesnotwork.pipeline
demo2_doesnotwork

Postnext
Ivan PedruzziSubject: Query and Sftp clent
Author: Ivan Pedruzzi
Date: 09 Aug 2021 08:38 PM
Can you zip your files (pipeline and query) and attached again?

Ivan Pedruzzi
Stylus Studio Team

Postnext
Bruce CantorSubject: Query and Sftp clent
Author: Bruce Cantor
Date: 10 Aug 2021 06:43 AM
Here is the full pipeline flows including xslt scripts and archive outgoing port. In Stylus Studio it can be seen that there is output from the xslt script.


Unknowndemos.zip
zip file with pipeline and testdata

Posttop
Ivan PedruzziSubject: Query and Sftp clent
Author: Ivan Pedruzzi
Date: 13 Aug 2021 04:24 AM
Originally Posted: 13 Aug 2021 04:23 AM
This is may be a limitation is the Stylus Studio pipeline debugger.

However the all thing can be done with one query, see attached project, still keeping the XML to EDI mapping in a separate library module which can be re-used.

I converted your XSLT logic to XQuery which is far less verbose.

BTW watch out, you have the purchase order line date hard coded to 20210415.


Ivan Pedruzzi
Stylus Studio Team


Documentsony-order.zip

 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.