XSLT alternative

Hi All,
Recently I got an application that has performance issues. It is taking very long time for XSLT transformation due to large xml files and I am looking into alternatives to XSLT. I would appreciate if you can throw in some ideas here.
Thanks
WD

I has the same scenario where I need to transform huge xml files into html reports. Freemarker is an freeware tool which can best server as an alternative to XSLT.
I had following statistics
Time taken by Xalan to transform a complex xml file: 23.25 second
Time taken by Saxon to transform the same file:9.125 second
where as Freemarker took only 3.734 second.
But the problem with freemarker is that you have to use its own templates using freemarker template language to generate different html pages.

Similar Messages

  • [svn:fx-trunk] 7784: adding xslt change so info related to Alternative shows up in the asdoc

    Revision: 7784
    Author:   [email protected]
    Date:     2009-06-12 07:46:21 -0700 (Fri, 12 Jun 2009)
    Log Message:
    adding xslt change so info related to Alternative shows up in the asdoc
    QE Notes: None.
    Doc Notes: None.
    Modified Paths:
        flex/sdk/trunk/asdoc/templates/class-parts.xslt
    Added Paths:
        flex/sdk/trunk/asdoc/templates/images/P_AlternativeMetadataIndicator_30x28_N.png

    I've checked the resolution in Photoshop just as a double-check and it shows resolution as 300 PPI. When you say "because they can be mixed" do you mean because elements and graphics with the PDF can be of varying resolutions? I hadn't thought of that, if that's what you meant. I do have some items within my pdf that might be lower resolution.
    If these show up in my Preflight Panel as an issue, does this mean they would be flagged also with the Printer? In trying to find a resolution I read several forum discussions about how Printers often run your document through a Preflight process and will send it back when there are low resolution images in the document.
    Is there some other way to be sure these images are in the InDesign document as 300 PPI so I can know they will in fact print correctly?
    PS - Peter - thanks for the super quick response! And I saw your the highlighted "Exceptional Contributor" on the right sidebar for the InDesign forum - clearly well-deserved! Congrats

  • 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 ;-) ?

  • 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.

  • XSLT Mapping with Java class not working in Integration Repository

    Hi,
    I have an XSLT mapping program with Java enhancement and I was able to successfully tested it in Stylus Studio. However, when I imported the Java class and the xslt program in Enterprise Service Builder and tested it, my program does not compile.
    Here is the error message: "Transformer Configuration Exception occurred when loading XSLT mapping_temp.xsl; details: Could not compile stylesheet".
    My java program is in a zip file containing SOAPHeaderHandler.java and SOAPHeaderhandler.class. My Java has a package com.nga.xslt.
    Here is the declaration of my Java class in the XSLT: xmlns:javamap="java:com.nga.xslt.SOAPHeaderHandler"
    It seems that it could not read the java class. Can you please advice what is wrong?

    Hi ,
    select XMLTOOLKIT option in Operation mapping and execute it.
    I am not sure we can call java program in XSLT Program,but alternative is copy the code and use it in XSLT mapping it self,that means your XSLT program will become with JAVA extensions.
    then in Operation mapping level select SAPXMLTOOL kit option and execute it. i hope it will work. if it is not working then you have deploy some JAXP files on server,because the way execution of XSLT Mpaping program got changed,like when eve you executing XSLT with extnasions( if you are not using XMLTOOL kit option) then you have to use latest version of JAXP.JDK files.
    Regards,
    Raj

  • Adding "Filter Criteria" to the XSLT List View Web Part impact on "Export to Excel" functionality within Document Library

    Hi there,
    XSLT List View displaying all the list items within the Document Library. In order to implement the Search functionality within Document library out of box "Text Filter" web part is configured as explained below. The solution is similar to
    the one suggested at
    http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=77
    "Text Filter" Web Part added to the page.
    Filter Criteria (i.e., XSLT List View columns) added to the XSLT List View where the filter parameters take the input from the "Text Filter" Web Part .
      3. Both Web Parts (XSLT List View and the Text Filter) are connected.
    When the search criteria is entered into the "Text Filter" Web Part, it is passed to the relevant Columns of the XSLT List View and the documents (List Items) that match the search criteria are shown within XSLT List View.
    Search functionality working as expected.
    Query: Selecting the "Export to Excel" icon from the ribbon generates the excel spread sheet with no data except Column Titles from the Document library. In the investigation it is
    found that adding the 'Filter Criteria' on XSLT List View is causing this bug. When the Filter Criteria is removed, then "Export to Excel" functionality is working as expected.
    But it is mandatory to add "Filter Criteria" to implement the search functionality with in the document library.
    Help: Help/input appreciated on the work around to get the "Export to Excel" functionality work when the "Filter Criteria"
    exist on the XSLT List View.
    Regards,

    Once again thanks very much for your help Scott. very much appreciated.
    In the investigation it is found that removing the 'Filter Criteria' on XSLT List View makes the "Export to Excel" functionality work. But the 'Filter Criteria' is mandatory to get the 'Document Search' functionality.
    I think that due to technical limitations it should be concluded that 'only custom development can make all work, no code solutions using the SharePoint Designer can meet all the requirements.
    If you can think of any alternative solution that could help in resolving the current issue or fix the issue without any custom implementation please inform. Otherwise this issue would be marked as resolved with your suggested response.
    Regards,

  • Swapping XML Parser and XSLT to Xalan 2.7.0 - Not Working (OC4J 10.1.3)

    Hi-
    I'm trying to use the latest Xercies/Xalan classes in OC4J 10.1.3 as described in the How-To swap XML Parsers document:
    http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html
    What I can see happening is that the oracle.xml shared library is successfully 'turned off', but the xalan libraries are not added. Instead, the default xml classes that are distributed with the JDK become visible. For instance, using a slightly modified version of the index.jsp page from the how-to, I get this result:
    ------ Output from JSP page ----------------
    TransformerFactory Instance: org.apache.xalan.processor.TransformerFactoryImpl
    Transformer Instance: org.apache.xalan.transformer.TransformerIdentityImpl
    Transformer Version: Xalan Java 2.4.1 (!!)
    What I expect is for that last line to say version 2.7.0, which is the version of the xalan.jar included in my shared library (code to add that line to the how-to shown below).
    I suspect what is happening is that the class loader is simply not letting a shared library override a system library - to do that you probably need to place the jar files in system endorsed directory.
    Has anyone gotten this how-to to work - actually replacing the XML parser/transform classes with the latest Xalan classes? Are you sure it is seeing the current version you placed in the shared library?
    Thanks,
    Eric Everman
    ---- My modified getXSLTDetails() method in the index.jsp page of the how-to -------
    <!-- Additional Import -->
    <%@ page import="org.apache.xalan.Version" %>
    public static String getXSLTDetails()
    Transformer transformer=null;
    TransformerFactory transformerfactory = TransformerFactory.newInstance();
         Version ver = null;
         String br = "<" + "br" + ">"; //otherwise the otn forum chocks on the break.
    try
    transformer = transformerfactory.newTransformer();
              ver = (Version) transformer.getClass().forName("org.apache.xalan.Version").newInstance();
              String ret_val =
                   "TransformerFactory Instance: "+transformerfactory.getClass().getName() + br +
                   "Transformer Instance: "+transformer.getClass().getName() + br;
              if (ver != null) {
                   ret_val = ret_val + "Transformer Version: " + ver.getVersion() + br;
              } else {
                   ret_val = ret_val + "Transformer Version not Available" + br;
              return ret_val;
    catch (Exception e)
    e.printStackTrace();
    return e.getMessage();
    }--------------------------------------------------------------------

    Steve - Thanks for responding on this.
    The Xalan SQL extension is built into Xalan. The most painless way to try it out is to run it via JEdit: www.jedit.org
    JEdit a OS Java application with a fairly painless install process (I'm assuming you already have a current JRE installed). Once its installed, you'll need to install the XSLT plugin - in JEdit goto Plugins | Plugin Manager | Install and pick the XSLT plugin. You'll need the Oracle JDBC classes on your classpath - this can be done by copying the oracle_jdbc4.jar into the [JEdit install directory]/jars directory.
    Restart to load that jar and you should be all set.
    I included a sample XSLT page at the bottom of this post that is somewhat of a template transform for the SQL extension - its more complicated then it needs to be, but it does some nice things with the results of the query. Save it as a file and make the appropriate changes to the 'datasource' parameter near the top of the file.
    Then in JEdit, open the file and make sure the XSLT plugin is visible (Plugins | XSLT | XSLT Processor Toggle - or alternately dock it in the window via global prefs). In the XSLT plugin: Allow the current buffer to be used as the source, Add that same file as a stylesheet via the '+' button, and pick a result file at the bottom. Then click the 'Transform XML' button.
    Troubleshooting: I seem to remember having some classpath errors when I tried this on windows, but others have had it work w/o issues. I do remeber that the XSLT plugin had a popup window that gave a pretty good explaintion of the problem, if it occurs. Also, for some reason the XSLT plugin will not create a new file for the output, so its often best to create a file first, then choose it as the output. Of course, you can always run a transformation from the command line or w/in an applicatoin. Full docs on the Xalan SQL extension can be found at: http://xml.apache.org/xalan-j/extensionslib.html#sql
    Here is my sample XSLT transform using the SQL extension:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              xmlns:sql="http://xml.apache.org/xalan/sql"
              xmlns:str="http://exslt.org/strings"
              xmlns:xalan="http://xml.apache.org/xalan"
              extension-element-prefixes="sql str xalan">
         <xsl:output indent="yes"/>
         <xsl:param name="driver">oracle.jdbc.OracleDriver</xsl:param>
         <xsl:param name="datasource">jdbc:oracle:thin:jqpublic/jqpublic@server_name:1521:dbname</xsl:param>
         <xsl:param name="jndiDatasource"><!-- jndi source for production use w/in enterprise environment --></xsl:param>
         <xsl:param name="debug">true</xsl:param>
         <xsl:variable name="connection" select="sql:new()"/>
         <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
         <xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'"/>
         <!--
              The query:  You could pass parameters in to this query to build a where clause, but here is a simple example.
              Also, its nice to wrap the query with a max row number to prevent huge results.
         -->
         <xsl:param name="query">
         select * from (
      SELECT
              'One' FIELD_1,
              'Two' FIELD_2
         FROM DUAL
         ) where rownum < 100
         </xsl:param>
         <!-- Essentially, create a XConnection object -->
         <xsl:variable name="connection" select="sql:new()"/>
         <xsl:template match="/">
        <xsl:choose><!-- Connect using JNDI -->
          <xsl:when test="$jndiDatasource != ''">
            <xsl:if test="not(sql:connect($connection, $jndiDatasource))">
              <xsl:message>Failed to connect to db via jndi connection</xsl:message>
              <xsl:comment>Failed to connect to db via jndi connection</xsl:comment>
              <xsl:if test="$debug = 'true'">
                <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
            </xsl:if>
          </xsl:when>
          <xsl:otherwise><!-- Connect using connection string -->
            <xsl:if test="not(sql:connect($connection, $driver, $datasource))">
              <xsl:message>Failed to connect to db via driver/url connection</xsl:message>
              <xsl:comment>Failed to connect to db via driver/url connection</xsl:comment>
              <xsl:if test="$debug = 'true'">
                <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
            </xsl:if>
          </xsl:otherwise>
        </xsl:choose>
              <!--
              The results of the query.  The rowset is brought back in 'streaming' mode,
              so its not possible to ask it for the number of rows, or to check for zero
              rows.  There is a switch to disable streaming mode, but this requires all
              rows to be brought into memory.
              -->
              <xsl:variable name="table" select="sql:query($connection, $query)"/>
              <xsl:if test="not($table)">
                   <xsl:message>Error in Query</xsl:message>
                   <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
              <page>
                   <!-- Your xalan environment -->
                   <xsl:copy-of select="xalan:checkEnvironment()"/>
                   <!-- Build a bunch of metadata about the rows -->
                   <meta>
                        <cols>
                             <xsl:apply-templates select="$table/sql/metadata/column-header"/>
                        </cols>
                   </meta>
                   <rowset>
                        <!--
                             With streaming results, you must use the apply-temmplates contruct,
                             not for-each, since for-each seems to attempt to count the rows, which
                             returns zero.
                        -->
                        <xsl:apply-templates select="$table/sql/row-set"/>
                   </rowset>
              </page>
              <xsl:value-of select="sql:close($connection)"/><!-- Always close -->
         </xsl:template>
         <xsl:template match="row">
              <row>
                   <xsl:apply-templates select="col"/>
              </row>
         </xsl:template>
         <xsl:template match="column-header">
              <col>
                   <xsl:attribute name="type">
                        <xsl:value-of select="@column-typename"/>
                   </xsl:attribute>
                   <xsl:attribute name="display-name">
                        <xsl:call-template name="create-display-name"/>
                   </xsl:attribute>
                   <xsl:value-of select="@column-name"/>
              </col>
         </xsl:template>
         <!-- Convert column names to proper caps: MY_FIELD becomes My Field -->
         <xsl:template name="create-display-name">
              <xsl:variable name="col-name">
                   <xsl:for-each select="str:tokenize(@column-name, '_')">
                        <xsl:value-of
                             select="concat(translate(substring(., 1, 1), $lowercase, $uppercase), translate(substring(.,2), $uppercase, $lowercase), ' ')"/>
                   </xsl:for-each>
              </xsl:variable>
              <xsl:value-of select="substring($col-name, 1, string-length($col-name) - 1)"/>
         </xsl:template>
         <!-- Creates data columns named 'col' with a column-name attribute -->
         <xsl:template match="col">
              <col>
                   <xsl:attribute name="column-name"><xsl:value-of select="@column-name"/></xsl:attribute>
                   <xsl:value-of select="."/>
              </col>
         </xsl:template>
    </xsl:stylesheet>

  • XSLT Enhancement with Java, Tokenize Functionality

    I tried the following requirement using EXSLT with no luck. Is there any other alternative to tokenize in XSLT 1.0.
    The syntax i have here is  
    <xsl:for-each select="tokenize($this/Field1,',')">
           <xsl:variable name="f1v" select="."/>
         <xsl:for-each select="tokenize($this/Field2,'\|')">
              <xsl:variable name="f2v" select="."/>
              <xsl:for-each select="tokenize($this/Field3,'\|')">
                        <xsl:variable name="f3v" select="."/>
    There are multiple for-each based on tokens
    I am leaning towards to Enhancing XSLT with Java Function. As i have less experience with Java, can anybody help me with the code that can be used by XSLT for Tokenize functionality.
    I have written something like following. I still have errors to fix. But i am not sure about having resultSet or return at the end, to make sure all the tokens were sent to XSLT.
    public class MyStringToken
         public static void main(String [] args)
              String str = "sssd;wwer;ssswwwwdwwwwwwwwwww;wwwwe";
              String delimiter = ";";
              MyStringToken my = new MyStringToken();
              my.getTokens(str,delimiter);
         public void getTokens(String str,String delimiter)
              StringTokenizer st = new StringTokenizer(str,delimiter);
              while(st.hasMoreElements())
                   try
                        String delString = new String(st.nextElement().toString());
                        return (delString);
                   catch(Exception e)
                        e.printStackTrace();
    Any help is appreciated

    Hi,
    I have been searching about, and I have found the next example that maybe can help you, It's a template to tokenize in XSLT 1.0 from the web [http://stackoverflow.com/questions/1018974/tokenizing-and-sorting-with-xslt-1-0]
    <xsl:template name="tokenize">
      <xsl:param name="string" />
      <xsl:param name="delimiter" select="' '" />
      <xsl:choose>
        <xsl:when test="$delimiter and contains($string, $delimiter)">
          <token>
            <xsl:value-of select="substring-before($string, $delimiter)" />
          </token>
          <xsl:text> </xsl:text>
          <xsl:call-template name="tokenize">
            <xsl:with-param name="string"
                            select="substring-after($string, $delimiter)" />
            <xsl:with-param name="delimiter" select="$delimiter" />
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <token><xsl:value-of select="$string" /></token>
          <xsl:text> </xsl:text>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
    Also I have found the next example of use tokenize in EXSLT from [http://exslt.org/str/functions/tokenize/index.html] It can be that inI your tests you are not using "str:tokenize", no?
    <xsl:template match="a">
       <xsl:apply-templates />
    </xsl:template>
    <xsl:template match="*">
       <xsl:value-of select="." />
          <xsl:value-of select="str:tokenize(string(.), ' ')" />
       <xsl:value-of select="str:tokenize(string(.), '')" />
       <xsl:for-each select="str:tokenize(string(.), ' ')">
          <xsl:value-of select="." />
       </xsl:for-each>
       <xsl:apply-templates select="*" />
    </xsl:template>
    I hope that helps you.
    Best.
    Jorge

  • Idoc with XSLT Mapping ALE service error

    Hi all,
    I have the same problem with "converting to an ALE logical system".
    In this case I have a Business System without logical system name in the SLD. This information for the IDoc control record, like SNDPOR, I will map with a xslt mapping.
    In weblogs from Michael are the properties for the directory described.
    /people/michal.krawczyk2/blog/2005/09/01/xi-idoc-adapter--edidc40--demystified
    I selected in the comminication channel the last two check boxes, as described in SAP help.
    "Take Sender from Payload
    If you want to take the sender of the message from the payload and not from the configuration information in the Integration Directory, set this indicator.
    If you do not set the indicator, the information is taken from the configuration in the Integration Directory.
    Take Receiver from Payload
    If you want to take the receiver of the message from the payload and not from the configuration information in the Integration Directory, set this indicator.
    If you do not set the indicator, the information is taken from the configuration in the Integration Directory.
    If you set both of the above indicators, you do not require a heading mapping and do not need to set the alternative identifiers.
    However, you must ensure that the SNDPRN, SNDPRT, RCVPRN, and RCVPRT fields are set in the IDoc control record.
    Setting the senders and receivers of a message from the payload simplifies configuration and speeds up processing.
    If the sender and receiver are not set correctly in the payload, the resulting error is only visible in the receiving system. "
    In my XSLT-Mapping I set the appropriate Idoc fields:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:preserve-space elements="*"/>
    <xsl:template match="DATEN">
    <_-XXX_-018_XXXXX_XIDATEN>
    <IDOC>
    <xsl:attribute name="BEGIN">1</xsl:attribute>
    <EDI_DC40>
    <xsl:attribute name="SEGMENT">1</xsl:attribute>
    <TABNAM>EDI_DC40</TABNAM>
    <DOCREL></DOCREL>     
    <DIRECT>2</DIRECT>
    <IDOCTYP>_-XXX_-018_XXXXX_XIDATEN</IDOCTYP>
    <MESTYP>_-XXX_-018_XXXXX_XIDATEN</MESTYP>
    <SNDPOR></SNDPOR>
    <SNDPRN>XXXXX01IN</SNDPRN>     
    <SNDPRT>LS</SNDPRT>
    <RCVPOR>xxx</RCVPOR>
    <RCVPRN>xxx</RCVPRN>
    <RCVPRT>LS</RCVPRT>
    </EDI_DC40>
    <xsl:variable name="pid" select="substring(.,1,1)"/>
    But in the sxmb_moni the message is red with the error message :" converting to an ALE logical system"
    Have you any idea?
    With another interface I used a graphic Mapping and the same properties in the directory and it works.
    Bye
    Stefan

    Hi togehter,
    it works now, after cpa_cache and sxi_cache.
    and and ...
      <IDOCTYP>/XXX/018_XXXXX_XIDATEN</IDOCTYP>
      <MESTYP>/XXX/018_XXXXX_XIDATEN</MESTYP>
    Without: _-...
    I would write a blog.
    Does know one how that goes here?
    Thanks
    SDN is great
    Stefan

  • [JS - CS3 - Mac OS] XML import preferences: xslt file issue...

    Hi,
    I know there's a bug on Mac about this, does anybody knows if is there another way to do it?
    I'm importing an XML file and I need to transform it with an XSLT stylesheet.
    Here's the code:
    var xmlFile = new File("/User/Desktop/product.xml");
    var xsltFile = new File("/User/Desktop/stylesheet.xsl");
    with(app.activeDocument.xmlImportPreferences){
         transformFilename = xsltFile;
    myNode.importXML(xmlFile);
    Pretty simple but ID is missing my xsl file...
    I'm really bored about this, hope there's an alternative solution...
    Thanks anticipately.

    Hi Thomas
    I've learnt a lot since my last posting, so thanks for putting me on the right track then.
    I have actually tried what you suggested. I had the same problem with the XML file path when it was hard coded. The object being that I just wanted to replace a static xml doc.
    Where I've got      set xmlpath to choose file with prompt "Select the XML"
    i also had             set xsltpath to choose file with prompt "Select the XSLT"
                               log xsltpath --(this throws the value of xsltpath in to the results pane of AS)
    It still didn't work. It showed the correct path to the file but still failed when run through the script. Bizzare!
    The only other thing that I could try is to just define xsltpath as "CWtoINDDElements.xsl", due to the fact that I've told InDesign that I'm getting the XML from the same folder in the 'choose' function.
    I'm not connecting to my work VPN at 11.50pm, so I'll try again in the morning.
    Thanks Thomas. It's great to bounce ideas around.
    Best, Andrew

  • ANN: Indesign CS3 JS help to HTML using XSLT

    I felt quite at home with the previous CS's JS Help PDFs, but I'm not too wild about the ExtendScript editor. But if you don't use that, you miss out the online help! Fortunately, in one of the ExtendScript subfolders you can find an XML document with the slightly bizarre name "omv$indesign-5.0-en_us.xml". This contains the
    entire help document, in handy XML format.
    As an exercise, I wrote an extensive XSL stylesheet to convert it to fully cross-referenced HTML. This script is a bit too long to include here, but you can d/l it at
    http://www.jongware.com/binaries/indesign.xsl.
    Run it through your favourite XSL processor, and you get the whole thing in one huge file. Alternatively, you can select either a single class or enumeration (such as "TextFrame") or a single alphabetic letter ("A", just to provide an example, will process all classes and enums from "AlignDistributePreference" to "AutoEnum"). In these cases, the hyperlinks will (obviously/unfortunately) fail.
    It is quite possible to load the 113,000 line XML into InDesign and apply formatting to it, but I think I'll leave it at this.

    I sure had fun 'tokenizing' the "Can accept: xx, yy or zz" remarks for the "any" value into separate entries :) Only for Properties, though, since with most of the Methods you changed the wording. Please, for the next version, a list of these possible elements in the XML!
    Some new items added: a full index (only if you check it in the XSL--it's quite long); more importantly, per class a list of "Element of", "Returned by", and "Used in", all hyperlinked to the extreme -- now you can see at a glance how all elements link together! These lists are not
    entirely complete (that's your (Ole's) fault, because of that "any" notation).
    [PS: there seem to be no explanation of function return values...]
    I understand the idea of the SVG block diagrams, and if I feel the urge (and have an example of what it should look like) I might give that a try -- just for laffs. In the mean time I'm finally gonna upgrade my CS1/2 scripts, using my own HTML to guide me :)
    For the XSLT impaired amongst us, d/l the complete HTML page at jongware.com:
    indesign.zip (3.5MB, zipped to 471Kb). Enjoy!

  • Using transform api with xslt and DOM Nodes

    Hi,
    when trying to transform a xml document with xslt using the javax.xml.transform api
    providing an element node of a previously parsed document, I find that absolute
    paths are not recognized.
    The following program shows what I am basically doing (the class can be executed
    on the command line providing a stylesheet and xml instance):
    import java.io.*;
    import org.w3c.dom.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import javax.xml.parsers.*;
    class Transform {
    public static void main(String [] args) throws Exception {
         TransformerFactory tfactory = TransformerFactory.newInstance();
         Transformer transformer = tfactory.newTransformer(new StreamSource(args[0]));
         DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
         DocumentBuilder parser = dfactory.newDocumentBuilder();
         Document doc = parser.parse(args[1]);
         Element domElem = doc.getDocumentElement();
         // workaround
    //     StringWriter out = new StringWriter();
    //     Transformer id = tfactory.newTransformer();
    //     id.transform(new DOMSource(domElem),new StreamResult(out));
    //     String xml = out.toString();
    //     transformer.transform(new StreamSource(new StringReader(xml)), new StreamResult(System.out));
         transformer.transform(new DOMSource(domElem), new StreamResult(System.out));
    transformer.clearParameters();
    If I use this on e.g.
    xsl:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output indent="yes" encoding="ISO-8859-1" method="xml"/>
    <xsl:template match="/">
    <xsl:value-of select="/foo/bar"/>
    </xsl:template>
    </xsl:stylesheet>
    xml:
    <foo>abc<bar>def</bar></foo>
    I get
    <?xml version="1.0" encoding="ISO-8859-1"?>
    abcdef
    instead of
    <?xml version="1.0" encoding="ISO-8859-1"?>
    def
    I think this is due to the fact, that the transformation does not recognize
    any absolutely adressed xpath correctly.
    From what I read in the API docs, I think what I'm doing should be ok.
    So: did I misunderstand something or is this a bug in the java libraries?
    I'm using j2sdk 1.4.1_01 on i386 linux.
    If I use the commented code (serializing the xml and doing the transformation
    with a StreamSource, that has to be parsed again), everything's fine.
    Of course it would be easier to parse the file directly in the example but in the
    real program, I already have a dom tree and want to transform a part of it.
    Any help appreciated.
    Thanks, Morus

    why?
    that's all the point of XSL: define what part of your
    XML you want in your XSL templates, there is no need
    to prepare a sub-DOM of your DOM.
    Ok. Right. That's an alternative.
    The problem remains, that there are some stylesheets originally written
    for the current solution and though they should work with the whole document
    as well, it's not certain.
    Actually I don't know if this ever worked. I did neither write this code nor maintained the system so far.
    btw. you would be faster by giving a StreamSource to
    your transformation.Probably yes. But that would imply to rewrite a lot of code.
    What is happening is:
    there is a SOAP answser containing a xml document as the result parameter.
    The SOAP answer is parsed (I guess by the soap classes already) and the
    result xml is extracted. That's where the element node I'm trying to transform
    stems from.
    Besides, I still don't see why DOMSource takes any node if only document nodes
    work.
    Thanks, Morus

  • XSLT version supported in JDK 6 Transformer

    Hi! This is a simple question: Does JDK 6 Transformer Class support XSLT 2.0?
    My problem raise when I use the <xsl:character-map> tag. A Example:
    template.xslt
    <xsl:stylesheet version="2.0">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" use-character-maps="vxml"/>
    <xsl:character-map name="vxml">
       <xsl:output-character character="«" string='&lt'/>
       <xsl:output-character character="»" string='&gt'/>
       <xsl:output-character character="¨" string='"'/>
    </xsl:character-map>
    <xsl:template match="/">
       «vxml version=¨2.0¨»
       {xslt operations...}
       «/vxml»
    </xsl:template>
    {code}
    *someXML.xml*
    {code}
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="template.xslt"?>
    {code}
    Well, when I use external software (Altova XMLSpy), the result is exactly that I want... but, when I use a simple java class with Transformer (in java 6), the result contains alternative char and no the correct character that character-map is supposed to change.
    Then, in this forum all people only use XSLT with version="1.0"... and appear my question... Transformer Class in JDK 6 really support XSLT version 2.0? I can't find information of this...
    Edited by: MIrribarra on 20-03-2009 05:51 PM
    Edited by: MIrribarra on 20-03-2009 05:53 PM
    Deleted intensionally semi-colon in "&lt" and "&gt" because editor change string code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Simple answer: No.
    Less simple answer: you can plug in any transformer you like. The process for doing that is described in the documentation for javax.transform.TransformerFactory, method newInstance.

  • Calling Custom XSLT java class from BPEL in SOA Suite 11g

    Hi All,
    Morning...need some help with this issue...we are currently on SOA Suite 11g (11.1.1.4) version.
    Earlier while we were on SOA Suite version 10g (10.1.3.3) we were calling the custom java classes from the xsl mapping for complex transformation and for this we were placing the .class file as .jar file at the location mentioned here $OC4J_HOME/j2ee/home/applib directory and then mentioning the namespace as http://www.oracle.com/XSL/Transform/java/{$classname$} in the XSLT mapping file.
    Now in SOA Suite 11g if we need to retain similar functionality for external custom java calls could someone please help us where do we need to put the .jar file now ..
    exactly at which directory location/path and on which instance/server (application server instance or middle tier instance ) we need to put this .jar file
    Currently we are stuck and need some help with this.
    With thanks & Regards

    Hi Eric & Anuj,
    Thanks for replying , sorry for checking on this now...
    here at this path /opt101/app/oracle/SOAD/SOA11gR1/fmw/Oracle_SOA1/soa/modules/oracle.soa.ext_11.1.1
    we got the ora.soa.ext.jar file and extracted it to get the MANIFEST.mf file ..have mentioned below.
    Now if we need to link our custom .jar file named customfunctions.jar so we need to mention it as below is this correct :
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    Created-By: 17.0-b17 (Sun Microsystems Inc.)
    Implementation-Vendor: Oracle
    Implementation-Title: Oracle SOA EXT
    Implementation-Version: 11.1.1
    Product-Name: Oracle SOA EXT
    Product-Version: 11.1.1.4.0
    Specification-Version: 11.1.1
    Extension-Name: oracle.soa.ext
    Class-Path: classes/
    Class-Path:customfunctions.jar classes/ -- is this the way to mention (means we need to add this additional line or we need to add to the existing line at Class-Path: classes/)
    2.
    Eric the Alternative method mentioned in your update :
    Open a command prompt and change the current directory to the oracle.soa.ext_11.1.1 directory ,
    then execute the build.xml file in the oracle.soa.ext_11.1.1 folder using Ant
    Now could someone please guide us regards this ANT means how does it work and its relation to the build.xml file and how do we check whether we have ANT utility available or not..
    not much conversant with this ANT hence asking here..would lookout for your reply
    thank you

  • XSLT to Text

    Hello XSLT gurus. I'm completely new to the game. The project I'm working on needs to be able to alternately render to either html or text.  I decided to try XSLT's so I could modify the output without really changing the underlying code structure. 
    HTML output is fine.  Getting a little lost in trying to write a transform to text.   Here's why:
    The xml I'm transforming is within this type of structure:
    <Data>
    <Text x="0" y="1">First Line</Text>
    <Text x="12" y="1">Continued on Same Line</Text>
    <Text x="36" y="1">Still Going</Text>
    <Text x="5" y="2">Slightly Indented New Line</Text>
    </Data>
    The basic template I'm using for html is:
    <xsl:template match="Data">
    < xsl:for-each select="Text">
    top: <xsl:value-of select="@y*20"/>;
    left: <xsl:value-of select="@x*10"/>;
    "position": "absolute"; (minus quotes on this line)
    < xsl:value-of select="."/>
    < /xsl:for-each>
    < /xsl:template>
    So I changed the method to text, but am as of yet unable to devise a way to build strings from Text elements based on "x" and "y" values, which is what I need to do for the text output such that what writes is:
    First Line Continued on Same Line Still Going
         Slightly Indented New Line 
    Any help would be very much appreciated.  Thank you.
    JP

    Try this stylesheet:
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    exclude-result-prefixes="msxsl"
    >
      <xsl:output method="html" indent="yes"/>
      <xsl:template match="/">
        <html>
          <body>
            <xsl:apply-templates/>
          </body>
        </html>
      </xsl:template>
      <xsl:template match="Text">
        <xsl:variable name="left" select="@x * 1"/>
        <xsl:variable name="top" select="@y * 1"/>
        <div style=" 
    ">
          <xsl:value-of select="."/>
        </div>
      </xsl:template>
    </xsl:stylesheet>
    where style is: "left: {$left}em; top: {$top}em;". Also add absolute positioning.
    It uses ‘em’ units and ‘* 1’, but you can choose something else.

Maybe you are looking for

  • To Capture Excise Duties for Customer Material

    Dear All, Issue is regarding to capture excise invoice for Customer Material. 1. one of our client receives Customer material which should not be reflected in stock. 2. Excise should be captured which receiving 3. Now when this Customer material is r

  • Tried to upgrade my phone online using Loyalty Discount - Online sales Rep no help

    I tried to upgrade my phone online to take advantage of the online discount and also use  a loyalty discount.  The price of the phone is correct until it I get to checkout, the loyalty discount is then removed and only the online discount is applied.

  • BAPI_PO_CREATE1 Net Price

    Hi Experts, Using BAPI_PO_CREATE1, I try to create a PO with net price $10. This line item is referencing to a Contract item with price $12. After executing the FM, PO was created with net price $12, which is taking from the referencing Contract inst

  • Is it possible to read "rtx" files in JAVA.. and make a "xls" files.. !!

    Hello frnds.. I dont have any idea.. how to read rtx files.. in JAVA.. ?? I have some data in rtx files.. which i want to read it.. and save in xls files.. !! Please someone help.. am new to java.. searched a lot.. abt that .. but didnt find.. anythi

  • Reset text in serach box

    I found that: in case search something (like "xxx") in search center homa page - and get results in results page After clean text from the search box - and add a new text (like "yyy"), still the prvious search string exists (the querystring above has