Working with a data source from XSLT

Here should go questions about transforming XML with XSLT and FOP.
Vadi
Posts: 5
Joined: Fri Sep 13, 2013 4:29 am

Working with a data source from XSLT

Post by Vadi »

I've got an XSLT 2.0 transformation in Oxygen 14.2 that currently produces locally produces a result which the needs to be uploaded to an eXist database. Since Oxygen is connected to the database already (it is a "data source"), I'd like to remove the manual step of uploading and have the transformation (or the transformation scenario) do this for the user.

I'm not all that familiar with what Oxygen offers me in this regard however, and searching didn't bring up much. What would be the best way to solve this problem?
Vadi
Posts: 5
Joined: Fri Sep 13, 2013 4:29 am

Re: Working with a data source from XSLT

Post by Vadi »

One additional detail that complicates a simple file upload is that I'd like to create a backup of the old file beforehand in the same collection (so a file rename will do).
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Working with a data source from XSLT

Post by adrian »

Hi,

Unfortunately a transformation scenario in Oxygen can only be configured to output to the local file system. It cannot be configured to upload or output to a remote location. So this is not very straightforward.

Possible workarounds (not covering the backup):
- Map/mount the eXist database via WebDAV in the local file system (as a drive in Windows). Then you can configure the Oxygen transformation to output there.
- Create a custom stylesheet that outputs (via xsl:result-document) directly to the remote location URI:
e.g. for WebDAV connection

Code: Select all

<xsl:result-document href="http://path/to/my/resource" >
e.g. for eXist native connection

Code: Select all

<xsl:result-document href="oxygen:/<data-source-name>$<connection-name>/path/to/my/resource">
In both cases you can easily obtain the required URI from the Data Source Explorer view. Right click on the resource and use the Copy Location action from the contextual menu.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Vadi
Posts: 5
Joined: Fri Sep 13, 2013 4:29 am

Re: Working with a data source from XSLT

Post by Vadi »

Thanks!
Post Reply