XDK, XSLT Processor, Add JARs statically

Hello,
while using XDK's Oracle XSLT Extensions I'm facing an issue with class visibility after adding it via "loadjava" tool.
I'm getting the following exception during transformation:
     oracle.xml.xpath.XPathException: Extension function error: Class not found ...
     oracle.xml.xslt.XSLStylesheet.flushErrors(XSLStylesheet.java:2495)
The docs say the following: (Using the XSLT Processor for Java)
"Note: The XSL class loader only knows about statically added JARs and paths in the CLASSPATH and those specified by wrapper.classpath. Files added dynamically are not visible to XSLT processor."
So it's rather clear that loadjava adds classes dynamically. That explains the error message.
The question however is: how to add classes statically?
Thanks a lot in advance for you help!

Trying some stuff at home now until we can call each other.
Java version is a bit old, isn't it...?
On my DB version at home (12.1.0.1), server side, it mentions:
[oracle@localhost ~]$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.11) (rhel-1.61.1.11.11.el6_4-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
Will try to figure out what the local XDK stuff says.
My $CLASSPATH is not set. The Oracle Java JDK version mentions:
[oracle@localhost bin]$ $ORACLE_HOME/jdk/bin/java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
After setting the environment on server database side, I get...
[oracle@localhost oracle.xdk_11.1.0]$ oraxsl -v
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/xml/parser/v2/oraxsl
Caused by: java.lang.ClassNotFoundException: oracle.xml.parser.v2.oraxsl
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: oracle.xml.parser.v2.oraxsl. Program will exit.
[oracle@localhost oracle.xdk_11.1.0]$ echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin:/u01/app/oracle/product/12.1.0/dbhome_1/bin
[oracle@localhost oracle.xdk_11.1.0]$ echo $LD_LIBRARY_PATH
/u01/app/oracle/product/12.1.0/dbhome_1/lib
[oracle@localhost oracle.xdk_11.1.0]$ echo $JAVA_HOME
/u01/app/oracle/product/12.1.0/dbhome_1/jdk/bin
[oracle@localhost oracle.xdk_11.1.0]$ echo $ORACLE_HOME
/u01/app/oracle/product/12.1.0/dbhome_1
[oracle@localhost oracle.xdk_11.1.0]$ echo $CLASSPATH
/u01/app/oracle/product/12.1.0/dbhome_1/lib/xmlparserv2.jar:/u01/app/oracle/product/12.1.0/dbhome_1/lib/xsu12.jar:/u01/app/oracle/product/12.1.0/dbhome_1/lib/xml.jar
[oracle@localhost oracle.xdk_11.1.0]$ oraxsl -v
Release version: Oracle XML Developers Kit 12.1.0.1.0 - Production
oraxsl: Number of arguments specified (1) is illegal
usage: oraxsl options* source? stylesheet? result?
            -w                          Show warnings
            -e <error log>              A file to write errors to
            -l <xml file list>          List of files to transform
            -d <directory>              Directory with files to transform
            -x <source extension>       Extensions to exclude
            -i <source extension>       Extensions to include
            -s <stylesheet>             Stylesheet to use
            -r <result extension>       Extension to use for results
            -o <result directory>       Directory to place results
            -p <param list>             List of Params
            -t <# of threads>           Number of threads to use
            -v                          Verbose mode
            -debug                      Debug mode
            -m <version #>              XSLT Version, 1 or 2
Please refer to the readme file for more information on the above options
[oracle@localhost oracle.xdk_11.1.0]$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.11) (rhel-1.61.1.11.11.el6_4-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
[oracle@localhost oracle.xdk_11.1.0]$ export PATH=$ORACLE_HOME/jdk/bin:$PATH
[oracle@localhost oracle.xdk_11.1.0]$ java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)

Similar Messages

  • XDK XSLT processor alternative

    Hi,
    I use XSL transformation built in XDK, but there is a bug admitted by Oracle. They try to fix it but it takes too long.
    My question is... Is there any alternative to XDK XSL processor? Something what can be called in PLSQL. ... Java, C++, whatever ?
    Thanks.

    Hi,
    I use XSL transformation built in XDK, but there is a bug admitted by Oracle. They try to fix it but it takes too long.
    My question is... Is there any alternative to XDK XSL processor? Something what can be called in PLSQL. ... Java, C++, whatever ?
    Thanks.

  • How can I make my XSLT processor accept html code ?

    In my applications the Oracle xslt processor wont accept simple HTML tags within an XML source while transforming the source into HTML. Both processors either will throw parser exceptions or ignore the HTML code in the XML source completely, though output-escaping is explicitly enabled.
    In detail, I want to transform an XML source like this...
    <element>
    Hello, this is a <b>XML</b> text source mingled with html<sup>TM</sup>
    </element>
    ... with an XSL Stylesheet like this...
    <xsl:stylesheet>
    <xsl:output method=html cdata-sections=element/>
    <xsl:template match=element>
    <html>
    <body>
    <xsl:value-of select=. output-escaping=yes/>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    ... which should result in a HTML code like this ...
    <html>
    <body>
    Hello, this is a <b>XML</b> text source mingled with html<sup>TM</sup>
    </body>
    </html>
    The result, however, is always like this:
    <html>
    <body>
    Hello, this is a XML text source mingled with htmlTM
    </body>
    </html>
    This means that the additional HTML tags inside the XML source have been completely ignored by the XSLT processor though I enabled the output-escaping.
    If anybody should think now that mingling HTML with XML text is stupid because I could also format the result with the XSL Stylesheet itself, he might be right, of course, but: I cant avoid this because in my application the XML source results from a users web form entry. The user working with the form must be able to decide whether he wants to include HTML in his text or not. In any case, any HTML code he enters should just be transported WITHOUT ANY CHANGES to the resulting HTML page, not omitted without comments! It seems quite simple to me, but the XSLT processor doesnt want to agree with me in this point :-(
    So, once again in brief: Is there any possibility to tell my XSLT processor not to parse, transform or manipulate HTML tags, but to transport them unchanged to the output ?
    After weeks of research any helping sign would be a great relief...
    Many thanks in advance.

    I don't understand the answer, can you please expand. I am trying to do a similar thing by creating an output buffer,
    assemble a mix of text and html tags and then output this buffer later. All of the html tags are skipped or re-escaped in the final html:
    In this example I want to print the IPRCROP, then add an html break (<br>).
    Example 1. Use xsl:text with escape = yes
    <xsl:variable name="buffy">
    <xsl:for-each select="documents/document">
    <xsl:value-of select="IPRCROP"/>
    <xsl:text disable-output-escaping="yes">&lt;br&gt;&lt;/br&gt;</xsl:text>
    </xsl:for-each>
    </xsl:variable>
    <xsl:value-of select="$buffy"/>
    In this case the <br> and </br> end up re-escaped in the output html as #60 etc. so they appear literally as
    ALFALFA <br> BARLEY <br>
    and in source as: ALFALFA&#60; br &gt; &#60; /br &gt;BARLEY
    Example 2, try as pure text, it just skips the <br></br> altogether
    <xsl:variable name="buffy">
    <xsl:for-each select="documents/document">
    <xsl:value-of select="IPRCROP"/>
    <xsl:text><br></br></xsl:text>
    </xsl:for-each>
    </xsl:variable>
    <xsl:value-of select="$buffy"/>
    output = ALFALFABARLEY

  • Using the XSLT processor for non-workbench XSLT

    Hi there,
    is it possible to use the built-in XSLT processor for arbitrary XSLT transformations which aren't checked in in the ABAP workbench but instead given as a runtime object (string or iXML)?
    Instead of the built-in command CALL TRANSFORMATION which according to the doc is restricted to workbench transformations, I am looking for an option like this:
    data: lo_transformation type ref to if_ixml_document,
          lo_source         type ref to if_ixml_document,
          lo_target         type ref to if_ixml_focument.
    * I get lo_transformation and lo_source from somewhere out there
    try.
        lo_target ?= cl_some_fine_class_which_i_am_looking_for=>transform(
                          io_source         = lo_source
                          io_transformation = lo_transformation ).
      catch cx_xslt_runtime_error.
    endtry.
    Does anybody know such a feature?
    For a background about this problem - in German language - see my blog
    http://ruediger-plantiko.blogspot.com/2007/08/xslt-in-bsp-anwendungen-und-in-abap.html
    Thanks and Regards,
    Rüdiger

    Dear Rashid,
    thanks - this is the answer! I wonder why I didn't find this class one year ago. A little test prog shows that it works fine and even performant (about 0.5 millisec for creating the new dynamic XSLT program with the method set_source_stream( ) ). For usage in web apps, it would be nice to know whether the temporary program remains available in the application servers' buffer after end of process. I can't check this, since this is performed on the C/C++ level, and SE30 doesn't track the method set_source_stream() itself (it could show a decrease of runtime after the first call).
    Here comes a little self-contained ABAP program to test the functionality. It works well on our system with SAPKB70012.
    Thanks and regards,
    Rüdiger
    * --- Test usage of a dynamically given non-workbench XSLT program
    report  zz_test_cl_xslt_processor.
    data:
    * iXML master
      go_xml type ref to if_ixml,
    * iXML stream factory
      go_sf  type ref to if_ixml_stream_factory.
    load-of-program.
      go_xml = cl_ixml=>create( ).
      go_sf  = go_xml->create_stream_factory( ).
    start-of-selection.
      perform start.
    * --- Start
    form start.
      data: lo_source    type ref to if_ixml_document,
            lo_result    type ref to if_ixml_document,
            lo_processor type ref to cl_xslt_processor,
            lv_p         type progname,
            lo_ex        type ref to cx_xslt_exception.
      perform get_source changing lo_source.
      create object lo_processor.
      try.
    * Set source
          lo_processor->set_source_node( lo_source ).
    * Set result
          lo_result = go_xml->create_document( ).
          lo_processor->set_result_document( lo_result ).
    * This could be time-critical, the creation of a dynamical XSLT prog?
          perform set_transformation using lo_processor
                                     changing lv_p.
    * call xslt-proc
          lo_processor->run( lv_p ).
    * Display result
          call function 'SDIXML_DOM_TO_SCREEN'
            exporting
              document    = lo_result
              title       = 'Result of Transformation'
            exceptions
              no_document = 1
              others      = 2.
        catch cx_xslt_exception into lo_ex.
          sy-msgli = lo_ex->get_text( ).
          message sy-msgli type 'I'.
      endtry.
    endform.                    "start
    * --- Set XSLT transformation from stream
    form set_transformation using io_processor type ref to cl_xslt_processor
                            changing cv_p type progname.
      data: lo_trans     type ref to if_ixml_istream.
    * sv_p contains temp. name of XSLT program after first call
      statics: sv_p   type string.
      if sv_p is initial.
    * It seems that the name can be buffered on appserver level?
        import progname to sv_p
               from shared buffer indx(zx) id 'ZZ_TEST_XSLT_PROC'.
        if sv_p is initial.
          sv_p = 'X'.
        endif.
      endif.
    * Provide the stream containing the XSLT document (as a stream)
      perform get_transformation changing lo_trans.
    * Set transformation
      io_processor->set_source_stream( exporting stream = lo_trans
                                       changing  p      = sv_p ).
    * Buffer progname on server - seems to work
      export progname from sv_p
             to shared buffer indx(zx) id 'ZZ_TEST_XSLT_PROC'.
    * string -> c move necessary, since xslt-proc-interface doesn't use
    * the generic type csequence for program name
      cv_p = sv_p.
    endform.                    "set_transformation
    * --- Parse a source given as string into an if_ixml_document
    form get_source changing co_src type ref to if_ixml_document.
      data: lv_s      type string,
            lo_stream type ref to if_ixml_istream,
            lo_parser type ref to if_ixml_parser.
      concatenate
    `<?xml version="1.0" encoding="iso-8859-1"?>`
    `<countings filiale="2412" invnu="TIEFKUEHL SEPT.07">`
    `<count recNum="1" gid="1" ean="59111828843" menge="1"`
    `preis="0" recNumFrom="1"></count>`
    `</countings>`
    into lv_s.
    * Eingabestream erzeugen und in if_ixml_document abbilden
      lo_stream   = go_sf->create_istream_string( lv_s ).
      co_src      = go_xml->create_document( ).
      lo_parser   = go_xml->create_parser( document       = co_src
                                           istream        = lo_stream
                                           stream_factory = go_sf ).
      lo_parser->parse( ).
    endform.                    "get_source
    * --- Put the transformation given as string into an if_ixml_istrean
    form get_transformation changing co_trans type ref to if_ixml_istream.
      data: lv_s   type string.
      concatenate
      `<?xml version="1.0" encoding="iso-8859-1"?>`
      `<xsl:transform version="1.0"`
      ` xmlns:xsl="http://www.w3.org/1999/XSL/Transform"`
      ` xmlns:asx="http://www.sap.com/abapxml">`
      `<xsl:strip-space elements="*"></xsl:strip-space>`
      `<xsl:template match="countings">`
      ` <asx:abap>`
      `   <asx:values>`
      `     <SELOPT>`
      `       <WERKS><xsl:value-of select="@filiale"></xsl:value-of></WERKS>`
      `       <INVNU><xsl:value-of select="@invnu"></xsl:value-of></INVNU>`
      `     </SELOPT>`
      `     <COUNTINGS>`
      `       <xsl:for-each select="count">`
      `         <ZSRS_ZWSTI_LINE>`
      `           <MATNR></MATNR>`
      `           <EAN11><xsl:value-of select="@ean"></xsl:value-of></EAN11>`
      `           <MAKTX></MAKTX>`
      `           <MENGE><xsl:value-of select="@menge"></xsl:value-of></MENGE>`
      `           <MEINH></MEINH>`
      `           <UNAME></UNAME>`
      `           <EXVKW></EXVKW>`
      `           <WAERS></WAERS>`
      `           <FF></FF>`
      `           <GID><xsl:value-of select="@gid"></xsl:value-of></GID>`
      `           <RECNUM><xsl:value-of select="@recNum"></xsl:value-of></RECNUM>`
      `           <RECNUM_FROM><xsl:value-of select="@recNumFrom"></xsl:value-of></RECNUM_FROM>`
      `           <REF_RECNUM><xsl:value-of select="@refRecNum"></xsl:value-of></REF_RECNUM>`
      `         </ZSRS_ZWSTI_LINE>`
      `       </xsl:for-each>`
      `     </COUNTINGS>`
      `   </asx:values>`
      ` </asx:abap>`
      `</xsl:template>`
      `</xsl:transform>`
      into lv_s.
      co_trans = go_sf->create_istream_string( lv_s ).
    endform.                    "get_transformation
    Edited by: Rüdiger Plantiko on Jul 4, 2008 10:25 AM

  • Running NetWeaver's XSLT processor from Oxygen

    Hello
    I am using Oxgen XML Editor (version 12.1, build 2011012011) to create my XSLT mappings. Having tested these mappings successfully offline they are imported onto our SAP-PI ( SAP NetWeaver 7.01 ). However, sometimes mappings that work in Oxygen fail on SAP-PI. Therefore, I would like to use NetWeaver's XSLT processor as Custom Engine within Oxgen.
    Triggered by the blog of Thorsten Nordholm Søbirk
    Running NetWeaver's XSLT processor from XMLSpy
    I copied the archive sapxmltoolkit.jar into the lib directory of the Oxygen installation path. Next I went to menu Options -> Preferences -> XML -> XSLT/FO/XQuery -> Custom Engines and defined the following settings:
    Working Directory = .
    Command Line = C:Program FilesJavajdk1.6.0_07 injava -cp
    "C:Program FilesOxygen XML Editor 12libsapxmltoolkit.jar";
    com.sap.engine.lib.xsl.Process
    -xml="C:     empz_tempinput.xml"
    -xsl="C:     empz_tempstylesheet.xsl"
    -out="C:     empz_tempoutput.xml"
    In addition, within the Transformation Options I set:
    javax.xml.transform.TransformerFactory=com.sap.engine.lib.jaxp.TransformerFactoryImpl
    For the sake of simplicity I used a plain stylesheet without any Java extensions. When I delete file "output.xml" in "C:     empz_temp" and execute the transformation the file is recreated. Thus, I am sure that the NetWeaver XSLT processor has been used.
    However, instead of hard-coding filenames and pathes I would like to use the built-in variables of Oxygen like "$" etc. Most of the XSLT mappings use a Java extension which is located in the same directory as sapxmltoolkit.jar (C:Program FilesOxygen XML Editor 12lib).
    There are 2 major problems that I am facing now:
    (1) How must the Command Line look like so that I can use Oxygen's built-in variables as input for -xml, -xsl and -out?
    (2) How must the Command Line look like so that the Java extension archive is recognized?
    Your help and valuable input is very much appreciated.
    Regards
      Uwe

    hi,
    this is how we use it with Stylus Studio, also with external libraries
    c:\program files\java\jre1.5.0_22\bin\java.exe -cp "Y:\xivaluemappingproxy_stylusstudio.jar";"c:\sapxmltoolkit.jar";"Y:\XIFramework.jar";"Y:\jms.jar";"Y:\sapjco.jar";"c:\ExtendedValueChange.jar" com.sap.engine.lib.xsl.Process -xsl=%2 -xml=%1 -out=%3

  • Uri-escaping in XSLT-Processor when using html-method in xsl:output

    I've a problem with the XSLT-Processor:
    He tries to escape non-ASCII Characters in the href-Attribute when I use the output method "html". This is correct according to XSLT 1.0 and HTML4, but the processor doesn't really escape the characters, he just gives me a %3F ('?'-character) instead of %HH (where HH corresponds to the hex value of the char).
    I searched the forums and found a thread with the same problem, but there was no solution to this issue. The thread was started in 2002 so maybe someone came up with a solution.

    Add the non-ascii character to <xsl:text disable-output-escaping="yes"></xsl:text>

  • Update XSLT engine, add metadata to images.

    Hello,
    It'd be super fantastic if the XSLT engine could be updated and support XSLT 2.0. Also have the option to format and indent on export.
    I don't think I can add metadata to images within InDesign. That be another plus.
    Regards,
    Eric

    It shouldn't be too hard (I guess ...) to make the XSLT processor a user-definable choice. That way I could use my trusty Saxon 8.0, wiv' extensions, smack right inside ID.

  • How to Specify a Default Stylesheet to the XSLT processor

    How can you specify that a default stylesheet is been used to the XSLT processor?
    Thanks
    Harsha

    Specify the XSLT in the <XDK>/bin/oraxsl batch file.

  • XDK XSLT proccessor alternative

    Hi,
    I'm using XSL transformation build in XDK, but there is a bug admitted by Oracle. They try to fix it but it takes too long.
    My question is... Is there any alternative to XDK XSL processor? Something what can be called in PLSQL. ... Java, C++, whatever ?
    Thanks.

    From the XMLDB 11g Developers Manual:
    XMLType instance can be transformed in the following ways:
    - Using SQL function XMLtransform (or XMLType method transform()) in the database.
    - Using XDK transformation options in the middle tier, such as XSLT Processor for Java.
    XMLTRANSFORM and XMLType.transform():
    Examples
    The examples in this section illustrate how to use SQL function XMLtransform and XMLType method transform() to transform XML data stored as XMLType to various formats.
    Example 10-1 Registering XML Schema and Inserting XML Data
    This example sets up the XML schema and tables needed to run other examples in this chapter. (The call to deleteSchema here ensures that there is no existing XML schema before creating one. If no such schema exists, then deleteSchema produces an error.)
    BEGIN
      -- Delete the schema, if it already exists; otherwise, this produces an error.
      DBMS_XMLSCHEMA.deleteSchema('http://www.example.com/schemas/ipo.xsd',4);
    END;
    BEGIN
    -- Register the schema
    DBMS_XMLSCHEMA.registerSchema('http://www.example.com/schemas/ipo.xsd',
    '<schema targetNamespace="http://www.example.com/IPO"
             xmlns="http://www.w3.org/2001/XMLSchema"
             xmlns:ipo="http://www.example.com/IPO">
      <!-- annotation>
       <documentation xml:lang="en">
        International Purchase order schema for Example.com
        Copyright 2000 Example.com. All rights reserved.
       </documentation>
      </annotation -->
      <element name="purchaseOrder" type="ipo:PurchaseOrderType"/>
      <element name="comment" type="string"/>
      <complexType name="PurchaseOrderType">
       <sequence>
        <element name="shipTo"     type="ipo:Address"/>
        <element name="billTo"     type="ipo:Address"/>
        <element ref="ipo:comment" minOccurs="0"/>
        <element name="items"      type="ipo:Items"/>
       </sequence>
       <attribute name="orderDate" type="date"/>
      </complexType>
      <complexType name="Items">
       <sequence>
        <element name="item" minOccurs="0" maxOccurs="unbounded">
         <complexType>
          <sequence>
           <element name="productName" type="string"/>
           <element name="quantity">
            <simpleType>
             <restriction base="positiveInteger">
              <maxExclusive value="100"/>
             </restriction>
            </simpleType>
           </element>
           <element name="USPrice"    type="decimal"/>
           <element ref="ipo:comment" minOccurs="0"/>
           <element name="shipDate"   type="date" minOccurs="0"/>
          </sequence>
          <attribute name="partNum" type="ipo:SKU" use="required"/>
         </complexType>
        </element>
       </sequence>
      </complexType>
      <complexType name="Address">
       <sequence>
        <element name="name"    type="string"/>
        <element name="street"  type="string"/>
        <element name="city"    type="string"/>
        <element name="state"   type="string"/>
        <element name="country" type="string"/>
        <element name="zip"     type="string"/>
       </sequence>
      </complexType>
      <simpleType name="SKU">
       <restriction base="string">
        <pattern value="[0-9]{3}-[A-Z]{2}"/>
       </restriction>
      </simpleType>
    </schema>',
       TRUE, TRUE, FALSE);
    END;
    -- Create table to hold XML instance documents
    DROP TABLE po_tab;
    CREATE TABLE po_tab (id NUMBER, xmlcol XMLType)
    XMLType COLUMN xmlcol
    XMLSCHEMA "http://www.example.com/schemas/ipo.xsd"
    ELEMENT "purchaseOrder";
    INSERT INTO po_tab
      VALUES(1, XMLType(
                  '<?xml version="1.0"?>
                   <ipo:purchaseOrder
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xmlns:ipo="http://www.example.com/IPO"
                     xsi:schemaLocation="http://www.example.com/IPO
                                         http://www.example.com/schemas/ipo.xsd"
                     orderDate="1999-12-01">
                     <shipTo>
                       <name>Helen Zoe</name>
                       <street>121 Broadway</street>
                       <city>Cardiff</city>
                       <state>Wales</state>
                       <country>UK</country>
                       <zip>CF2 1QJ</zip>
                     </shipTo>
                     <billTo>
                       <name>Robert Smith</name>
                       <street>8 Oak Avenue</street>
                       <city>Old Town</city>
                       <state>CA</state>
                       <country>US</country>
                       <zip>95819</zip>
                     </billTo>
                     <items>
                       <item partNum="833-AA">
                         <productName>Lapis necklace</productName>
                         <quantity>1</quantity>
                         <USPrice>99.95</USPrice>
                         <ipo:comment>Want this for the holidays!</ipo:comment>
                         <shipDate>1999-12-05</shipDate>
                       </item>
                     </items>
                   </ipo:purchaseOrder>'));Example 10-2 Using XMLTRANSFORM and DBURITYPE to Retrieve a Style Sheet
    DBURIType is described in Chapter 20, "Accessing Data Through URIs".
    DROP TABLE stylesheet_tab;
    CREATE TABLE stylesheet_tab(id NUMBER, stylesheet XMLType);
    INSERT INTO stylesheet_tab
      VALUES (1,
              XMLType(
                '<?xml version="1.0" ?>
                 <xsl:stylesheet version="1.0"
                                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                   <xsl:template match="*">
                     <td>
                       <xsl:choose>
                         <xsl:when test="count(child::*) > 1">
                           <xsl:call-template name="nested"/>
                         </xsl:when>
                         <xsl:otherwise>
                           <xsl:value-of select="name(.)"/>:<xsl:value-of
                                                              select="text()"/>
                         </xsl:otherwise>
                       </xsl:choose>
                     </td>
                   </xsl:template>
                   <xsl:template match="*" name="nested" priority="-1" mode="nested2">
                     <b>
                       <!-- xsl:value-of select="count(child::*)"/ -->
                       <xsl:choose>
                         <xsl:when test="count(child::*) > 1">
                           <xsl:value-of select="name(.)"/>:<xsl:apply-templates
                                                              mode="nested2"/>
                         </xsl:when>
                         <xsl:otherwise>
                           <xsl:value-of select="name(.)"/>:<xsl:value-of
                                                              select="text()"/>
                         </xsl:otherwise>
                       </xsl:choose>
                     </b>
                   </xsl:template>
                 </xsl:stylesheet>'));
    SELECT
      XMLtransform(x.xmlcol,
                   DBURIType('/XDB/STYLESHEET_TAB/ROW
                                [ID=1]/STYLESHEET/text()').getXML()).getStringVal()
      AS result
      FROM po_tab x;
    This produces the following output (pretty-printed here for readability):
    RESULT
    <td>
      <b>ipo:purchaseOrder:
        <b>shipTo:
          <b>name:Helen Zoe</b>
          <b>street:100 Broadway</b>
          <b>city:Cardiff</b>
          <b>state:Wales</b>
          <b>country:UK</b>
          <b>zip:CF2 1QJ</b>
        </b>
        <b>billTo:
          <b>name:Robert Smith</b>
          <b>street:8 Oak Avenue</b>
          <b>city:Old Town</b>
          <b>state:CA</b>
          <b>country:US</b>
          <b>zip:95819</b>
        </b>
        <b>items:</b>
      </b>
    </td>Example 10-3 Using XMLTRANSFORM and a Subquery to Retrieve a Style Sheet
    This example illustrates the use of a stored style sheet to transform XMLType instances. Unlike the previous example, this example uses a scalar subquery to retrieve the stored style sheet:
    SELECT XMLtransform(x.xmlcol,
        (SELECT stylesheet FROM stylesheet_tab WHERE id = 1)).getStringVal()
         AS result
       FROM po_tab x;Example 10-4 Using Method transform() with a Transient Style Sheet
    This example uses XMLType method transform() to transform an XMLType instance using a transient style sheet:
    SELECT x.xmlcol.transform(XMLType(
    '<?xml version="1.0" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="*">
        <td>
        <xsl:choose>
          <xsl:when test="count(child::*) > 1">
            <xsl:call-template name="nested"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="name(.)"/>:<xsl:value-of select="text()"/>
          </xsl:otherwise>
        </xsl:choose>
        </td>
    </xsl:template>
    <xsl:template match="*" name="nested" priority="-1" mode="nested2">
        <b>
        <!-- xsl:value-of select="count(child::*)"/ -->
        <xsl:choose>
          <xsl:when test="count(child::*) > 1">
            <xsl:value-of select="name(.)"/>:<xsl:apply-templates mode="nested2"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="name(.)"/>:<xsl:value-of select="text()"/>
          </xsl:otherwise>
        </xsl:choose>
        </b>
    </xsl:template>
    </xsl:stylesheet>'
    )).getStringVal()
    FROM po_tab x;
    So in short XMLTRANSFORM ;-) ?

  • How to add jar files to a project?

    What is the correct way to add jar files to a project?
    Jdev Help has an entry "Adding Files to a Project Using the Add Files or Directories Dialog", but when I goto File->Open as it says, there is no "Add Files or Directories" dialog.
    Using JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660 on Linux.

    That's not quite what I need, as it does not copy the files into the project, but just creates references to their original location in the filesystem. We want local copies so we can check the whole project into Subversion and not have external dependencies.
    Should I just copy the files manually (outside of Jdeveloper)? And what directory should I copy to?
    Thanks.

  • Add jar files and use those classes at the runtime

    Hi All,
    I need to add some jar files at the runtime depends on which the user selects where the jar file is located and i need to import those classes in other class for some functionalities . I could add jar files by using the URLClassLoader and Class.forName("myjar.myclassname") is also succeeded and i have no clue how to use those classes with in the jar file as i couldn't import those classes also in the source because the jar files are being added at the runtime(This leads to class not found exception at the compile time).
    I had found a complicated way of using those classes after being added at the run time as below.
       Class clazz = Class.forName(myClass);
                final Method method = clazz.getDeclaredMethod(requiredMethod, new Class[]{URL.class});
                final Object returned = method.invoke(clazz.newInstance(), new Object[]{request}); but, its really pain to use in this way in all the places.
    Does any of you have simpler suggestions on how to achieve this?
    Thanks,
    Venky.

    Thanks jschell. Yes, you are right. I had found that using reflection API is the only way to load classes at the run time. But according to our application using reflection makes the application little complex, so while start of the application or during other modifications, i am overwriting my jar file to the latest one using FileChannel class as below
          FileChannel ic = new FileInputStream("new.jar").getChannel();
          FileChannel oc = new FileOutputStream("old.jar").getChannel();
          ic.transferTo(0, ic.size(), oc);
          ic.close();
          oc.close();After this code is executed, our application totally uses the new jar file.It is little fast than using reflection. Is this a good idea?

  • How to use xsl document() function with LiveCycle XSLT processor

    Hello,
    I would like to use LiveCycle XSLT processor to merge xml documents by using the xsl document() function.
    However, I have not, yet, found  clear reference information on the specifics of how to accomplish in LC. For instance if you have
    a transformation that does merging using a standalone xml editor (such as Oxygen), than what is required to accomplish the same
    using the LiveCycle XSLT service.  How do you specify the URI of the XML document that is specified as an input in the xsl document() function. Your insight is appreciated.   Regards

    Hello Steve,
    I checked the reference that you cited (XSLT Transformation).   The reference omits discussing how to use xlst document() function within a stylesheet.  I think that probably means that feature of xslt technology is not directly available through LiveCycle.  When I find a workaround, I'll post an update...for the user community that might encounter the same issue.  Thank you for your response and insight.  Regards, jb1809

  • How to add .jar files in my project

    Hi all,
    i am designing a application where i want to translate some words of my web page to different language
    say, i want "search" word to be translated to french language
    i have got some .jar files google-api-translate-java-0.4.jar to do this work...
    can anyone tell in which folder to put .jar files ,so that it works in my project..
    i am using Eclipse SDK 3.3
    Thanks

    how to add .jar files in my project In your eclipse goto,
    Project --> Properties --> Java Buil Path --> Add External Jar
    By that u can select your JAR and click OK..........

  • Problem with Enable scalable feature of XSLT processor

    Hi Gurus,
    I'm using BI Publisher 10.1.3.4.1. I've having a report, when running in a specific sequence (i.e. after running with XML dataset 1 then dataset 2), will yield an error. Here is the log I got in the xdo.log.
    [061411_110902953][][EXCEPTION] java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
         at oracle.apps.xdo.servlet.RTFCoreProcessor.transform(RTFCoreProcessor.java:91)
         at oracle.apps.xdo.servlet.CoreProcessor.process(CoreProcessor.java:256)
         at oracle.apps.xdo.servlet.CoreProcessor.generateDocument(CoreProcessor.java:81)
         at oracle.apps.xdo.servlet.ReportImpl.renderBodyHTTP(ReportImpl.java:678)
         at oracle.apps.xdo.servlet.ReportImpl.renderReportBodyHTTP(ReportImpl.java:255)
         at oracle.apps.xdo.servlet.XDOServlet.writeReport(XDOServlet.java:270)
         at oracle.apps.xdo.servlet.XDOServlet.writeReport(XDOServlet.java:250)
         at oracle.apps.xdo.servlet.XDOServlet.doGet(XDOServlet.java:178)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.apps.xdo.servlet.security.SecurityFilter.doFilter(SecurityFilter.java:86)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.NullPointerException
         at oracle.xdo.parser.v2.FilePageManager.pageLength(FilePageManager.java:242)
         at oracle.xdo.comp.CXMLStream.ensureReadCapacity(CXMLStream.java:1543)
    Then I tried turning off "Enable scalable feature of XSLT processor" (under the FO Processing, default is ON) This error cannot be reproduced again (i.e. my report can run in whatever sequence without an error).
    Would anyone explain to me what actually is the difference between setting the "Enable scalable feature of XSLT processor" to true and false. I'll be running the same report template with thousands of pages in some cases and I'm anxious whether turning OFF the "scalable feature" will make the performance suffer.
    Thanks in advance,
    Jonathan

    Are you running Enterprise Edition? I believe flashback database is only available with Enterprise.

  • XSLT processor

    which XSLT processor do you use ? Xalan , cocoon ?
    please suggest a good XSLT processor

    BTW, i have not seen you in the forum for the past
    3-4 days....
    http://forum.java.sun.com/thread.jspa?threadID=628173

Maybe you are looking for

  • Serious problems after GS5 Android 5.0 update

    I updated my Galaxy S5 to Lollipop (5.0) using the recommended procedure the first day it was available.  Since upgrading, my phone has developed the following persistent problems: I cannot maintain a Wi-Fi connection over 802.11ac.  It tries to conn

  • Thinkvantage button no longer glowing

    I recently upgraded to Windows 7 and now my Thinkvantage button has stopped lighting up its blue LED. Anyone else experiencing this? Any drivers or firmware in the works for this, Lenovo?

  • Data Access Error in OIM Scheduler

    I have a scheduler task in OIM,which fetches the "*Manager Employee ID*" custom field from OIM and if that is not empty then updates the Manager ID for that user. The scheduler task when run throws an Data Access error, every time it starts and close

  • How to detect SQL type to avoid SQL injection

    Hi, I work in a gsm company and we develop a program to make trend analysis. Users of this program know how to write SQL statements. I want them to write specific sql statements as input statement of my program (SELECT ... from ...). Mostly SELECT st

  • Splice 2 projects together

    How do I splice project A onto project B to create project AB? I am in iMovie '09.  Thank you.