XSLT linefeeds problem

Hi,
I have a XML and I wrote a XSL to transform the XML to another XML. The problem is of linefeed in the generated XML. See the output XML where everything comes in one line when I open the XML in notepad whereas my XSL is properly indented. What is the problem?
Input XML -><?xml version="1.0" encoding="UTF-8"?>
<Source>
     <FirstName>Bhushan</FirstName>
     <LastName>Bhangale</LastName>
</Source>XSL -><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<xsl:template match="/">
     <Result>
          <Name><xsl:value-of select="concat(Source/FirstName, ' ', Source/LastName"/></Name>
     </Result>
</xsl:template>
</xsl:stylesheet>Output XML -><?xml version="1.0" encoding="UTF-8"?>
<Result><Name>Bhushan Bhangale</Name></Result>Java code which I am using ->import javax.xml.transform.*;
import java.io.*;
public class TransformXML {
public static void main(String[] args) {
     try {
          TransformerFactory tFactory = TransformerFactory.newInstance();
          Transformer transformer = tFactory.newTransformer(new javax.xml.transform.stream.StreamSource("test.xsl"));
          transformer.transform(new javax.xml.transform.stream.StreamSource("input.xml"), new javax.xml.transform.stream.StreamResult( new FileOutputStream("output.xml")));
     catch (Exception e) {
          e.printStackTrace( );
}

Infact I found the standard way of doing it when searched a lot on google.
<xsl:output method = "xml"
     version = "1.0"
     encoding = "UTF-8"
     omit-xml-declaration = "no"
     indent = "yes"
     media-type = "text/plain"/>
The indent = "yes" solves the problem but not to the tabs extent. It only takes care of linefeed.

Similar Messages

  • XSLT mapping problem

    Hi
    Im doign xslt mapping in XI bw two structures..while doing htis i have come across a requirment, where i have to map different values to nodes which are repeating in different sub structures.
    Ex: source structure and target structure are same..
      <Flight>
       <Pflight>
         <fltno>
         <fltname>
         <fltcode>
      </Pflight>
       <Wflight>
            <fltno>
            <fltname>
            <fltcode>
        </Wflight>
       <Rflight>
          <fltno>
          <fltname>
          <fltcode>
        </Rflight>
    </Flight>
    In this each <fltno>,<fltname> nodes have seperate values...
    I have mapped 'fltno' under each sub structure using this statement.
    <xsl:value-of select=".//*[local-name() = 'fltno'
    Here problem is in target structure it is getting same 'fltno'  under all structures. it means it will be passing the value of 'fltno' under first structure(Pflight) to all the <fltno> nodes.
    But my requirment is <Pflight>, <Wflight>, <Rflight> have seperate 'fltno' and they should get their own value in target structure.
    Can somebody help me.....Really Appreciated
    Thanks And Regards
    Rajesh

    Use the whole path or a partial path which is unique:
    <xsl:value-of select="/Flight/Pflight/fltno">
    or
    <xsl:value-of select="//Pflight/fltno">

  • XSLT Mapping - problem with prefixes when calling template

    Hi all,
    I am having a problem with using an XSLT mapping in XI to combine various fields from 2 input messages of different structures into a single output message.  I understand that XI puts a wrapper around the 2 input messages so the structure of the XML I am mapping is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns2:Messages xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge">
    <ns2:Message1>
    <ns:(root of first message)>
    </ns:(root of first message)>
    </ns2:Message1>
    <ns2:Message2>
    <ns:(root of second message)>
    </ns: (root of second message)>
    </ns2:Message2>
    </ns2:Messages>
    Currently my XSL looks like the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="http://example.co.uk/example" xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge" xmlns:javamap="java:systemDate.CurrentDate" version="2.0">
    <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
    <xsl:param name="inputparam"/>
    <xsl:template match="ns2:Messages">
    ...<xsl:calltemplate name="FormattingTemplate"/>
    </xsl:template>
    <xsl:template name="FormattingTemplate">
    </xsl:template>
    </xsl:stylesheet>
    When I test the mapping it works fine until it calls the FormattingTemplate.  Then it throws out a "transformer exception" error saying the prefix 'ns2' is not mapped to a namespace.
    If anyone could tell me where I am going wrong I would be very grateful.
    Thanks,
    Mike

    Hi Udo,
    Thanks for your reply.
    When testing the stylesheet locally with XMLSpy, it works fine, but I have just noticed that it adds information in the root tag of the target message as follows:
    <(root of target message) xmlns:javamap="java:systemDate.CurrentDate" xmlns:ns="http://example.co.uk/example" xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge">
    I checked the root tag of the target message in XI and it does not automatically add this information. Thus I added it in my stylesheet so the information above is projected in the target message, but the same error message appears when the call template function is called.  Do you know if I need to somehow add a namespace to templates other than the main one? If so, do you know how I go about doing that?
    Thanks,
    Mike

  • XML XSLT Maping Problem in XI

    Hi,
    I'm actually doing some tests with the possibility to invoke a ABAP-Mapping (ABAP-Class).
    So my scenario is quite simple:
    I have a import xml where I want to substitute exactly one value (database select).
    Now my problem is that the xml comes in with a namespace at the toplevel element (I wrote the complete source string to the trace in my execute function) called "ns0".
    So I stored the output of the trace to a local file for testing and developing a XSLT-Mapping.
    In debugging mode I see that the command:
    <xsl:for-each select="ns0:BAPI_SALESORDER_CREATEFROMDAT2/ORDER_PARTNERS">
    doesn't work as (I) expected (want to loop at the partners) on this content:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:BAPI_SALESORDER_CREATEFROMDAT2 xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
    <ORDER_HEADER_IN>
    <DOC_TYPE>TA</DOC_TYPE>
    <SALES_ORG>1000</SALES_ORG>
    <DISTR_CHAN>10</DISTR_CHAN>
    <DIVISION>00</DIVISION>
    <PURCH_NO_C>654</PURCH_NO_C>
    </ORDER_HEADER_IN><ORDER_ITEMS_IN>
    <item>
    <PO_ITM_NO>10</PO_ITM_NO>
    <MATERIAL>100-100</MATERIAL>
    <TARGET_QTY>100</TARGET_QTY>
    <T_UNIT_ISO>PCE</T_UNIT_ISO>
    </item>
    <item><PO_ITM_NO>20</PO_ITM_NO>
    <MATERIAL>P-100</MATERIAL>
    <TARGET_QTY>100</TARGET_QTY>
    <T_UNIT_ISO>PCE</T_UNIT_ISO>
    </item>
    </ORDER_ITEMS_IN>
    <ORDER_PARTNERS>
    <item>
    <PARTN_ROLE>AG</PARTN_ROLE>
    <PARTN_NUMB>0000001000</PARTN_NUMB>
    </item>
    <item>
    <PARTN_ROLE>WE</PARTN_ROLE>
    <PARTN_NUMB>0000001000</PARTN_NUMB>
    </item>
    </ORDER_PARTNERS>
    </ns0:BAPI_SALESORDER_CREATEFROMDAT2>
    Anyone an idea?
    Thnx
    Olli

    Hi Olli,
    Did you declare the namespace in the XSLT itself?
    Did your write something like?
    <xsl:stylesheet
      exclude-result-prefixes="xsl ns0"
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
    Actually, the prefix is something you can freely choose.  It is not necessary to use the same prefix as in the source document.  You could just as well use the prefix "x" in your XSLT and write:
    <xsl:stylesheet ...
      xmlns:x="urn:sap-com:document:sap:rfc:functions">
      <xsl:for-each select="x:BAPI_SALESORDER_CREATEFROMDAT2/ORDER_PARTNERS">
    Kind regards, Guy Crets

  • XSLT Transformation problem

    Hi,
    hope anybody can help.
    I try to transform a object to another object via XSLT transformation.
    Here is my coding :
      DATA: wa_transformation TYPE y0dpl_structures.
      DATA: obj_import TYPE abap_trans_srcbind_tab,
            wa_import TYPE abap_trans_srcbind.
      DATA: obj_export TYPE abap_trans_resbind_tab,
            wa_export TYPE abap_trans_resbind.
      DATA: obj_data TYPE REF TO data.
    * Get transformation data
      SELECT SINGLE *
      INTO wa_transformation
      FROM y0dpl_structures
      WHERE filetype = i_file_type.
    * Create table with internal structure
      CREATE DATA e_data TYPE (wa_transformation-structure_name).
      wa_import-name = 'IMPORT'.
      GET REFERENCE OF i_data INTO wa_import-value.
      APPEND wa_import TO obj_import.
    * Call transformation
      CALL TRANSFORMATION (wa_transformation-transformation)
      SOURCE (obj_import)
      RESULT (obj_export).
    i_data is a import parameter from type "ref to data".
    My problem is, that "Call transformation" makes a shortdump when calling them.
    Regards,
    Anton

    Found a solution for my problem. Now it works!
      DATA: wa_transformation TYPE y0dpl_structures.
      DATA: obj_import TYPE abap_trans_srcbind_tab,
            wa_import TYPE abap_trans_srcbind.
      DATA: obj_data TYPE REF TO data.
      DATA: wa_return TYPE bapiret2.
      FIELD-SYMBOLS: <data> TYPE ANY TABLE.
    * Get transformation data
      SELECT SINGLE *
      INTO wa_transformation
      FROM y0dpl_structures
      WHERE filetype = i_file_type.
      IF sy-subrc IS INITIAL.
    * Create table with internal structure
        CREATE DATA e_data TYPE STANDARD TABLE OF (wa_transformation-structure_name).
        ASSIGN i_data->* TO <data>.
        wa_import-name = 'IMPORT'.
        GET REFERENCE OF <data> INTO wa_import-value.
        APPEND wa_import TO obj_import.
    * Call transformation
        CALL TRANSFORMATION (wa_transformation-transformation)
        SOURCE (obj_import)
        RESULT export_data = e_data.
      ELSE.
        MOVE:  'Y0_DPL' TO wa_return-id,
               'E'      TO wa_return-type,
               '108'    TO wa_return-number.
        APPEND wa_return TO e_return.
        CLEAR: wa_return.
      ENDIF.

  • XSLT concat() problem.

    Help guys, this XSLT is getting me down!
    Im quite simply trying to take a string, and replace tabs with 4 non-breaking space characters.
    Can someone please explain to me why the following template doesnt work? It should take in a string, perform the replacement in a recursive fashion, and finally print it out.
    Any help is greatly appreciated.
    Cheers,
    Lee.
         <xsl:template name="substitute">
              <xsl:param name="string" />
              <xsl:param name="from" select="'&#9;'" />
              <xsl:param name="to">
                   &#160;&#160;&#160;&#160;
              </xsl:param>
              <xsl:choose>
                   <xsl:when test="contains($string, $from)">                    
                        <xsl:call-template name="substitute">                         
                             <xsl:with-param name="string" select="concat(substring-before($string, $from), $to, substring-after($string, $from))" />
                             <xsl:with-param name="from" select="$from" />
                             <xsl:with-param name="to" select="$to" />
                        </xsl:call-template>
                   </xsl:when>
              <xsl:otherwise>
                   NO MORE SUBSTITUTION REQUIRED - FINAL STRING IS : <xsl:value-of select="$string"/>
              </xsl:otherwise>
              </xsl:choose>
         </xsl:template>

    Help guys, this XSLT is getting me down!
    Im quite simply trying to take a string, and replace
    tabs with 4 non-breaking space characters.
    Can someone please explain to me why the following
    template doesnt work? It should take in a string,
    perform the replacement in a recursive fashion, and
    finally print it out.
    Any help is greatly appreciated.
    Cheers,
    Lee.
         <xsl:template name="substitute">
              <xsl:param name="string" />
              <xsl:param name="from" select="'     '" />
              <xsl:param name="to">
                   ����
              </xsl:param>
              <xsl:choose>
                   <xsl:when test="contains($string, $from)">                    
                        <xsl:call-template name="substitute">                         
    <xsl:with-param name="string"
    ing" select="concat(substring-before($string, $from),
    $to, substring-after($string, $from))" />
                             <xsl:with-param name="from" select="$from" />
                             <xsl:with-param name="to" select="$to" />
                        </xsl:call-template>
                   </xsl:when>
              <xsl:otherwise>
    NO MORE SUBSTITUTION REQUIRED - FINAL STRING IS :
    : <xsl:value-of select="$string"/>
              </xsl:otherwise>
              </xsl:choose>
         </xsl:template>
    It is not concat() problem, it is a recursion problem -- too many recursive calls.
    I wouldn't recommand using recursion in XSL, yeah, it works, but you can't increase the stack size without restarting the JVM...
    anyway, you can use translate function to do replacing, also you can call a java extension method to do string replacement. it is cleaner anyway and more efficient anyway.

  • XSLT Redundancy Problem

    Hi all,
    I have a serious problem with redundancy in XSLT. In my conversion XML input file, I have many tags like that:
    <tag1 name="..." date1a="..." date1b="...">
    </tag1>
    <tag2 name="..." date2="..." date2b="...">
    </tag2>
    All with different tag names and different attribute names (although the attributes hold similar information).
    Now what I need is a template that could be applied to a combination of tag-attribute, e.g. to tag1, using the values of date1a.
    My current solution has a template for each combination - which is very redundant.
    Any idea how to optimize this without changing the input file? I thought of global variables to store the attribute value but they are "final", so that does not work. Local variables seem to be limited to a single template, so they cannot be used either.
    Any help will be appreciated,
    Ralf

    Hi,
    This is a typical line from the input file:
    <WebAppM3.SingleInfo xmi.id="a71" xmi.uuid="7e33f8b02e0f30f5:00a981ca:000000f425774313:8181" Name="StaticPage" Entity="a67 a66" SubView="a72 a73">
    </WebAppM3.SingleInfo>
    This is a typical transformation rule for it (the relevant rules are for Entity and SubView:
    <xsl:template match="WebAppM3.SingleInfo">
    <!-- Each instance of SingleInfo gets its own class using as much of its old values as
    possible-->
    <Model.Class annotation="" isRoot="false" isLeaf="true" isAbstract="false"
    visibility="public_vis" isSingleton="false">
    <xsl:copy-of select="@xmi.id"/>
    <xsl:copy-of select="xmi.uuid"/>
    <xsl:attribute name="name">
    <xsl:value-of select="@Name"/>
    </xsl:attribute>
    <Model.Namespace.contents>
    <xsl:apply-templates select="descendant::WebAppM3.M2Attribute"/>
    <xsl:apply-templates select="attribute::Entity" mode="link"/>
    <xsl:apply-templates select="attribute::SubView" mode="link"/>
    </Model.Namespace.contents>
    </Model.Class>
    </xsl:template>
    <xsl:template match="@Entity" mode="link">
    <!-- References to the new Associations of type DBConnection -->
    <xsl:variable name="data" select="stringhelp:tokenize(.)"/>
    <xsl:variable name="anc_id" select="ancestor::WebAppM3.SingleInfo/@xmi.id"/>
    <xsl:variable name="targets" select="../WebAppM3.DataSet"/>
    <xsl:for-each select="$data/token">
    <Model.Reference annotation="" scope="instance_level"
    visibility="public_vis" type="a23" isChangeable="true">
    <xsl:attribute name="name">Entity_<xsl:value-of select="."/></xsl:attribute>
    <xsl:attribute name="xmi.id">
    <xsl:value-of select="$anc_id"/>_<xsl:value-of select="."/>
    </xsl:attribute>
    <xsl:attribute name="xmi.uuid">
    <xsl:value-of select="$anc_id"/>_<xsl:value-of select="."/>
    </xsl:attribute>
    <xsl:attribute name="referencedEnd">
    TEST
    </xsl:attribute>
    <Model.StructuralFeature.multiplicity>
    <Model.MultiplicityType lower="0" upper="-1" is_ordered="false" is_unique="false" />
    </Model.StructuralFeature.multiplicity>
    </Model.Reference>
    </xsl:for-each>
    </xsl:template>
    <xsl:template match="@SubView" mode="link">
    <!-- References to the new Associations of type DBConnection -->
    <xsl:variable name="data" select="stringhelp:tokenize(.)"/>
    <xsl:variable name="anc_id" select="ancestor::WebAppM3.SingleInfo/@xmi.id"/>
    <xsl:variable name="targets" select="../WebAppM3.DataSet"/>
    <xsl:for-each select="$data/token">
    <Model.Reference annotation="" scope="instance_level"
    visibility="public_vis" type="a23" isChangeable="true">
    <xsl:attribute name="name">Entity_<xsl:value-of select="."/></xsl:attribute>
    <xsl:attribute name="xmi.id">
    <xsl:value-of select="$anc_id"/>_<xsl:value-of select="."/>
    </xsl:attribute>
    <xsl:attribute name="xmi.uuid">
    <xsl:value-of select="$anc_id"/>_<xsl:value-of select="."/>
    </xsl:attribute>
    <xsl:attribute name="referencedEnd">
    TEST
    </xsl:attribute>
    <Model.StructuralFeature.multiplicity>
    <Model.MultiplicityType lower="0" upper="-1" is_ordered="false" is_unique="false" />
    </Model.StructuralFeature.multiplicity>
    </Model.Reference>
    </xsl:for-each>
    </xsl:template>
    Cheers,
    Ralf

  • Transforming XML/XSLT : CDATA problem

    Hi!
    I have a problem transforming xml with XSLT using the API javax.xml.
    The result is correct until I have a CDATA section in my xml document.
    The transforming process encodes all the & < > (special characters) it finds in.
    This occurs problem for the follow of my treatement because the content of my CDATA is already encoded.
    For example, this xml code :
    <?xml version='1.0' encoding="ISO-8859-1" ?>
    <article>
    <article-contenu><![CDATA[Accent : &eacute; Signe : &lt;]]></article-contenu>
    </article>
    produces in my output :
    Accent : &amp;eacute; Signe : &amp;lt;
    This is my java code :
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xmlSource = new StreamSource(readerXml);
    Source xslSource = new StreamSource( fileXsl );
    // Generate the transformer.
    Transformer transformer = tFactory.newTransformer(xslSource);
    // Perform the transformation, sending the output to the response.
    transformer.transform(xmlSource, new javax.xml.transform.stream.StreamResult(sw));
    How can I tell the transformer not to do that?
    Thanks for your answers!

    I am having a similar problem. I have enclosed my text data in my xml file like this:
    <![CDATA[<b>Hello World!</b>]]>
    My select statement in my XSLT sheet is as follows:
    <xsl:value-of select="." disable-output-escaping="yes"/>
    I have tried setting xsl:output to text, to html, and to xml. The <, >, and & get converted to xhtml entities.
    Where should I begin to troubleshoot? If the Xalan xslt jars? My stylesheet. My xml doc? Java code?
    Any feedback welcome.

  • XSLT Cache problem including remote host stylesheets

    Hi.
    We are building an XSL page that includes changing named templates through xsl:includes where the included stylesheet is on a remote server.
    The content of the remote stylesheet can change at any time. The problem is that the Oracle XSLT caching mecanism does not "see" this, so we get the old page..
    How can we turn the caching off? Is it possible to turn caching off for selected stylesheets?
    Any clues or pointers?
    Regards
    Lionel

    Hi.
    We are building an XSL page that includes changing named templates through xsl:includes where the included stylesheet is on a remote server.
    The content of the remote stylesheet can change at any time. The problem is that the Oracle XSLT caching mecanism does not "see" this, so we get the old page..
    How can we turn the caching off? Is it possible to turn caching off for selected stylesheets?
    Any clues or pointers?
    Regards
    Lionel

  • Java object XSLT parameters problem. JDK vs Xalan.

    Hello all,
    I need to create a small application which requires to run some transformation interacting with a number of Java classes.
    Small example is below: I have a Java class, which I'm going to use within transformation.
    package com.example;
    public class Document
      private String filename=null;
      public String getFilename() {
        return this.filename;
    }and transformation which extracts some information from the passed parameter object
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:document="com.example.Document">
        <xsl:param name="theDocument"/>
        <xsl:template match="/">
            <example>
                <xsl:value-of select="document:getFilename($theDocument)"/>
            </example>
        </xsl:template>
    </xsl:stylesheet>The code which launches transformation is following:
            try {
                TransformerFactory factory = TransformerFactory.newInstance();
                Templates template = factory.newTemplates(new StreamSource(new FileInputStream(transformationFilename)));
                Source source = new StreamSource(new FileInputStream(theSourceFilename));
                Result result = new StreamResult(new FileOutputStream(theTargetFilename));
                Transformer transformer = template.newTransformer();
                transformer.setParameter("theDocument", theDocument);
                transformer.transform(source, result);
            } catch (TransformerConfigurationException e) {
                e.printStackTrace();
            } catch (FileNotFoundException e) {
                e.printStackTrace();
        }When I run it I get
    ERROR:  'Cannot find external method 'com.example.Document.getFilename' (must be public).'
    FATAL ERROR:  'Could not compile stylesheet'at this line
      Templates template = factory.newTemplates(new StreamSource(new FileInputStream(transformationFilename)));I made a test with a variable, when Document instance is not a parameter but an instance created within transformation and assigned to an XSLT variable. Everything works fine in variable case, but not with parameter.
    Once I've added Xalan-2.7.1 .jars to the classpath it had been fixed. I guess the issue is described here (yep, I'm using 1.5).
    XSLTC does not support all the extensions that Xalan does. These extensions are beyond the definition of the JAXP and XSLT specifications. For those users impacted by this, the work around of downloading the Xalan classes from Apache is still available. Also, going forward we expect to be supporting more and more extensions in XSLTC.
    However, I'd like to find Xalan free solution. Could someone explain what is the difference and how implement the same behaviour without using Xalan?
    Thank you in advance.

    georgemc, your answer may not have helped the original poster, but it just helped me out. So, thank you very much.
    To clarify, for the benefit of anyone else who encounters this issue, it looks as if a possible cause of the 'Cannot find external method' error is that the transformer is defaulting to something - possibly XSLTC - that does not support certain extension methods. Ensuring that a recent Xalan JAR is in the classpath may resolve the problem.
    Edited by: slamci on Mar 13, 2010 11:14 AM

  • Xslt transform problem on Sun AS 8PE

    Hi,
    I have following xslt:
    <xsl:call-template name="CustomerFilter">
    <xsl:with-param name="custFilterPath" select="CustomerFilter"/>
    </xsl:call-template>
    <xsl:template name="CustomerFilter">
         <xsl:param name="custFilterPath"/>
         <xsl:text>Customer filter: </xsl:text>
         <strong>
              <xsl:value-of select="$custFilterPath/Type/text()"/> - <xsl:value-of select="$custFilterPath/Name/text()"/>
         </strong>
    </xsl:template>
    I have following xml :
    <CustomerFilter id="0" idDb="0">
    <Name>All</Name>
    <Type>All</Type>
    </CustomerFilter>
    I perform a server xml-xslt tranform to html using xalan 2.5.2 on tomcat5.0.x server with following code without any errors:
    TransformerFactory tf = TransformerFactory.newInstance();
    tf.setURIResolver(new ServerURIResolver(server_url));
    Transformer t = tf.newTransformer(new StreamSource(stylesheet));
    t.setOutputProperty(OutputKeys.INDENT, indenting);
    t.setOutputProperty(OutputKeys.ENCODING, encoding);
    t.setParameter("server_url", server_url);
    t.transform(new DOMSource(response_doc), new StreamResult(response_stream));
    But when I deployed the code on Sun App Server Update1 I get following error:
    [#|2004-10-25T11:54:48.757+0200|SEVERE|sun-appserver-pe8.0.0_01|javax.enterp
    rise.system.container.web|_ThreadID=13;|StandardWrapperValve[xmlgate]:
    Servlet.service() for servlet xmlgate threw exception
    javax.xml.transform.TransformerException: java.lang.RuntimeException:
    Invalid conversion from 'reference' to 'java.lang.String'.
    at
    org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:6
    44)
    at
    org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:3
    17)
    at
    the last line of sample code
    This code ran without any problems on Sun AS 7 (with Xalan 2.3.1_01).
    I don't know why it's not working. Can anybody help me?
    Thank you,
    Miro

    Actually Xalan version shipped with AS 8.0 is Xalan 2.5.2 + bugfixes. So it is possible that slightly different version might have gone into Tomcat but i am not sure here.
    So it would be good to know, how are you making sure that the same Xalan version is used with AS 8.0 or Tomcat ?
    Best Regards

  • XSLT Tranformation problem - empty output lines

    Hi experts,
    I have a following problem with the XSLT transformation.
      FIELD-SYMBOLS: <tab> TYPE table,
                     <line> TYPE ANY,
                     <tabz> TYPE ANY TABLE. 
      CREATE DATA a_table LIKE i_table.
      ASSIGN a_table->* TO <tabz>.
      GET REFERENCE OF <tabz> INTO g_xml_l-value.
      g_xml_l-name = a_templid.
      APPEND g_xml_l TO g_xml_t.
      TRY.
          CALL TRANSFORMATION z_ddu_xslt_test
          SOURCE XML g_tab_cal                            "OK file was loaded
          RESULT (g_xml_t).                                     "Seems to be ok, but I am not sure if g_xml_l was referenced OK
        CATCH cx_root INTO a_rif_ex.
          a_text = a_rif_ex->get_text( ).
          MESSAGE a_text TYPE 'E'.
      ENDTRY.
    Result is, that <tabz> have a two (correct) empty lines, but of course the data should be filled ...
    When I replace <tabz> to some kind of simple structured table, result is like above ...
    Thanks for help.

    Problem solved.
    There was internal problem with the I_TABLE structure.
    Regards.
    Edited by: Daniel Duras on Jul 15, 2010 3:34 PM

  • XSLT Mapping: Problem in appending xmlns attribute

    Hi
    This is my source message
    <?xml version="1.0" encoding="UTF-8"?>
    <soap-env:Envelope xmlns:soap-env= "http://schemas.xmlsoap.org/soap/envelope/">
    <soap-env:Body>
    <OrderID xmlns="http://dummyvalue">12345</OrderID>
    </soap-env:Body>
    My XSLT mapping
    <?xml version='1.0' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
    <xsl:template match="/">
    <soap-env:Envelope>
    <soap-env:Body>
    <OrderID>
    <xsl:attribute name = "xmlns" >
    <xsl:value-of select="@xmlns"/>
    </xsl:attribute>
    <xsl:text>12345</xsl:text>
    </OrderID>
    </soap-env:Body>
    </soap-env:Envelope>
    </xsl:template>
    </xsl:stylesheet>
    I am getting the error message as
    ERROR: Description: The value of the 'name' attribute may not be 'xmlns'.
    Please help me how to append xmlns attribute in OrderID element ??

    Hi,
    Use <xsl:element> to create a node in the output and specify the namespace.
    <xsl:element
    name="name"
    namespace="URI"
    use-attribute-sets="namelist">  <!-- Content:template --></xsl:element>
    Thanks,
    Beena.

  • XSLT mapping problem with CDATA

    Hi
    This is my input message
    <?xml version="1.0"?>
    <root>
    <![CDATA[[<a>test</a>]]]>
    </root>
    My XSL
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:template match='node()|@*'>
    <xsl:copy>
    <xsl:apply-templates select='node()|@*'/>
    </xsl:copy>
    </xsl:template>
    </xsl:stylesheet>
    Output
    <?xml version="1.0" encoding="UTF-16"?><root>&lt;a&gt;test&lt;/a&gt;</root>
    My Desired Output
    <a>test</a>
    Please give me the solution
    Gabriel
    Edited by: Gabriel Sagaya Selvam on Jul 24, 2008 1:29 AM

    Hi
    please look at this
    http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/XSLT/Q_22907544.html
    But i cant get the result

  • XSLT performance problem

    Hi, I have an Oracle 81746 database and xdk92040 installed.
    I use the following procedure to create HTML from an XML clob (this is based on the xslsample provided in the documentation of oracle XML for PL/SQL):
    procedure BUILD_HTML(p_xml_inhoud in clob,
    p_inhoud out clob) is
    p xmlparser.Parser;
    xmldoc xmldom.DOMDocument;
    xmldocnode xmldom.DOMNode;
    proc xslprocessor.Processor;
    ss xslprocessor.Stylesheet;
    xsldoc xmldom.DOMDocument;
    docfrag xmldom.DOMDocumentFragment;
    docfragnode xmldom.DOMNode;
    xslelem xmldom.DOMElement;
    nspace varchar2(50);
    xslcmds xmldom.DOMNodeList;
    begin
    -- new parser
    p := xmlparser.newParser;
    -- set some characteristics
    xmlparser.setValidationMode(p, FALSE);
    xmlparser.setPreserveWhiteSpace(p, TRUE);
    -- parse xml file
    xmlparser.parseClob(p,p_xml_inhoud);
    xmldoc := xmlparser.getDocument(p);
    -- parse xsl file
    xmlparser.parse(p, 'f:\temp\ps2.xsl');
    -- get document
    xsldoc := xmlparser.getDocument(p);
    xslelem := xmldom.getDocumentElement(xsldoc);
    nspace := xmldom.getNamespace(xslelem);
    ss := xslprocessor.newStylesheet(xsldoc,'f:\temp\ps2.xsl');
    -- process xsl
    proc := xslprocessor.newProcessor;
    xslprocessor.showWarnings(proc, true);
    dbms_lob.createtemporary(p_inhoud,false);
    xslprocessor.processXSL(proc,ss,xmldoc,p_inhoud);
    -- Free XML Documents
    xmldom.freeDocument(xmldoc);
    xmldom.freeDocument(xsldoc);
    -- Free XSL Stylesheet and Processor
    xslprocessor.freeProcessor(proc);
    xslprocessor.freeStylesheet(ss);
    -- Free the xmlparser
    xmlparser.freeParser(p);
    end;
    Now, the input file is small :
    <?xml version = '1.0' encoding = 'ISO-8859-1'?>
    <ROWSET>
    <ROW num="1">
    <PS_ID>10422</PS_ID>
    <DN_REF_FAMILIENAAM>zzzzzzzz</DN_REF_FAMILIENAAM>
    <DN_REF_VOORNAAM>zzz</DN_REF_VOORNAAM>
    <GESLACHT>m</GESLACHT>
    <PS_NAMEN>
    <PS_NAMEN_ROW num="1">
    <NAAM>zzzzzzzz</NAAM>
    <NAAMSOORT>familienaam</NAAMSOORT>
    <SORTEERNR>10</SORTEERNR>
    </PS_NAMEN_ROW>
    <PS_NAMEN_ROW num="2">
    <NAAM>zzz</NAAM>
    <NAAMSOORT>ee
    rste voornaam</NAAMSOORT>
    <SORTEERNR>31</SORTEERNR>
    </PS_NAMEN_ROW>
    </PS_NAMEN>
    <PS_WOONPLAATSEN/>
    <RL_PS_PS/>
    <PS_TITELS/>
    <BIOGRAFIE></BIOGRAFIE>
    <PROFIEL></PROFIEL>
    <PS_ONDERWIJS/>
    <P
    S_DIPLOMAS/>
    <PS_TALEN/>
    <PS_BEROEPEN/>
    <PS_ERETEKENS/>
    <RL_OR_PS/>
    <PS_POL_MANDATEN/>
    <PS_POL_FUNCTIES_T/>
    <RL_PS_PB/>
    <BRONNEN></BRONNEN>
    <PERSOONLIJK_AE/>
    <PS_FAM/>
    <RL_PS_AE/>
    <WE
    RKEN/>
    <BIBLIOGRAFIE/>
    <PS_TREFWOORDEN>
    <PS_TREFWOORDEN_ROW num="1">
    <PS_CLUSTERTREFWOORDEN/>
    <PS_GROEPSTREFWOORDEN/>
    <PS_SPECIFICATIETREFWOORDEN/>
    </PS_TREFWOORDEN_ROW>
    </PS_TREFWOOR
    DEN>
    <PS_GEO_TREFWOORDEN/>
    <PS_BIJLAGEN/>
    <OPMERKINGEN>Syrië Jordanië</OPMERKINGEN>
    <PS_AUTEURS/>
    <LAATSTE_WIJZIGING>2003-01-15 17:08:14</LAATSTE_WIJZIGING>
    </ROW>
    </ROWSET>
    The XSLT file is rather big, so I don't included it here.
    The time that the statements in my BUILD_HTML procedure take, are as follows:
    xmlparser.parseClob(p,p_xml_inhoud); 0,3 sec
    xmlparser.parse(p, 'f:\temp\ps2.xsl'); 0,83 sec
    newStylesheet 0,42 sec
    processXSL 0,12 sec
    So the big bottleneck in the system are
    xmlparser.parse(p, 'f:\temp\ps2.xsl');
    and
    newStylesheet 42
    What should I do to make this more performant?
    If there is no other way : is there another Oracle-solution which I can use to transform XML to HTML?

    The performance really depends on how you write the XSL.

Maybe you are looking for

  • Error in User defined function for jdbc lookup

    I am getting th error as follows "Method TestJDBCAPI$ with 2 arguments not found in class com.sap.xi.tf._JLU_MM_" when i a m testing in message mapping

  • Native signing not supported on mac!!

    To sign both the installer and its executable we're using Thawte and Comodo certificates. For MacOS we've Thawte and Apple. This following command builds a proper signed installer version (along with its executable .exe) with the combination of both

  • Production order quantity changes

    Hi Guru's,               Please help me to trace the production order changes. for example: order 1 = 100 and later I changed to 200 how can i trace it.please explain the steps to follow. Thanks Satya

  • Next log sequence

    The archive log list gives the following output: SQL> archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination f:\ora9i\oradata\db01\archive Oldest online log sequence 26 Next log sequence to archive 28 Current l

  • Wireless networking fails after AirPort Extreme Update 2007-003

    I have just tried installing AirPort Extreme Update 2007-003 on a MacBook Pro and wireless networking, which used to work, now no longer works. My wireless network consists of the MBP and a Thomson Speedtouch 585 ADSL modem/router. The symptom is tha