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
Jon GallegosSubject: Error running on UNIX
Author: Jon Gallegos
Date: 10 Nov 2009 12:01 PM
I have the following code in my xslt file

<jpeg><xsl:value-of select="document(concat('adapter:Base-64?',$IconMSDrawing))"/></jpeg>

When I test on a windows machine $IconMSDrawing is
p:\ECRF\scripts\Icons\PDF.jpg

When I system test on a unix machine $IconMSDrawing looks like this
/nas02/ECRF/scripts/Icons/PDF.jpg

when I run in windows I run just fine, when i run on unix i get his error
FODC0005: java.net.MalformedURLException: unknown protocol: adapter

How do I point to a file in unix?

Postnext
Tony LavinioSubject: Error running on UNIX
Author: Tony Lavinio
Date: 11 Nov 2009 07:58 AM
If you're running the standalone DataDirect XML Converters on Unix,
you might want to open a SupportLink call with DataDirect support so
that the issue is properly tracked.

This forum is limited in scope to Stylus Studio issues.

Postnext
Jon GallegosSubject: Error running on UNIX
Author: Jon Gallegos
Date: 11 Nov 2009 08:10 AM
I have Stylus Studio not Data Direct

Postnext
Jon GallegosSubject: Error running on UNIX
Author: Jon Gallegos
Date: 11 Nov 2009 08:13 AM
I have Stylus Studio not Data Direct

Postnext
Tony LavinioSubject: Error running on UNIX
Author: Tony Lavinio
Date: 11 Nov 2009 05:23 PM
In order to use the adapter: protocol, you need the XML Converters
that are included with Stylus Studio, or licensed separately for
use outside of Stylus Studio.

See http://www.xmlconverters.com/ for details.

Stylus Studio is a Windows-only product; the runtime components are
not limited to Windows though.

Postnext
Jon GallegosSubject: Error running on UNIX
Author: Jon Gallegos
Date: 12 Nov 2009 12:03 PM
ok

I have changed my xsl document

I have added xmlns:saxon="http://saxon.sf.net/" to the stylesheet tag

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.plmxml.org/Schemas/PLMXMLSchema" xmlns:b64="net.sf.saxon.v
alue.Base64BinaryValue" xmlns:saxon="http://saxon.sf.net/" exclude-result-prefixes="a b64 saxon">

and this is in the transform
<jpeg><xsl:value-of select="saxon:string-to-base64Binary($MSDrawingIcon)"/></jpeg>

But I am getting this error
XPST0017: XPath syntax error at char 44 on line 431 in {...o-base64Binary($MSDrawingIc...}:
Cannot find a matching 1-argument function named {http://saxon.sf.net/}string-to-base64Binary()
Failed to compile stylesheet. 1 error detected.

Postnext
Alberto MassariSubject: Error running on UNIX
Author: Alberto Massari
Date: 12 Nov 2009 12:44 PM
Hi Jon,
according to http://saxonica.com/documentation/extensions/functions/stringtobase64binary.html the function has two arguments, not one.

Alberto

Postnext
Jon GallegosSubject: Error running on UNIX
Author: Jon Gallegos
Date: 12 Nov 2009 01:08 PM
This is not working as I need it to work. Where can I find the other parameters besides "UTF8"?

What encoding is used when I use this command?
document(concat('adapter:Base-64?',$IconMSDrawing))

Postnext
Alberto MassariSubject: Error running on UNIX
Author: Alberto Massari
Date: 13 Nov 2009 06:26 AM
Hi Jon,
the Saxon method you are trying to use is not indeed doing the same operation of XML Converters; it will take the *string* and convert it to base64, and not interpreting as a path to a file to be read as a binary stream to be converted. Saxon has the saxon:octets-to-base64Binary() function, but it looks it is missing a function to load a URI as a sequence of octets. If using DataDirect XML Converter is not possible, you should investigate accessing java.io.FileInputStream from the XSLT, or writing an ad-hoc extension function in Java.

Hope this helps,
Alberto

Postnext
Jon GallegosSubject: Error running on UNIX
Author: Jon Gallegos
Date: 13 Nov 2009 11:28 AM
do you have an example of the octets-to-base64Binary? The Saxon site does not give any. And the example they give is extremly confusing to me.

saxon:octets-to-base64Binary($octets as xs:integer*) ==> xs:base64Binary

Postnext
Jon GallegosSubject: Error running on UNIX
Author: Jon Gallegos
Date: 13 Nov 2009 12:11 PM
ok

I have downloaded datadirect. what do I do now?

Posttop
(Deleted User) Subject: Error running on UNIX
Author: (Deleted User)
Date: 16 Nov 2009 09:50 AM
Hi Jon, going back to your original xslt which contained:
<jpeg><xsl:value-of select="document(concat('adapter:Base-64?',$IconMSDrawing))"/></jpeg>

adapter:Base-64 is part of the Data Direct XML Converters product. If you want to use it on UNIX, you will have to download a copy of the DataDirect XML Converters product and install it on UNIX. Once that is done, you can run your saxon XSLT on unix.

If your xslt contains document("adapter:Base-64?......") then you are asking the xslt processor to use a "URI Resolver" to resolve "adapter:Base-64...."

You will have to register Data Direct XML Converters as the URI Resolver for saxon, using this java code:

com.ddtek.xmlconverters.ConverterFactory factory = new com.ddtek.xmlconverters.ConverterFactory();
transformer.setURIResolver(factory.newResolver());

Hope this helps
Clyde Kessel

 
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.