[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Accessing External Java Library

Subject: Accessing External Java Library
From: "Carl Bourne" <cbourne@xxxxxxxxxxxxxxx>
Date: Wed, 31 Oct 2007 22:43:16 -0000
 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
 
 
 

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.