XSQLCommand and XSQLRequest.

Hi Steve,
I'm in a very strange position.
I'm trying to execute an .xsql page through both command line and XSQLRequest.it works fine with the XSQLCommand encapsulated by xsql.bat but when i try to execute it through XSQLRequest it says the follwing.
XSQL-004: Could not acquire a database connection named: pnet
XSQL-007: Cannot acquire a database connection to process page.
does this mean that XSQLRequest can only be used on a machine which has physical datbase.
(i mean the database server.).
i'm testing it on my client machine.
Thanks
Aman

No, it likely just means that the environment where you are attempting
to process the XSQL page doesn't have
it's CLASSPATH properly setup to
point to an XSQLConfig.xml file
which defines the connection name
your page is trying to use.
Calling XSQLRequest from a "client"
does the XSQL Page Processing on that client machine. If you want to retrieve
the output of an XSQL Page processing
that is done on another machine, then
that's what the XSQL Servlet is for.
the client simply requests the URL:
http://somemachine/foo/bar.xsql
and they get the answer.
If you are simply trying to retrieve
the output of a server-side-processed
XSQL page, then all you need is what
you'd need for retrieving any HTTP-based
resource.
(1) Construct an URL object
(2) openStream() on the URL
(3) do something with the stream.

Similar Messages

  • Strange characters in output when using

    We are using xsql and xsqlrequest class
    when I use xsql I get the following result
    Media Type: VCCD1
    Price: 3708.72
    when I use XSQLRequest I get the following result
    Media Type: VCCD1
    Price: 3708.72B B
    B: This character is coming out of nowhere.
    We are using weblogic5.1
    The following code also introduces these characters in the output:
    private XSLProcessor XSLProc = new XSLProcessor();
    XSLProc.processXSL(xsl, (XMLDocument)doc, new PrintWriter(out));

    Does your stylesheet have an encoding="..." attribute in its <xsl:output> ?
    Are you using 2.0.2.9 version?
    Thanks.

  • How can I use XSQLRequest for processing in-memory XMLDocument

    How can I use class XSQLRequest for processing in-memory XSQL?
    What should i pass in URL parameter value for constructor XSQLRequest(XMLDocument p0, URL p1)?
    Could you write the some examples?

    Here's one example of doing this:
    String xsqlPage = "<page connection='demo' xmlns:xsql='urn:oracle-xsql'>"+
                      "  <xsql:set-page-param name='username' value='{@u}'/>"+
                      "  <xsql:set-page-param name='password' value='{@p}'/>"+
                      "  <xsql:query bind-params='username password'>"+
                      "    select 'Authenticated' from dual"+
                      "    where 'SCOTT' = UPPER(?) /* username */"+
                      "      and 'TIGER' = UPPER(?) /* password */"+
                      "  </xsql:query>"+
                      "</page>";
      DOMParser d = new DOMParser();
      d.parse( new StringReader(xsqlPage));
      XSQLRequest req = new XSQLRequest(d.getDocument(),null);
      StringWriter sw = new StringWriter();
      PrintWriter errors = new PrintWriter(sw);
      Hashtable h = new Hashtable(2);
      h.put("u","scott");
      h.put("p","tiger");
      req.process(h,output,errors);
      output.println(sw.toString());

  • XSQLRequest ,XSLProcessor , XSLStylesheet  Memory Problem

    Solaris & NT.
    Using the following processor combination to generate xmldocuments for an output stream, We are experiencing what appears to be a over caching of xml objects or objects not being garbage collected after use. (JProb on OC4J analysis)
    The processing works repeatedly - using a JVM with -mx=98MB after a processing some XML Objects accumulate until whatever memory resources you have allocated are exhausted. Currently processing 1200 documents will generate enough left over objects to bring the system to a halt and OutOfMemory Error.
    XSLStylesheet sheet = null;
    XSLProcessor xslt = new XSLProcessor();
    XSQLRequest req = new XSQLRequest(new URL(resMasterGetUrl));
    Hashtable params = new Hashtable(1);
    params.put("pageName",urlFilename.toString().toLowerCase());
    OutputStream out
    xslt.processXSL(new XSLStylesheet((XMLDocument)req.processToXML(params),new URL(resMasterGetBaseStyleUrl)),xmlParameters,out);
    out.close();
    req = null;
    xslt = null;
    sheet = null;
    params = null;
    COUNT MEMORY
    oracle.xml.parser.v2     DOMParser     1 ( 0.0%)     20 ( 0.0%)     
    oracle.xml.parser.v2     DTD     1 ( 0.0%)     68 ( 0.0%)     
    oracle.xml.parser.v2     DocumentBuilder     1 ( 0.0%)     92 ( 0.0%)     
    oracle.xml.parser.v2     Entry     910 ( 2.2%)     18,200 ( 0.2%)     
    oracle.xml.parser.v2     EqualExpr     5 ( 0.0%)     180 ( 0.0%)     
    oracle.xml.parser.v2     FastVector     57 ( 0.1%)     684 ( 0.0%)     
    oracle.xml.parser.v2     FilterExpr     53 ( 0.1%)     5,300 ( 0.1%)     
    oracle.xml.parser.v2     FromAttributes     1 ( 0.0%)     4 ( 0.0%)     
    oracle.xml.parser.v2     FromChildren     20 ( 0.0%)     80 ( 0.0%)     
    oracle.xml.parser.v2     FromDescendantAttributes     1 ( 0.0%)     4 ( 0.0%)     
    oracle.xml.parser.v2     FromDescendants     25 ( 0.1%)     300 ( 0.0%)     
    oracle.xml.parser.v2     FromSelf     5 ( 0.0%)     60 ( 0.0%)     
    oracle.xml.parser.v2     NSNameImpl     38 ( 0.1%)     760 ( 0.0%)     
    oracle.xml.parser.v2     NodeFactory     5 ( 0.0%)     20 ( 0.0%)     
    oracle.xml.parser.v2     NonValidatingParser     1 ( 0.0%)     116 ( 0.0%)     
    oracle.xml.parser.v2     ObjectPool     46 ( 0.1%)     552 ( 0.0%)     
    oracle.xml.parser.v2     ParserState     2 ( 0.0%)     72 ( 0.0%)     
    oracle.xml.parser.v2     PathExpr     53 ( 0.1%)     3,180 ( 0.0%)     
    oracle.xml.parser.v2     Predicate     1 ( 0.0%)     12 ( 0.0%)     
    oracle.xml.parser.v2     SAXAttrList     2 ( 0.0%)     72 ( 0.0%)     
    oracle.xml.parser.v2     Step     28 ( 0.1%)     1,904 ( 0.0%)     
    oracle.xml.parser.v2     StringHashtable     1 ( 0.0%)     4 ( 0.0%)     
    oracle.xml.parser.v2     XMLAttr     230 ( 0.6%)     13,800 ( 0.2%)     
    oracle.xml.parser.v2     XMLAttrList     288 ( 0.7%)     3,456 ( 0.0%)     
    oracle.xml.parser.v2     XMLComment     44 ( 0.1%)     1,584 ( 0.0%)     
    oracle.xml.parser.v2     XMLDOMImplementation     1 ( 0.0%)     4 ( 0.0%)     
    oracle.xml.parser.v2     XMLDeclPI     5 ( 0.0%)     260 ( 0.0%)     
    oracle.xml.parser.v2     XMLDocument     5 ( 0.0%)     500 ( 0.0%)     
    oracle.xml.parser.v2     XMLElement     308 ( 0.7%)     18,480 ( 0.2%)     
    oracle.xml.parser.v2     XMLEntity     6 ( 0.0%)     600 ( 0.0%)     
    oracle.xml.parser.v2     XMLError     6 ( 0.0%)     456 ( 0.0%)     
    oracle.xml.parser.v2     XMLNodeList     139 ( 0.3%)     1,668 ( 0.0%)     
    oracle.xml.parser.v2     XMLPI     1 ( 0.0%)     36 ( 0.0%)     
    oracle.xml.parser.v2     XMLReader     1 ( 0.0%)     92 ( 0.0%)     
    oracle.xml.parser.v2     XMLText     498 ( 1.2%)     17,928 ( 0.2%)     
    oracle.xml.parser.v2     XMLUTF8Reader     1 ( 0.0%)     108 ( 0.0%)     
    oracle.xml.parser.v2     XSLAttribute     5 ( 0.0%)     580 ( 0.0%)     
    oracle.xml.parser.v2     XSLCondition     5 ( 0.0%)     540 ( 0.0%)     
    oracle.xml.parser.v2     XSLExprValue     106 ( 0.3%)     4,664 ( 0.1%)     
    oracle.xml.parser.v2     XSLForEach     7 ( 0.0%)     756 ( 0.0%)     
    oracle.xml.parser.v2     XSLNode     2 ( 0.0%)     200 ( 0.0%)     
    oracle.xml.parser.v2     XSLNodeList     103 ( 0.2%)     1,236 ( 0.0%)     
    oracle.xml.parser.v2     XSLNodeSetExpr     2 ( 0.0%)     72 ( 0.0%)     
    oracle.xml.parser.v2     XSLOutput     1 ( 0.0%)     148 ( 0.0%)     
    oracle.xml.parser.v2     XSLResultElement     87 ( 0.2%)     10,092 ( 0.1%)     
    oracle.xml.parser.v2     XSLStylesheet     1 ( 0.0%)     172 ( 0.0%)     
    oracle.xml.parser.v2     XSLTemplate     3 ( 0.0%)     540 ( 0.0%)     
    oracle.xml.parser.v2     XSLValueOf     6 ( 0.0%)     648 ( 0.0%)     
    oracle.xml.parser.v2     XSLVariable     23 ( 0.1%)     2,852 ( 0.0%)     
    oracle.xml.xsql     XSQLConfigManager     1 ( 0.0%)     100 ( 0.0%)     
    oracle.xml.xsql     XSQLConnectionManagerFactoryImpl     1 ( 0.0%)     4 ( 0.0%)     
    oracle.xml.xsql     XSQLLRUCache     2 ( 0.0%)     40 ( 0.0%)     
    oracle.xml.xsql     XSQLLRUCache$LRUNode     2 ( 0.0%)     40 ( 0.0%)     
    oracle.xml.xsql     XSQLNamedConnection     9 ( 0.0%)     180 ( 0.0%)     
    oracle.xml.xsql     XSQLPage     1 ( 0.0%)     12 ( 0.0%)     
    oracle.xml.xsql     XSQLPageManager     1 ( 0.0%)     4 ( 0.0%)     
    oracle.xml.xsql     XSQLStylesheet     1 ( 0.0%)     20 ( 0.0%)     
    oracle.xml.xsql     XSQLStylesheetManager     1 ( 0.0%)     4 ( 0.0%)     
    oracle.xml.xsql     XSQLStylesheetPool     1 ( 0.0%)     52 ( 0.0%)

    Also, please note what exact version of Oracle XDK for Java you are using. You can find this out (if you're not sure) by doing:
      System.out.println(DOMParser.getReleaseVersion());

  • Error handling for XSQLRequest?

    Hi,
    I'm using the XSQLRequest class
    programmatically from within a
    servlet. I works great.
    It takes streams for out and err...
    But is there any way to detect errors
    via the exception mechanism so that
    I can take appropriate steps to correct
    the problem and alert the user?
    cheers,
    Vijay
    null

    All errors are handled via the error stream. No exceptions get raised. What kind of error are you trying to trap, for future feature planning?

  • A XSQLRequest Mystery Solved: Please Read

    On various occasions, folks have complained that, when working with the XSQLRequest class, that their parameters are not properly handled. It always seems to happen when they are creating the XSQLRequest object by passing it a URL which is based on an http://[] protocol scheme.
    Today I believe I finally found the explanation for this, so let me explain.
    Say you have an XSQL Page like this:<xsql:query connection="research" xmlns:xsql="urn:oracle-xsql">
    select pkTelephone.registerDamage
    ( to_number({@txtTelephone}),
    to_number({@txtDamageType}),
    '{@txtComments}'
    ) as RESULT
    from dual
    </xsql:query>and a sample program that's trying to use XSQLRequest like this: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("http://fchaves/iopenflex/xapi/dano.registrar.xsql");
    // Construct a new XSQL Page request
    XSQLRequest req = new XSQLRequest(pageUrl);
    Hashtable params = new Hashtable(4);
    params.put("txtTelephone","1");
    params.put("txtDamageType","1");
    params.put("txtComments","1");
    req.process(params,new PrintWriter(System.out),new PrintWriter(System.err));
    }When the XSQLRequest class retrieves the XSQL page template to process by requesting the URL that is specified, [b]http://fchaves/iopenflex/xapi/dano.registrar.xsql, it requests the "dano.registrar.xsql" page from the fchaves web server (listening on the default port 80).
    Since (as is likely the case with many of the customers who have reported the problem here) the fchaves web server is configured to process requests for pages that end in *.xsql using the XSQL Servlet, before the requesting program -- the XSQLRequestSample in this case -- receives the result, the page is processed on the server by the XSQL Servlet before getting returned to the XSQLRequest class.
    Since the request for the b]http://fchaves/iopenflex/xapi/dano.registrar.xsql page does not specify any parameters on the URL, then when the page is processed on the server, all three of the parameters it is expecting (txtTelephone,txtDamageType,txtComments) are blank, so the server-side XSQL Servlet engine processes the page and ends up producing and returning the resulting page to the requesting XSQLRequest class:
    <xsql-error action="xsql:query">
    <statement>select pkTelephone.registerDamage
    ( to_number(),
    to_number(),
    ) as RESULT
    from dual</statement>
    <message>ORA-00938: not enough arguments for function
    </message>
    </xsql-error>The XSQLRequest class then tries to process this returned XML document as an XSQL page template and, not finding any XSQL action elements in the <xsql:*> namespace, simply passes the document through as is.
    So, the result is that the person who runs the XSQLRequestSample program gets an output that looks like the one above and cannot understand why his parameters that are being passed to the XSQLRequest class aren't getting used correctly. The answer is, they are getting passed correctly but by the time the XSQLRequest class sees the page for processing, the page is not the same page you think you're getting!
    The ways to avoid this problem are:
    [list=1]
    [*]Use a file:// URL to reference the XSQL page template.
    [*]Change the extension on the file served by your webserver to anything besides *.xsql. For example, renaming dano.registrar.xsql to dano.registrar.xyz would work)
    [list]
    Hopefully this helps explains a lot of mysteries that people have run into.

    Thank you, that does explain a lot.
    It does present the problem, that it is not possible to use the same XSQL file from a <jsp:include> statement and from the API ...
    Cheers,
    Morten

  • Urgent: XSQLRequest Usage in Stored procedure

    Hi Steve,
    I have developed a java stored procedure and published it as required to be called from a trigger.My java code uses XSQLRequest to read the .xsql page.
    Earlier i was not able to resolve the java code which i had written but some how i finally was able to resolve the code and publish as stored procedure.
    when i run my stored procedure it writes output to the file as intended but it reads as follows:
    Oracle XSQL Programmatic Page Processor 0.9.8.6 (Technology Preview)
    XSQL-003: Failed to find 'XSQLConnections.xml' file in server CLASSPATH.
    XSQL-004: Could not acquire a database connection named: pnet
    XSQL-007: Cannot acquire a database connection to process page.
    since the stored procedure runs inside the oracle server and all the java classes are inside the oracle server i'm unable to comprehend this error.
    it says to have the XSQLConnections.xml file in my classpath but what do i do to change the classpath and which one since i'm running the code inside the oracle server how do i specify the classpath?
    sorry if this sound silly but i'm confused and may be u can help me with this.
    Thanks
    Aman

    loadjava -u username/password XSQLConfig.xml
    this will load the xml file as a resource
    into your server classpath.

  • ANN: XDK 9.0.2.0.0D Beta and 9.0.1.2.0(

    =================================================================
    ==========
    11/30/2001 OTN XDK Release Notes
    =================================================================
    ==========
    XDK 9.0.2.0.0D Beta and 9.0.1.2.0 Production is available online
    at:
    http://technet.oracle.com/tech/xml
    This release mostly contains bug fixes and enhancements.
    * New Features and enhancements are:
    9.0.1.2.0 Production Version:
    XML Schema Processor for Java:
    - Fully supports official W3C Recommendation
    9.0.2.0.0D Beta Version:
    XDK for PL/SQL:
    - New APIs are added:
         XMLDOM.importNode(doc DOMDocument, src DOMNode, deep
    boolean)
         XMLDOM.adoptNode(doc DOMDocument, src DOMNode)

    Also using the command ..
    XSLStylesheet sheet = null;
    XSLProcessor xslt = new XSLProcessor();
    XSQLRequest req = new XSQLRequest(new URL(resMasterGetUrl));
    Hashtable params = new Hashtable(1);
    params.put("pageName",urlFilename.toString().toLowerCase());
    xslt.processXSL(new XSLStylesheet((XMLDocument)req.processToXML(params),new URL(resMasterGetBaseStyleUrl)),xmlParameters,out);

  • XSQLRequest connection error

    I'm working on creating a servlet that executes a XSQL document that only exists in memory. The goal is to have the XSQL stored in a database or dynamicly generated. I'm having a problem getting a XSQL page that needs a database connection to work correctly.
    Here is the code I'm working on right now:
    StringBuffer errorBuilder = new StringBuffer();
    Dictionary params = new Hashtable();
    params.put("test", "MyTestParam");
    StringBuffer xsqlDocBuilder = new StringBuffer();
    xsqlDocBuilder.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
    xsqlDocBuilder.append("<page xmlns:xsql=\"urn:oracle-xsql\" connection=\"buck\">");
        xsqlDocBuilder.append("<test>data</test>");
        xsqlDocBuilder.append("<xsql:current-date/>");
        xsqlDocBuilder.append("<xsql:param name=\"test\"/>");
    xsqlDocBuilder.append("</page>");
    DOMParser parser = new DOMParser();
    try
        parser.parse(new BufferedReader(new StringReader(xsqlDocBuilder.toString())));
    catch (Exception ioe)
        errorBuilder.append("Error parsing XML String:\n");
        errorBuilder.append(ioe);
    XMLDocument xDoc = parser.getDocument();
    XSQLRequest req = new XSQLRequest(xDoc, null);
    XMLDocument xsqlDoc = (XMLDocument)req.processToXML(params);
    XMLPrintDriver pDriver = new XMLPrintDriver(System.out);
    try
        pDriver.printDocument(xsqlDoc);
    catch (Exception e)
        System.out.println("Error printing document to stdout:\n" + e);
    If I remove the "<xsql:current-date/>" action and the connection name it executes correctly. Adding the database dependent information gives me this error:
    Oracle XSQL Custom Page Processor 9.0.3.0.0 (Production)
    XSQL-017: Unexpected Error Occurred
    java.lang.NullPointerException
        at oracle.xml.xsql.XSQLPageRequestImpl.getXSQLConnectionManager(XSQLPageRequestImpl.java:477)
        at oracle.xml.xsql.XSQLPageRequestImpl.setConnectionName(XSQLPageRequestImpl.java:281)
        at oracle.xml.xsql.XSQLPageProcessor.processToXML(XSQLPageProcessor.java:426)
        at oracle.xml.xsql.XSQLRequest.processToXML(XSQLRequest.java:423)
        at oracle.xml.xsql.XSQLRequest.processToXML(XSQLRequest.java:369)
        at edu.mtu.uportal.channels.dbTest.dbTest.renderXML(dbTest.java:98)
        at org.jasig.portal.ChannelRenderer$Worker.run(ChannelRenderer.java:523)
        at org.jasig.portal.utils.threading.Worker.run(Worker.java:88)
    The same XSQL I am creating in the servlet executes fine via the command line interface using the exact same XSQLConfig.xml file. The XSQLConfig.xml file is obviously being used since the param action handler works correctly. Any ideas on what I'm doing wrong would be much appreciated.
    One last note, my baseURL for creating the XSQLRequest is null but passing a valid URL changes nothing.
    -Eric Dalquist

    Get a XSQLRequest object with the constructor with XSQLConnectionManagerFactory as a parameter.
    XSQLDatasourceConnectionManager datasourceConnMgr=new XSQLDatasourceConnectionManager();
    XSQLConnectionManagerFactory connMgrFactory=(XSQLConnectionManagerFactory)datasourceConnMgr;
    XSQLRequest req=new XSQLRequest(connMgrFactory, xDoc, null);

  • Problem with XSQLRequest.process

    Problem with XSQLRequest.process:
    I'm trying to run XSQL files using XSQLRequest.process. I'm working on the chapter 3 examples in Muench's book and got FAQXML.xsql running okay but have had problems with: FAQhtml.xsql BTW I am calling them from a different directory and am using 9iAS under win2K SP3.:
    I've fixed errors such as:
    End tag does not match start tag 'img'.
    by adding </img>
    and:
    End tag does not match start tag 'META'.
    by removing the <head> section from the xsl.
    But now i've got:
    XML parse error at line 2, char 1
    Expected 'EOF'.
    and don't have a clue.
    Some questions I have are:
    --Why don't I get these errors when I run the same files from Internet Explorer?
    --Where is the intermediate XML file?
    --How will I get HTML output?
    I'd appreciate any help you could suggest.
    Peter.
    Here is the .xsql and some of the .xsl:
    <?xml version="1.0"?>
    <!-- FAQHTML.xsql: Show FAQ.xsql in HTML Format for browsers -->
    <?xml-stylesheet type="text/xsl" href="http://localhost/ch03/FAQ-In-HTML.xsl"?>
    <xsql:include-xsql href="FAQ.xsql" xmlns:xsql="urn:oracle-xsql"/>
    <!-- FAQ-In-HTML.xsl: Transform ROWSET/ROW format into HTML Format -->
    <html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    -->
    <body>
    <center>
    <table border="0">
    <tr>
    <th>Question</th>
    <th>Difficulty</th>
    </tr>
    <xsl:for-each select="ROWSET/ROW">
    <tr>
    <td>
    <table border="0" cellspacing="0">
    etc...

    XSQL version is 1.0.2.0.
    Well, in answer to your import question, yes. Xerces can import Xerces documents properly. Thus if we use Xerces importNode on a document parsed/created using Xerces' DOM implementation, the attribute values stay.
    We are using Xerces because it is the foundation of our infrastructure layer (which is partly because it's used in Catalina).
    Question. Is it possible that XSQLParserHelper which, as you say, uses an instance of oracle.xml.parser.v2.DOMParser to parse the document, is having trouble with different versions of DOM? I ask because we've noticed that to use Catalina and have its class loader to function successfully, we had strip all the DOM classes from xmlparserv2.jar
    importNode snippit ...
    public void service(CioServletRequest req, CioServletResponse resp) throws ServletException {
    DomResponse respm = resp.createDomResponse();
    Document dbdoc = respm.getDocument();
    XSQLRequest req = new XSQLRequest( pageUrl );
    ByteArrayOutputStream ostream = new ByteArrayOutputStream();
    req.process(params, ostream, new PrintWriter(System.err));
    String s = new String(ostream.toByteArray());
    Document retDoc = respm.parseDocument(s);
    dbdoc.appendChild(dbdoc.importNode(retDoc.getDocumentElement(), true));
    Hope this helps.
    Steve.
    null

  • Documentation for XSQLRequest class

    Where can I find documentation for the XSQLRequest java class?
    I have code that attempts to process an XSQL page as follows:
    XSQLRequest xsqlReq = new XSQLRequest(pageURL);
    xsqlReq.process(params,pwOutput,pwError);
    I'm getting the "out of memory" error that has been reported by others - looks like I'll have to figure out how to use SAX instead of DOM, but I first want to understanding what's going on with the existing code.

    Steve,
    Thanks for the info. The problem is the amount of data that is retreived. I can make it work by reducing the amount of data retrieved, but as I increase the amount of data, it eventually fails.
    Is there any straight forward solution? It's so easy and convenient using the XSQL page processor via XSQLRequest - I'd hate to have to abandon it.
    Thanks,
    Matt
    PS - Great book!!!

  • Result of processToXML and process differs

    I have a problem in using XSQLRequest :
    the results given by process and processToXML are differents
    I'd like to use processToXML but in the following example i can't get the right result with it. The problem occurre when using disable-output-escaping in the xsl file
    My aim is to query something in my database which return a VARCHAR content XML text
    My xsql file is :
    // File test.xsql
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="test.xsl"?>
    <page connection="demo" xmlns:xsql="urn:oracle-xsql">
    <MyQuery>
    <xsql:query >
    <![CDATA[
    select '<TEST> toto </TEST>' AS toto from dual
    ]]>
    </xsql:query>
    </MyQuery>
    </page>
    For that i use this xsl file
    // File test.xsl
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="@*|node()">
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="MyQuery">
    <MyQuery>
    <xsl:value-of select="." disable-output-escaping="yes"/>
    </MyQuery>
    </xsl:template>
    </xsl:stylesheet>
    The expected result is :
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <page xmlns:xsql="urn:oracle-xsql">
    <MyQuery>
    <TEST> toto </TEST>
    </MyQuery>
    </page>
    I obtained the expected result in using the process methode of XSQLRequest
    but with the processToXML i couldn't obtain it, instead i obtained
    <page xmlns:xsql="urn:oracle-xsql">
    <MyQuery>
    &#60;TEST> toto &#60;/TEST>
    </MyQuery>
    </page>
    Pleas help
    Thank you
    My java test file
    import oracle.xml.xsql.XSQLRequest;
    import java.util.Hashtable;
    import java.util.StringTokenizer;
    import java.io.PrintWriter;
    import java.net.URL;
    import java.io.*;
    import oracle.xml.parser.v2.*;
    public class XSQLtest {
    private final static void usage()
    System.out.println("Usage: \n\t" +
    "XSQLtest xsqlFile");
    System.exit(1);
    public static void main( String[] args) throws Exception {
    if (args.length < 1) usage();
    File myFile = new File(args[0]);
    // Construct a new XSQL Page request
    XSQLRequest req = new XSQLRequest(myFile.toURL());
    // Setup a Hashtable of named parameters to pass to the request
    Hashtable params = new Hashtable();
    // TEST with process
    System.out.println("TEST with process");
    req.process(params,new PrintWriter(System.out), new PrintWriter(System.err));
    System.out.println("\n\n");
    // TEST with processToXML
    System.out.println("TEST with processToXML");
    XMLDocument xmlDoc =
    (XMLDocument)req.processToXML(params,new PrintWriter(System.err));
    xmlDoc.print(new PrintWriter(System.out));
    Result :
    TEST with process
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <page xmlns:xsql="urn:oracle-xsql">
    <MyQuery>
    <TEST> toto </TEST>
    </MyQuery>
    </page>
    TEST with processToXML
    <page xmlns:xsql="urn:oracle-xsql">
    <MyQuery>
    &#60;TEST> toto &#60;/TEST>
    </MyQuery>
    </page>
    null

    These two are supposed to differ for this case. When you call processToXML, this avoids the step of serializing the transformed result and instead just returns the transformed, in-memory DOM tree. Since <xsl:output> hints and disable-output-escapin are only relevant when the XSL Processor gets a chance to serialize the output, you have to use process() if you want either of these two to take effect.

  • Does XSQLRequest require an actual file or can it handle a CLOB?

    Does the XSQL page have to be a file with an XSQL extension? Is there any way to send it the URL of a CLOB in the database?
    I'd like to call XSQLRequest and send it the URL of a CLOB in the database instead of the URL of a file. I have used Steve Muench's example of defining a new URL protocol that represents a CLOB but when I call method processToXML I'm getting errors. This all works great when I send a file with a xsql extension.
    Thanks very much!

    This is a repost of an e-mail sent to Steve on 2/2. Just wanted to know if anyone found out anything since February.
    ***IMPORTANT*** In playing around with the XSQLRequest that takes the DOM vs. the XSQLRequest that takes a URL, I discovered that if I call
    XSQLPagey.FindAndProcessXSQLPage(sUrl);
    and then subsequently call
    XSQLPagey2.FindAndProcessXSQLPageAsDOM(((XMLDocument)parsedDoc), null);
    ***everything works fine!*** and the result of the second call goes into the database. If I comment out the call to FindAndProcessXSQLPage, however, I will get the null pointer error when FindAndProcessXSQLPageAsDOM calls processToXML. This is why the program below has both calls in it.
    Thanks!
    Dale Johnson
    ******************************MAIN********************************
    import XSQLRequestSample;
    import ReadCLOB;
    import WriteCLOB;
    import XMLDocuments;
    import java.io.*;
    import org.w3c.dom.Document;
    import oracle.xml.parser.v2.*;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import java.sql.Connection;
    import oracle.sql.*;
    import java.net.URL;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.InputSource;
    public class MainClass extends Object {
    public static void main( String[] args) throws Exception {
    Document Doc;
    Document Doc2;
    Connection conn = GetConnected.getConnection("blah", "blah", "@bah", "blah");
    XSQLRequestSample XSQLPagey;
    XSQLRequestSample XSQLPagey2;
    XMLDocuments.enableXMLDocURLs();
    String sUrl = new String("file:///G:/helloworld.jomama");
    DOMParser dp = new DOMParser();
    try {
    dp.parse(sUrl);
    catch (SAXParseException spe) {
    System.out.println(spe.getMessage());
    Document parsedDoc = dp.getDocument();
    Doc = XSQLPagey.FindAndProcessXSQLPage(sUrl);
    ((XMLDocument)Doc).print(System.out);
    Doc2 = XSQLPagey2.FindAndProcessXSQLPageAsDOM(((XMLDocument)parsedDoc), null);
    if (Doc2 != null) {
    ((XMLDocument)Doc2).print(System.out);
    CLOB theBigClob = ReadCLOB.getCLOBfromColumn(conn,
    "DALE_XML_TEST", "DALE_XML", "ID", "/111");
    WriteCLOB.fromXMLDocument(((XMLDocument)Doc2), theBigClob);
    conn.close();
    ***************************** My version of XSQLRequestSample *********************************
    import oracle.xml.xsql.*;
    import java.util.Hashtable;
    import java.io.*;
    import java.lang.string.*;
    import java.net.URL;
    import org.w3c.dom.Document;
    import oracle.xml.parser.v2.*;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.InputSource;
    public class XSQLRequestSample {
    public static Document FindAndProcessXSQLPage(String sUrl ) throws Exception {
    Document Doc;
    // Construct the URL of the XSQL Page
    // Construct a new XSQL Page request
    XSQLRequest req = new XSQLRequest(sUrl);
    // Setup a Hashtable of named parameters to pass to the request
    Hashtable params = new Hashtable(3);
    // Process the page, passing the parameters and writing the output
    // to standard out.
    return req.processToXML(params,new PrintWriter(System.err));
    public static Document FindAndProcessXSQLPageAsDOM(XMLDocument theDoc,
    URL url )
    throws Exception {
    XSQLRequest req = new XSQLRequest(theDoc, url);
    // Setup a Hashtable of named parameters to pass to the request
    Hashtable params = new Hashtable(3);
    // Process the page, passing the parameters and writing the output
    // to standard out.
    return req.processToXML(params,new PrintWriter(System.err));
    }

  • XSQLRequest to PDF Example ?

    I was wondering if anyone has any recommendations or sample code
    that demonstrates how to utilize the XSQLRequest object and
    methods to output the XSQL result to PDF with the associated FOP
    java code?
    The following code successfully returns the transformed XSQL
    page to the screen.
    //Working Output XSQL -> FO, returned to Screen
    XSQLRequest r = new XSQLRequest("file:///c:/java/w.xsql");
    r.process(new PrintWriter(System.out),
    new PrintWriter(System.err));
    Do I need to use the processToXML method and then serialize that
    document with the FO code? Or do I need implement the
    XSQLPageRequest interface instead?
    Any help would be appreciated.
    Brian

    I was able to work through my questions and thought I would
    share my code. Hope this helps someone in the future.
    Brian
    Hashtable params = new Hashtable(1);
    params.put("ID", ""+Id);
    XSQLRequest request = new XSQLRequest
    ("file:///c:/java/table.xsql");
    XMLDocument XMLdoc = (XMLDocument)request.processToXML(params);
    // Print output of FO Document
    // XMLdoc.print(new PrintWriter(System.out));
    try {
    String fileName = "c:/java/W"+Id+".pdf";
    File writefile = new File(fileName);
    writefile.createNewFile();
    Driver driver = new Driver();
    driver.setRenderer(Driver.RENDER_PDF);
    driver.setErrorDump(true);
    driver.setupDefaultMappings();
    driver.setOutputStream(new FileOutputStream(writefile));
    driver.render(XMLdoc);
    } catch (Exception ex) {ex.printStackTrace();}

  • XSQLRequest problem.

    Hi,
    I'm having some problems with the XSQLRequest.process() method and would appreciate any help.
    I have an .xsql file that excepts a parameter called moltid and returns the needed xml. When I call this page from a regular html form I get the correct xml document back.
    The problem comes when I try to request this document in a java serlvet. I create the request and a Hashtable containing the moltid parameter to pass to the page, make the request to process and get back an xml document that appears as if the parameter was not passed to it. The following is a section of my code:
    // get the moltid
    moltid = request.getParameter("moltid");
    // Construct the URL of the XSQL Page
    URL pageUrl = new URL("http://129.43.26.68/xml/mt_xml.xsql");
    // Construct a new XSQL Page request
    XSQLRequest xsqlRequest = new XSQLRequest(pageUrl);
    // create a hashtable to hold the moltid parameter
    Hashtable xsqlParams = new Hashtable(1);
    xsqlParams.put("moltid", moltid);
    // make the request passing the parameter to the page
    xsqlRequest.process(xsqlParams, out, out);
    After making this request this is the document I get back:
    <?xml version="1.0" ?>
    - <target>
    <moltid />
    <cell-line-data />
    </target>
    Needless to say there should be data associated with <moltid> and <cell-line-data>. It seems as if the moltid parameter in the Hashtable is not getting passed to the .xsql page.
    Can anybody help?
    Thanks,
    Chris.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected]:
    What role is your additional servlet playing in this picture? Wouldn't you get the result your looking for by letting the XSQL Servlet handle the request directly?
    What platform and exact JVM are you using?<HR></BLOCKQUOTE>
    Platform is win2000. JVM is the jdk1.2.2 from Sun.
    In trying to get this to work I've discovered that it really does seem to be something with passing the Hashtable containing the parameters. I got it to work if I create the URL to include the parameter such as in the following code:
    // Construct the URL of the XSQL Page
    URL pageUrl = new URL("http://129.43.26.68/xml/mt_xml.xsql?moltid=" + moltid);
    // Construct a new XSQL Page request
    XSQLRequest xsqlRequest = new XSQLRequest(pageUrl);
    // make the request passing the parameter to the page
    xsqlRequest.process();
    It's when I try to use the Hashtable to pass the parameters as in my previous post that it doesn't seem to work.
    I'm not quite certain I understand your question about the role of my servlet. My servlet asks for an XML doc thru the url and then will parse the data in the XML to manipulate it the way I need it displayed. The XSQL Servlet just passes the data back, correct? I'm sure I could do other things using XSL, etc., but I wanted to try certain things where I take the data from the XML and build various objects to use and display the data.
    Again any help would be appreciated at understanding why I can't seem to use the Hashtable way.
    Thanks,
    Chris.
    null

Maybe you are looking for

  • Performance Issue in select statements

    In the following statements, it is taking too much time for execution,Is there any best way to change these selection statements...int_report_data is my final internal table.... select fsplant fvplant frplant fl1_sto pl1_delivery pl1_gr pl2_sto      

  • Creation of PO with account assignment:Q

    Hi, During creation of purchase order with account assignment category: Q, consumption GL account is getting triggered instead of Project Stock GL Account. What could be the reason for this? Regards, Srinivas.

  • ITunes screensaver

    I set my itunes screensaver setting to 0 sec...since then, I can't change it. Everytime I try, it quit by itself. Is there a way to reinstall it instead of reinstall my OS? Thanx

  • Firefox crashes almost daily!

    I've been a BIG fan of Firefox for many years. I really want my Firefox to work! I'm extremely frustrated over this so I'll apologize now if I offend anyone. For the last year or so, I've had so MANY problems that I'm frustrated enough to quit using

  • Configuring Crystal Reports Server to use https

    Post Author: singhal CA Forum: General Hello, I have  crystal reports server.  But everytime I run a report with htmlviewerbridge, it connects to http://hostname:8080 is there anyway of changing the settings so that it connects to https://hostname:80