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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
- XQuery Help and Discussion (2016)
-> - Issue with Processing Instruct... (1)
-> + problem converting json to XML... (2)
-> + Problem base64 decoding string... (3)
-> + Problems posting multipart for... (5)
-> + trouble with download of price... (2)
-> + Problem with http-post not bei... (3)
-> + path problem, xps_file:writeAl... (9)
-> + Xquery update support? (2)
-> + problem with Stylus studio try... (5)
-> + adding dtd reference to xml ou... (4)
-> + xquery escaping ambarsand when... (3)
-> + Whitespace problem when return... (5)
-> + Problem with namespace prefix ... (5)
-> - Sending via SFTP returns unexp... (1)
-> - Query and Sftp clent (4)
-> ->Query and Sftp clent
-> ->Query and Sftp clent
-> ->Query and Sftp clent
-> + xquery and try - catch (3)
-> + Query + ddtek:http-post optio... (5)
-> + Example files referenced in do... (3)
-> + Automatic Error Detection and ... (3)
-> + Working with result of ddtek:h... (2)
-- [1-20] [21-40] [41-60] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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

   
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.