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.

Similar Messages

  • 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

  • Inline XML with CDATA problem

    Hi everyone,
    I'm trying to include some JavaScript (JSON 2, to be precise)
    in with some ActionScript 3 classes. I'm using the inline XML
    method (E4X) of declaring the data. It looks like this:
    public static var JSON_2:XML = <data><![CDATA[
    if (!this.JSON) {
    JSON = function () {
    function f(n) {
    return n < 10 ? '0' + n : n;
    Date.prototype.toJSON = function (key) {
    return this.getUTCFullYear() + '-' +
    f(this.getUTCMonth() + 1) + '-' +
    f(this.getUTCDate()) + 'T' +
    f(this.getUTCHours()) + ':' +
    f(this.getUTCMinutes()) + ':' +
    f(this.getUTCSeconds()) + 'Z';
    String.prototype.toJSON =
    Number.prototype.toJSON =
    Boolean.prototype.toJSON = function (key) {
    return this.valueOf();
    var cx = /[\u0000
    ]]></data>
    Actually, this is only about a quarter of what I need to
    include but this is where it breaks down. Right after the second
    slash in the last line, Flash reports:
    TypeError: Error #1091: XML parser failure: Unterminated CDATA
    section.
    In fact, as you can see this is a perfectly valid CDATA
    section and isn't being terminated anywhere (there is no instance
    of "]]>" anywhere in the data). Unfortunately, Flash doesn't
    think so and seems to think that the backslash is an XML node
    directive.
    Does anyone have an idea of how to effectively deal with
    this? The JSON source code has *many* backslashes so not having to
    convert them would be *very* useful.
    Many thanks for all your suggestions,
    Patrick

    I've *kind* of solved the problem...replacing each backslash
    ("\") with a double backslash ("\\"). At least this has removed the
    compiler error. However, this would suggest that the CDATA section
    is actually being interpreted by Flash, which is something it isn't
    supposed to do...or did I misunderstand how this works?

  • Problem with CALL TRANSFORMATION xml - abap

    Hello!
    I got the following problems using call transformation to read a xml-file to local abap datatype!
    Simple xml file for testing:
    <BMECAT>
    <HEADER>
    asdf
    </HEADER>
    </BMECAT>
    XSLT file:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
      <xsl:template match="/">
        <xsl:value-of select="./BMECAT/HEADER"/>
      </xsl:template>
    </xsl:transform>
    The xslt transformation works with xslt-tester!
    My Source:
    DATA: xmlupl TYPE string,
    outputx TYPE XSTRING,
    lv_string TYPE string.
    * in xmlupl my xml import is stored
    CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
    EXPORTING
    text = xmlupl " variable type string
    IMPORTING
    buffer = outputx. " variable type xstring
    TRY .
         CALL TRANSFORMATION path_to_xslt_file
           SOURCE XML outputx
         RESULT HEADER = lv_string.
    CATCH cx_xslt_exception INTO xslt_error.
         data: xslt_message type string .
         xslt_message = xslt_error->get_text( ).
    ENDTRY.
    After debugging in xslt_message is stored the following text:
    "The element abap was expected for the XML-ABAP transformation"
    Can anyone help me with this problem?
    Regards,
    Daniel

    hi
    good
    try this code
    Just look at this piece of code, I think it should help you.
      DATA : ITAB   TYPE TABLE OF SPFLI,
             L_XML  TYPE REF TO CL_XML_DOCUMENT.
      SELECT * FROM SPFLI INTO TABLE ITAB.
    CREATE THE XML OBJECT
      CREATE OBJECT L_XML.
    CONVERT THE DATA TO XML
      CALL METHOD L_XML->CREATE_WITH_DATA( DATAOBJECT = ITAB[] ).
    DATA IS CONVERTED TO XML; DISPLAY THE XML-DOCUMENT
      CALL METHOD L_XML->DISPLAY.
    thanks
    mrutyun^

  • Transforming XML into nested Internal Table via Call Transformation XSLT

    Hi guys!
    I am relatively new to this XML transformation to Abap Internal table. Hence I got help some help from this thread ABAP Development as well as referencing Txn SSTDEMO1 and SSTDEMO2
    But I tried to attempt on my prog it failed. Heres my sample XML, XSLT & as well as Internal Table.
    The good news is I am able to read in a BID item under bidlist BUT with no fields filled in the table.... Pls help....
    <b><u>XML</u></b>
    <?xml version="1.0" encoding="iso-8859-1"?>
    <myXML>
      <BIDLIST>
        <BID>
          <HEADER>
            <DOC_CODE>4000000343</DOC_CODE>
            <RESPONSE_NO>80000003</RESPONSE_NO>
            <RESPONSE_DATE>2006-10-01</RESPONSE_DATE>
            <SUPP_CODE>44</SUPP_CODE>
            <SUPP_SITE_ID>44</SUPP_SITE_ID>
            <SUPP_CONTACT_NAME>JIM BEAN</SUPP_CONTACT_NAME>
           <SUPP_CONTACT_PHONE>+6512345678</SUPP_CONTACT_PHONE>
            <SUPP_CONTACT_EMAIL>[email protected]</SUPP_CONTACT_EMAIL>
            </HEADER>
          </BID>
        </BIDLIST>
    <myXML>
    <u><b>XSLT</b></u>
    <xsl:transform version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:sap="http://www.sap.com/abapxml"
    >
    <xsl:template match="/">
    <asx:abap xmlns:asx="http://www.sap.com/abapxml">
    <asx:values>
        <BID_RESPONSE>
            <xsl:for-each select="myXML/BIDLIST/BID">
            <LBID>
                <xsl:for-each select="HEADER">
                <LHEADER>
                            <DOC_CODE> <xsl:value-of select="DOC_CODE"/> </DOC_CODE>
                            <RESPONSE_NO> <xsl:value-of select="RESPONSE_NO"/> </RESPONSE_NO>
                            <RESPONSE_DATE> <xsl:value-of select="RESPONSE_DATE"/> </RESPONSE_DATE>
                            <SUPP_CODE> <xsl:value-of select="SUPP_CODE"/> </SUPP_CODE>
                            <SUPP_SITE_ID> <xsl:value-of select="SUPP_SITE_ID"/> </SUPP_SITE_ID>
                            <SUPP_CONTACT_NAME> <xsl:value-of select="SUPP_CONTACT_NAME"/> </SUPP_CONTACT_NAME>
                            <SUPP_CONTACT_PHONE> <xsl:value-of select="SUPP_CONTACT_PHONE"/> </SUPP_CONTACT_PHONE>
                            <SUPP_CONTACT_EMAIL> <xsl:value-of select="SUPP_CONTACT_EMAIL"/> </SUPP_CONTACT_EMAIL>
                </LHEADER>
            </xsl:for-each>
            </LBID>
            </xsl:for-each>
        </BID_RESPONSE>
    </asx:values>
    </asx:abap>
    </xsl:template>
    </xsl:transform>
    <u><b>Internal Table</b></u>
    TYPES: BEGIN OF T_HEADER,
            DOC_CODE(17),
            RESPONSE_NO(8),
            RESPONSE_DATE(10),
            SUPP_CODE(16),
            SUPP_SITE_ID(15),
            SUPP_CONTACT_NAME(140),
            SUPP_CONTACT_PHONE(23),
            SUPP_CONTACT_EMAIL(100),
           D_HEADER TYPE T_HEADER OCCURS 0.
    TYPES: BEGIN OF T_BID,
            HEADER TYPE D_HEADER,
           END OF T_BID,
           D_BID TYPE T_BID OCCURS 0.
    TYPES: BEGIN OF T_BIDLIST,
            BID TYPE D_BID,
           END OF T_BIDLIST,
           D_BIDLIST TYPE T_BIDLIST OCCURS 0.
    TYPES: BEGIN OF TYPE_DATA,
            BIDLIST TYPE D_BIDLIST,
           END OF TYPE_DATA.
    DATA: BID_RESPONSE TYPE TABLE OF TYPE_DATA.

    hi
    good
    go through these links, i hope these ll help you to solve your problem.
    http://sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/15ecdf90-0201-0010-d792-941a3c3c30a4
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/d-f/from%20xml%20to%20abap%20data%20structures%20and%20back%20bridging%20the%20gap%20with%20xslt
    thanks
    mrutyun^

  • Help Please ! -- transform XML to HTML using xslt tag in JSP

    Hello,
    I have problem to do XSL transform in JSP.
    I have an XSL : test.xsl
    I have an XML : test.xml
    In JSP I have:
    <x:xslt media="html" xml="test.xml">
    <x:stylesheet media="html" uri="test.xsl" />
    </x:xslt>
    But It doesn't work the way it suppose to. What is wrong in my code ? I followed the URL http://e-docs.bea.com/wls/docs81/xml/xml_apps.html
    Thanks in advance,
    Christina

    Basically:
        try{
          //Setting up parameters.
          xml=new StreamSource(new File(xmlInput));
          xsl=new StreamSource(new File(xslInput));
          baos=new ByteArrayOutputStream();
          htmlResult=new StreamResult(baos);
          //Transform input(xml, xsl) onto html output.
          TransformerFactory tfactory=TransformerFactory.newInstance();
          Transformer transformer=tfactory.newTransformer(xsl);
          transformer.transform(xml, htmlResult);
          baos.writeTo(out);
          //System.err.println(htmlResult.getOutputStream().toString());
        catch(...){
        }I havent tested and I havent use this for a while, but I hope this can serve as a staring point.
    Regards,
    OO

  • Transforming XML Data with XSLT in a servlet

    Trying to transform XML data using XSLT. The following code works fine outside of a servlet. But in a servlet it gives the following error :
    * Transformer Factory error
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Namespace not supported by SAXParser
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Namespace not supported by SAXParser
         at org.apache.xml.utils.DefaultErrorHandler.fatalError(DefaultErrorHandler.java:257)
         at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:813)
         at TransformationApp.XSLTTransformServlet.MyTransform(XSLTTransformServlet.java:79)
         at TransformationApp.XSLTTransformServlet.doGet(XSLTTransformServlet.java:39)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:484)
    Several articles hinted at setting the factory namespace attribute to TRUE. I have tried that but same results. Here is the code :
    static Document document;
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    //factory.setNamespaceAware(true);
    //factory.setValidating(true);
    try {
    File stylesheet = new File(argv[0]);
    File datafile = new File(argv[1]);
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse(datafile);
    // Use a Transformer for output
    TransformerFactory tFactory =
    TransformerFactory.newInstance();
    StreamSource stylesource = new StreamSource(stylesheet);
    Transformer transformer = tFactory.newTransformer(stylesource);
    DOMSource source = new DOMSource(document);
    StreamResult result = new StreamResult(System.out);
    transformer.transform(source, result);
    } catch (TransformerConfigurationException tce) {
    // Error generated by the parser
    System.out.println ("\n** Transformer Factory error");
    System.out.println(" " + tce.getMessage() );
    // Use the contained exception, if any
    Throwable x = tce;
    if (tce.getException() != null)
    x = tce.getException();
    x.printStackTrace();
    } catch (TransformerException te) {
    // Error generated by the parser
    System.out.println ("\n** Transformation error");
    System.out.println(" " + te.getMessage() );
    // Use the contained exception, if any
    Throwable x = te;
    if (te.getException() != null)
    x = te.getException();
    x.printStackTrace();
    } catch (SAXException sxe) {
    // Error generated by this application
    // (or a parser-initialization error)
    Exception x = sxe;
    if (sxe.getException() != null)
    x = sxe.getException();
    x.printStackTrace();
    } catch (ParserConfigurationException pce) {
    // Parser with specified options can't be built
    pce.printStackTrace();
    } catch (IOException ioe) {
    // I/O error
    ioe.printStackTrace();
    Any help would be greatly appreciated.

    I don't know that this is true, but i think the problem is the classpath.
    The runtime has his own parser. This parser is befor your xalan.lib in the classpath and the
    parser from the runntime don't support namespace.
    Try Tomcat 4.
    Regard Dietmar

  • Java Translets XML/XSLT Transformation

    Translets "are precompiled XSL documents that are optimized and converted into simple Java classes. When you compile your application Java files, you compile your XSL files into Java class files. During runtime, you can load translets like any regular Java class and perform XSL transformations over and over again.
    The syntax checking and parsing of XSL documents are done when the XSL files are compiled. The transformation therefore takes only as long as the compiled code takes to execute, which improves performance multiple folds.
    The downside to using XSL is that "it can take a considerable amount of time and reduce performance. The time needed to parse XML and XSL documents is directly proportional to the size of the documents. Each transformation requires the XML and XSL documents to be loaded, syntax checked, and parsed." I recommends using translets for the following reasons.
    I had written an application (<a href="http://www.simplygites.com" title="www.simplygites.com">SimplyGites</a>) using standard XSL / XML transformation and experienced some very slow server-side transformation on the very complex screens with large amounts of xml. Timings showed these problem screens took 2-3 seconds to transform, which was totally unacceptable non-functional requirements.
    I considered rewriting these screens as JSP or PHP, then I discovered Translets. And wow what a discovery the timings for these pages now compiled as Translets(java classes) are amazing in comparison to the original timings ? I now have them transforming in 500ms (all now under 1 second).
    I would recommend anyone using XSL/XML transformation to use Translets, these have now been running tried and tested on the <a href="http://www.simplygites.com" title="www.simplygites.com">SimplyGites</a> for the past 6months.
    Technolgies used:
    Weblogic 8.1 SP5
    Java 1.4.2
    Required Jars
    xsltc.jar
    runtime.jar
    BCEL.jar
    JLex.jar
    java_cup.jar
    regexp.jar
    xml-dtm.jar
    For more information see http://xml.apache.org/xalan-j/xsltc_usage.html
    I hope this helps anyone that has XML/XSLT performance issues.
    Mark
    MB Computer Ltd
    www.simplygites.com

    Thanks for your help.
    The problem was that my firewall was blocking my server.

  • How to display transformed XML in flex? xslt processor w/o javascript?

    I have a tree view with a list of links. upon clicking the links it will display its contents in an iFrame.
    some of the links in my tree are, google.com, yahoo.com, and 2 xml files, 1 of which i have transfromed into html using xsl.
    google, yahoo and the xml file which i have not transformed display successfully in the iFrame. however the xml which i have transformed does not display anything. is there another way to display html in flex? or is there a way to display a transformed xml to html in flex.
    also is there another way to to use an xslt processor in flex without having to use javascript?

    In jsp page set content type to text/xml
    <%@ page contentType="text/xml" %>

  • Problem Transforming XML to JSF tags

    I have a fealing there is something I don't know here,
    I am transforming XML into a JSP that include tags from taglib http://java.sun.com/jsf/html (prefix="h")
    This is an section from my stylesheet
    <xsl:template name="forename">
    <h:inputText>
    <xsl:attribute name="value">#{abyss.myCustomer.forename}</xsl:attribute>
    </h:inputText>
    </xsl:template>
    which transforms my XML to exactly what I expect if a was writting it directly as a jsp
    <h:inputText value="#{abyss.myCustomer.forename}"></h:inputText>
    but it still looks like this after it is rendered in the browser, and not like
    <input type="text" name="dataCapture:j_id_id199" value="Customer Name" />
    which is how it looks if I cut and paste the result of the transformation into a jsp, and run that by itself
    Does anyone have any idea was the <h:inputText does not evaluate the tag in the browser after the transformation ?
    Edited by: OB1 on Nov 23, 2007 1:46 PM
    Edited by: OB1 on Nov 23, 2007 2:43 PM

    Unfortunatly I do, my jsp is
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
    <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml_rt" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <html>
    <c:set value="${abyss.myBusinessServicePath}" var="xmldocpath"></c:set>
    <c:import url="${xmldocpath}" var="xmldoc"/>
    <c:import url="/xsl/transform.xsl" var="xslt"/>
    <x:transform xml="${xmldoc}" xslt="${xslt}"/>
    </html>

  • Problem while creating xml with cdata section

    Hi,
    I am facing problem while creating xml with cdata section in it. I am using Oracle 10.1.0.4.0 I am writing a stored procedure which accepts a set of input parameters and creates a xml document from them. The code snippet is as follows:
    select xmlelement("DOCUMENTS",
    xmlagg
    (xmlelement
    ("DOCUMENT",
    xmlforest
    (m.document_name_txt as "DOCUMENT_NAME_TXT",
    m.document_type_cd as "DOCUMENT_TYPE_CD",
    '<![cdata[' || m.document_clob_data || ']]>' as "DOCUMENT_CLOB_DATA"
    ) from table(cast(msg_clob_data_arr as DOCUMENT_CLOB_TBL))m;
    msg_clob_data_arr is an input parameter to procedure and DOCUMENT_CLOB_TBL is a pl/sql table of an object containing 3 attributes: first 2 being varchar2 and the 3rd one as CLOB. The xml document this query is generating is as follows:
    <DOCUMENTS>
    <DOCUMENT>
    <DOCUMENT_NAME_TXT>TestName</DOCUMENT_NAME_TXT>
    <DOCUMENT_TYPE_CD>BLOB</DOCUMENT_TYPE_CD>
    <DOCUMENT_CLOB_DATA>
    &lt;![cdata[123456789012345678901234567890123456789012]]&gt;
    </DOCUMENT_CLOB_DATA>
    </DOCUMENT>
    </DOCUMENTS>
    The problem is instead of <![cdata[....]]> xmlforest query is encoding everything to give &lt; for cdata tag. How can I overcome this? Please help.

    SQL> create or replace function XMLCDATA_10103 (elementName varchar2,
      2                                             cdataValue varchar2)
      3  return xmltype deterministic
      4  as
      5  begin
      6     return xmltype('<' || elementName || '><![CDATA[' || cdataValue || ']]>
      7  end;
      8  /
    Function created.
    SQL>  select xmlelement
      2         (
      3            "Row",
      4            xmlcdata_10103('Junk','&<>!%$#&%*&$'),
      5            xmlcdata_10103('Name',ENAME),
      6            xmlelement("EMPID", EMPNO)
      7         ).extract('/*')
      8* from emp
    SQL> /
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[SMITH]]></Name>
      <EMPID>7369</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[ALLEN]]></Name>
      <EMPID>7499</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[WARD]]></Name>
      <EMPID>7521</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[JONES]]></Name>
      <EMPID>7566</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[MARTIN]]></Name>
      <EMPID>7654</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[BLAKE]]></Name>
      <EMPID>7698</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[CLARK]]></Name>
      <EMPID>7782</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[SCOTT]]></Name>
      <EMPID>7788</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[KING]]></Name>
      <EMPID>7839</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[TURNER]]></Name>
      <EMPID>7844</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[ADAMS]]></Name>
      <EMPID>7876</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[JAMES]]></Name>
      <EMPID>7900</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[FORD]]></Name>
      <EMPID>7902</EMPID>
    </Row>
    <Row>
      <Junk><![CDATA[&<>!%$#&%*&$]]></Junk>
      <Name><![CDATA[MILLER]]></Name>
      <EMPID>7934</EMPID>
    </Row>
    14 rows selected.
    SQL>

  • Transformation XML problem.

    Hello!
    I have very easy java code for transform XML document (sorry, for print out XML without changes):
    parser = new DOMParser();
    parser.setPreserveWhitespace(false);
    // parser input XML file
    xmlURL = createURL(args[0]);
    parser.parse(xmlURL);
    xml = parser.getDocument();
    // print the transformed document
    xml.print(System.out);
    But if I have DTD in XML then JDK write many errors: SIGBUS 10* bus error
    If XML does not contains DTD then java code work successfuly.
    I use JDK 1.2.2, xmlparserv2 for Sun Solaris

    Try turning off your JIT.
    I've only ever seen core dumps when it was a JIT problem.

  • Problem transforming XML/XSL Using Xalan

    Hi, I am using the xalan apis to transform XML/XSL in a servlet..My servlet code is like...
    response.setContentType("text/html; charset=UTF-8");
    // Output goes in the response stream.
    PrintWriter out = response.getWriter();
    boolean environmentOK = (new org.apache.xalan.xslt.EnvironmentCheck()).checkEnvironment (out);
    try
    TransformerFactory tFactory = TransformerFactory.newInstance();
    // Get the XML input document and the stylesheet.
    Source xmlSource = new StreamSource("D:\\DATA\\jrun\\test\\test.xml");
    Source xslSource = new StreamSource("D:\\DATA\\jrun\\test\\test.xsl");
    // Generate the transformer.
    Transformer transformer = tFactory.newTransformer(xslSource);
    // Perform the transformation, sending the output to the response.
    transformer.transform(xmlSource, new StreamResult(out));
    I am getting the error ..
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Namespace not supported by SAXParserjavax.xml.transform.TransformerConfigurationException
    That's why I have added the line..
    boolean environmentOK = (new org.apache.xalan.xslt.EnvironmentCheck()).checkEnvironment (out);
    But that gives me the following error diagnostic information...
    ERROR.version.DOM=ERROR attempting to load DOM level 2 class: java.lang.NoSuchMethodException
    I have put all the 3 required classes, xml-apis.jar, xercesImpl.jar and xalan.jar in my application servers classpath..
    Please let me know what I am doing wrong..and how this can be fixed.
    Thanks
    Surajit

    hey Surajit
    Your code is unable to create a transformer from a factory instance.
    I would check why it is not creating the Transformer.On my win32 system i usee two forward slashes..to identify the file path
    D://xyz//abc....instead of D:\\...i wonder if thats one reason why your code is not able to create a transformer based on the StreamSource u create for the file paths.
    Code i use..that works
    javax.xml.transform.TransformerFactory tFactory =
                                                                javax.xml.transform.TransformerFactory.newInstance();
                                                      javax.xml.transform.Source xmlSource = new javax.xml.transform.stream.StreamSource                              (xmlInputSource);
                                                 javax.xml.transform.Source xslSource = new javax.xml.transform.stream.StreamSource
                                       (xslInputSource);
                                                                                                        // Generate the transformer.
                                                                javax.xml.transform.Transformer transformer = tFactory.newTransformer(xslSource);
                                                                                                   // Perform the transformation, sending the output to the response.
                                                                transformer.transform(xmlSource,new javax.xml.transform.stream.StreamResult(out));
                                                                                                        I used jaxp-1.2 with tomcat 4.1.12
    Hope that helps.

  • OT:XML/XSLT transformations on iAS6.0 anyone?

    Hi,
    I know this is Off Topic from JATO, but...
    I am trying to come up with a way to process the typical
    transformation of xml & xslt to html.
    For whatever reason I can't seem to get this to work.
    I've tried it by writing my own servlet, but it hangs.
    I've tried to install cocoon, but nothing ever works, and all the
    installation instructions seem to trail off at the most important time
    (like what if the build doesn't create a war file).
    Can someone point to a definitive resource that I can follow for
    something like this which will work on iAS6.0?
    Thanks,
    John Hoskins.

    Yeah, off topic, so I doubt you will get any expert help here. Might try the S1AS 6.x forum.
    sorry

  • Transforming XML source to (X)HTML StreamResult outputs long comment

    Hi,
    I'm using javax.xml.transform.* to transform XML data into an XHTML page. The XML data represents a document (contains information about headers, paragraphs, related pages, etc.) and an XSL file is used to properly transform that data into an XHTML compatible file. All transformations go just as they should, however, the XHTML output contains a very lenthy comment about elements and attributes concerning HTML. Obviously, I do not want this comment in my final output. As a side note: I'm using a StreamSource(File) for the XML data source, a StreamSource(File) for the XSL file and a StreamResult(HttpServletResponse.getOutputStream()) for the HTML output. I'm not sure wether the problem is with using a StreamResult directly (rather than a SAXResult), or because I'm outputting directly to the servlet output stream. All input and output is in UTF-8, and the HttpServletResponse has been configured using setCharacterEncoding("UTF-8") and setContentType("text/html").
    Everything works fine, except I get this stinkin' long comment, which I want gone.
    Thanks,
    Yuthura

    I get the following result.html file (properly transformed and displayed in my browser, except for the comment):
    <!--================== Imported Names ====================================-->
    <!-- media type, as per [RFC2045] -->
    <!-- comma-separated list of media types, as per [RFC2045] -->
    <!-- a character encoding, as per [RFC2045] -->
    <!-- a space separated list of character encodings, as per [RFC2045] -->
    <!-- a language code, as per [RFC3066] -->
    <!-- a single character, as per section 2.2 of [XML] -->
    <!-- one or more digits -->
    <!-- space-separated list of link types -->
    <!-- single or comma-separated list of media descriptors -->
    <!-- a Uniform Resource Identifier, see [RFC2396] -->
    <!-- a space separated list of Uniform Resource Identifiers -->
    <!-- date and time information. ISO date format -->
    <!-- script expression -->
    <!-- style sheet data -->
    <!-- used for titles etc. -->
    <!-- nn for pixels or nn% for percentage length -->
    <!-- pixel, percentage, or relative -->
    <!-- integer representing length in pixels -->
    <!-- these are used for image maps -->
    <!-- comma separated list of lengths -->
    <!--=================== Generic Attributes ===============================-->
    <!-- core attributes common to most elements
    id document-wide unique id
    class space separated list of classes
    style associated style info
    title advisory title/amplification
    -->
    <!-- internationalization attributes
    lang language code (backwards compatible)
    xml:lang language code (as per XML 1.0 spec)
    dir direction for weak/neutral text
    -->
    <!-- attributes for common UI events
    onclick a pointer button was clicked
    ondblclick a pointer button was double clicked
    onmousedown a pointer button was pressed down
    onmouseup a pointer button was released
    onmousemove a pointer was moved onto the element
    onmouseout a pointer was moved away from the element
    onkeypress a key was pressed and released
    onkeydown a key was pressed down
    onkeyup a key was released
    -->
    <!-- attributes for elements that can get the focus
    accesskey accessibility key character
    tabindex position in tabbing order
    onfocus the element got the focus
    onblur the element lost the focus
    -->
    <!--=================== Text Elements ====================================-->
    <!-- these can occur at block or inline level -->
    <!-- these can only occur at block level -->
    <!-- %Inline; covers inline or "text-level" elements -->
    <!--================== Block level elements ==============================-->
    <!-- %Flow; mixes block and inline and is used for list items etc. -->
    <!--================== Content models for exclusions =====================-->
    <!-- a elements use %Inline; excluding a -->
    <!-- pre uses %Inline excluding big, small, sup or sup -->
    <!-- form uses %Block; excluding form -->
    <!-- button uses %Flow; but excludes a, form and form controls -->
    <!--================ Document Structure ==================================-->
    <!-- the namespace URI designates the document profile -->
    <!--================ Document Head =======================================-->
    <!-- content model is %head.misc; combined with a single
    title and an optional base element in any order -->
    <!-- The title element is not considered part of the flow of text.
    It should be displayed, for example as the page header or
    window title. Exactly one title is required per document.
    -->
    <!-- document base URI -->
    <!-- generic metainformation -->
    <!--
    Relationship values can be used in principle:
    a) for document specific toolbars/menus when used
    with the link element in document head e.g.
    start, contents, previous, next, index, end, help
    b) to link to a separate style sheet (rel="stylesheet")
    c) to make a link to a script (rel="script")
    d) by stylesheets to control how collections of
    html nodes are rendered into printed documents
    e) to make a link to a printable version of this document
    e.g. a PostScript or PDF version (rel="alternate" media="print")
    -->
    <!-- style info, which may include CDATA sections -->
    <!-- script statements, which may include CDATA sections -->
    <!-- alternate content container for non script-based rendering -->
    <!--=================== Document Body ====================================-->
    <!-- generic language/style container -->
    <!--=================== Paragraphs =======================================-->
    <!--=================== Headings =========================================-->
    <!--
    There are six levels of headings from h1 (the most important)
    to h6 (the least important).
    --> ... (more to come)

Maybe you are looking for

  • Looking for a specific list of modules included in Oracle Vision demo

    Hi All, I am trying to find out which EBS modules are included when you install Oracle Vision demo db. My client no longer has the Vision db installed and before I reinstall it, I'd like to know what I will get. For example, is GRC included and what

  • Header Partners not flowing into items in SAP CRM order and the same in ERP

    Hi SAP Experts, Our SAP CRM is upgraded from 4.0 to 7.0 version and ECC5.0 to ECC6.0 as well  last year. Initially , when the order is created in SAP CRM , the partners (sold to , ship to , payer and bill to ) are flowing to all items(same as header)

  • Unable to open database in READ ONLY mode

    When trying to open database in READ ONLY MODE it says needs recovery. How ever database opens succesfully in READ WRITE MODE. 1) Startup mount 2) SQL> ALTER DATABASE OPEN READ ONLY; ALTER DATABASE OPEN READ ONLY ERROR at line 1: ORA-16005: database

  • Acrobat X Standard - Post-Installation Serial Number Question

    Is there any way to install Acrobat X Standard in such a way where it will wait to prompt for the serial number when it is launched for the first time, instead of upon installation? I read an earlier post that indicates you can remove the ISX_SERIALN

  • R12 EFT for Germany/ Using Profile ICX:Numeric Characters

    Upgrading to Oracle R12.1.1 HP-UX 2000 Company based in US Hello - We are trying to setup AP EFT (e-Text) payments for Germany. The amount field is being selected from: DocumentPayable[1]/PaymentAmount/Value When we run the process, the EFT file is g