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 (2017)
-> - Problems with FTP upload via X... (3)
-> ->Problems with FTP upload ...
-> ->Problems with FTP upload ...
-> + What path notation works when ... (6)
-> - Xquery Exception (1)
-> + [java] [Fatal Error] Test.xml:... (2)
-> + unable to produce correct XML ... (2)
-> + where can I find stylusxql uti... (3)
-> + Trouble Mapping Multiple Eleme... (3)
-> - input parameter (1)
-> - set element value (1)
-> + Xquery Performance Issue (21)
-> + Run Xquery Program using Java (3)
-> + XQuery XML to CSV (3)
-> + XQuery MySQL connector (4)
-> + XQuery with JDBC connection is... (3)
-> + Create FTP Server (2)
-> + XQuery Nested Loop Lookup (5)
-> + Xpath using a Variable for [@I... (2)
-> - My xqDoc option is disabled. (1)
-> + Xpath ancestor selection (4)
-> + Exception: sequence of more th... (2)
-- [1-20] [21-40] [41-60] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
(Deleted User) Subject: Problems with FTP upload via XQuery
Author: (Deleted User)
Date: 05 Jun 2020 05:54 PM
Originally Posted: 04 Jun 2020 11:40 AM
Hi

I need to prefix outgoing files from my XML pipleline with a static value: 'S8000092.' and as far as I can see this is some I cannot achieve via the Pipeline Output node.
Am I right? Or is there an easier way to append a prefix to an outgoing file that needs to be placed on a FTP server?

So I am trying to make a xquery script that does the trick, but it is giving me some trouble.

I copied the sample script from the XML Pipeline server guide, added the needed jars.
The script is returning this error:

javax.xml.xquery.XQQueryException: [DataDirect][XQuery]Error at line 10, column 1. Error in call to extension function "public static boolean com.ivitechnologies.pipeline.ext.net.SFTP.sendFile(org.w3c.dom.Element,java.lang.String,java.lang.String) throws java.lang.Throwable": Exception in extension function "10: "
at com.ddtek.xquery.xqj.Util.createXQQueryException(Util.java:341)
at com.ddtek.xquery.xqj.Util.createXQQueryFromXPathException(Util.java:415)
at com.ddtek.xquery.xqj.Util.createXQException(Util.java:237)
at com.ddtek.xquery.xqj.DDXQAbstractSequence.writeSequence(DDXQAbstractSequence.java:466)

Can anyone tell me what it supposed to mean? The 10: refers to line 10 I think, this is where the cursor ends up.

The script:

declare namespace xps_sftp = "ddtekjava:com.ivitechnologies.pipeline.ext.net.SFTP";
declare function xps_sftp:sendFile($element as element(), $uriLocalFile as xs:string, $targetPath as xs:string) as xs:boolean external;
declare variable $sftp := <root host='ftp.eetgroup.com' port='22' path='/' user='<...>' password='<...>'/>
xps_sftp:sendFile(sftp,resolve-uri("../testdata/ORDERS_881141.xml", fn:static-base-uri()),"ORDERS_881141.xml")


added jars to project:
xmlpipelineserver.jar
json-20090211.jar
commons-net-3.6.jar
jsch-0.1.53.jar

Postnext
Ivan PedruzziSubject: Problems with FTP upload via XQuery
Author: Ivan Pedruzzi
Date: 05 Jun 2020 05:52 PM
After an offline conversation we discovered that the SFTP user does not have write access to folder EET_Outbox.

XML Pipeline Server SFTP client can connect successfully and upload file on different folders

Ivan Pedruzzi
Stylus Studio Team

Posttop
Jennie HustSubject: Problems with FTP upload via XQuery
Author: Jennie Hust
Date: 16 Dec 2022 06:41 AM
EXPath File Transfer XQuery Extension ModuleEdit. This module does both FTP, SFTP (using the SSH protocol) using a standardized and consistent format. A zipfile is a binary file. That's probably why uploading it as .xml corrupts the file. Try specifying FTP_BINARY instead of FTP_ASCII.

   
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.