Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: XDK - call xsql from xsl - Java extension functions

Re: XDK - call xsql from xsl - Java extension functions

From: Nicolas <Nicolas_Clement_at_yahoo.fr>
Date: 25 Apr 2003 07:27:52 -0700
Message-ID: <d37ac0e8.0304250627.7ab17867@posting.google.com>


I have solved part of my problem put I still need your help for the params:

The xsl looks like:



<xsl:stylesheet version="1.0" exclude-result-prefixes="ora"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ora="http://www.oracle.com/XSL/Transform/java"
xmlns:xsql="http://www.oracle.com/XSL/Transform/java/oracle.xml.xsql.XSQLRequest"
xmlns:url="http://www.oracle.com/XSL/Transform/java/java.net.URL"
xmlns:has="http://www.oracle.com/XSL/Transform/java.util.Hashtable">
	<xsl:template match="/">

<xsl:variable name="url"
select="url:new('file://G:/projects/test.xsql')"/>
<xsl:variable name="req" select="xsql:new($url)"/>
<xsl:variable name="res" select="xsql:process($req)"/>
<xsl:value-of select="$res"/>
</xsl:template>

</xsl:stylesheet>

I still need to translate the following java code into the xsl java extension:

   Hashtable params = new Hashtable(3);
   params.put("param1","value1");

The java code is:



import oracle.xml.xsql.XSQLRequest;
import java.util.Hashtable;
import java.io.PrintWriter;
import java.net.URL;

public class XSQLRequestSample {
  public static void main( String[] args) throws Exception {

     // Construct the URL of the XSQL Page    URL pageUrl = new URL("file://G:/projects/bnpp/enet-pt/test.xsql");    // Construct a new XSQL Page request
   XSQLRequest req = new XSQLRequest(pageUrl);    // Setup a Hashtable of named parameters to pass to the request    Hashtable params = new Hashtable(3);
   params.put("param1","value1");
   params.put("param2","value2");
   /* If needed, treat an existing, in-memory XMLDocument as if

Nicolas_Clement_at_yahoo.fr (Nicolas) wrote in message news:<d37ac0e8.0304242339.335eb9b7_at_posting.google.com>...

> Hello, 
> I am trying to call xsql from xsl using the java extension functions
> with no success. If you have a sample xsl code, it would be great.
> Thank you for your help, 
> NC
Received on Fri Apr 25 2003 - 09:27:52 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US