Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Accessing External Java Library

From: "Carl Bourne" <cbourne@--------------->
To:
Date: 11/1/2007 12:39:00 AM
Hi Michael,

I tried the -TJ flag but it didn't seem to provide me with any more
information:

C:\Documents and Settings\cbourne.LATITUDE-D620\My Documents\PGPJava>java -cp
c:
\ColdFusion8\javapgp -jar saxon8.jar -TJ test.xml test.xslt
Error at xsl:value-of on line 12 of
file:/C:/Documents%20and%20Settings/cbourne.
LATITUDE-D620/My%20Documents/PGPJava/test.xslt:
  XPST0017: XPath syntax error at char 58 on line 12 in {...exicon", "test
for",
 " ", "...}:
    Unknown system function pgp.encrypt()
Failed to compile stylesheet. 1 error detected.


Regards,

Carl Bourne
Intellect
DDI: +44 1491 842502
M: +44 7770 284294





-----Original Message-----
From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
Sent: 31 October 2007 22:59
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Accessing External Java Library

Try the -TJ flag, which will help to distinguish between the different
reasons for not finding the method you want to call. The most common reasons
are:

class not on classpath (often caused by using -jar on the command line,
which means there is no classpath)

class not public

method name wrong

method not public

method not static (when the call assumes it will be)

method arguments have wrong type

Michael Kay
http://www.saxonica.com/


> -----Original Message-----
> From: Carl Bourne [mailto:cbourne@xxxxxxxxxxxxxxx]
> Sent: 31 October 2007 22:43
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Accessing External Java Library
>
> Hi,
>  
> I'm trying to access an external java library using Saxon 8.0
> and XSLT. The library basically calls some PGP functionality
> that encrypts the data within the "data" element of the XML
> file. I also need to be able to set the following attributes:-
>  
> pgp.setArmor(true)
> pgp.setConventional(true)
> pgp.setInputIsText(true)
> pgp.setOutputIsText(true)
> I've defined a style sheet called test.xslt which contains:-
>  
> <xsl:transform
>  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>  version="2.0"
>  xmlns:PGP="java:iPGP.iPGP">
>
> <xsl:template match="data">
>   <result>
>     <xsl:value-of
> select="PGP:pgp.encrypt(&quot;lexicon&quot;, &quot;test
> for&quot;, &quot;&quot;, &quot;&quot;)"/>
>   </result>
> </xsl:template>
> </xsl:transform>
>  
> The XML simply contains:-
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <data>Test Data</data>
>  
> However, I'm having problems accessing the external java
> class and defining the set parameters that must be defined
> prior to invoking the class. Here's an example of accessing
> the library from a Java perspective:-
>  
> import iPGP.iPGP.*
> def pgp = new iPGP.iPGP()
> pgp.setArmor(true)
> pgp.setConventional(true)
> pgp.setInputIsText(true)
> pgp.setOutputIsText(true)
> errorcode=pgp.encrypt("lexicon", "test for", "", "")
> data=pgp.getASCIIOutput()
> println data
>  
> Would somebody be kind enough to explain/show how I could do this?
>  
> Best Regards,
>  
> Carl
>  
>  
>


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent