Data template creates empty line in output xml when running in application

I converted oracle rdf report to xml, everything is good, except when I run data template it produce xml with empy line after
<?xml version="1.0" encoding="UTF-8"?>
here is unwanted line
<COA_PO_ST>
</COA_PO_ST>

Hi,
it sounds to me like you created an XSD which has a targetNamespace http://xlmns.ekc.nl/caps-dlp, but the actual XML is not using that namespace (no namespace at all, xmlns="").
You can either set the targetNamespace for the schema to "" if that is allowed, or use elementForm is unqualified to make sure implictly defined elements have no namespace in your schema, or use something called an "identity transform" in XSL which will first put the correct namespace on each element before you process it further.

Similar Messages

  • Automatic update of web.xml when running UIX application

    I moved my UIX project from 9.02 to 9.03. The UIX resource files have changed between the versions so I deleted the old cabo folder so that when I ran my applicaton for the first time it would rebuild it. When I ran my application my web.xml file was automatically updated with the following servlet initialisation parameters:
    <init-param>
    <param-name>oracle.cabo.servlet.pageBroker</param-name>
    <param-value>oracle.cabo.servlet.xml.UIXPageBroker</param-value>
    </init-param>
    <init-param>
    <param-name>oracle.cabo.ui.UIExtensions</param-name>
    <param-value>oracle.cabo.data.jbo.ui.JboUIExtension</param-value>
    </init-param>
    The problem is that I've got my own pageBroker already defined in web.xml so when I run my application it used UIXPageBroker instead. This took me a while to find - my app just suddenly stopped working. I don't know what actually updated web.xml but I think it needs to check for the presence of these parameters before inserting them.
    Cheers
    Ian

    Sorry about that Ian, I agree that the code should
    check for the presence of another PageBroker. I'll
    log a bug and bring this up with the development
    team.
    - Jeff

  • Data Template Creating

    Hi Guys ,
    I have created a data template and it worls fine but when i attach a RTF template in oralce apps to it it errors out .. am i missing something ...?
    What are the steps i need to follow in order to register a Data Template with just Data Template Definition i used the follwoing xml file .
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
    <dataTemplate name="EmpData" description="Employee Details" Version="1.0">
    <parameters>
    <parameter name="p_DeptNo" dataType="character" />
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[
    SELECT d.DEPTNO,d.DNAME,d.LOC,EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,
    nvl(COMM,0)
    FROM scott.dept d, scott.emp e
    WHERE d.deptno=e.deptno
    AND d.deptno = nvl(:p_DeptNo,d.deptno)
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_DEPT" source="Q1">
    <element name="DEPT_NUMBER" value="DEPTNO" />
    <element name="DEPT_NAME" value="DNAME" />
    <element name="DEPTSAL" value="G_EMP.SALARY" function="SUM()" />
    <element name="LOCATION" value="LOC" />
    <group name="G_EMP" source="Q1">
    <element name="EMPLOYEE_NUMBER" value="EMPNO" />
    <element name="NAME" value="ENAME" />
    <element name="JOB" value="JOB" />
    <element name="MANAGER" value="MGR" />
    <element name="HIREDATE" value="HIREDATE" />
    <element name="SALARY" value="SAL" />
    </group>
    </group>
    </dataStructure>
    </dataTemplate>
    Thanks
    Tom .....

    This is the error i get
    oracle.apps.xdo.XDOException: Error creating lock file
    at oracle.apps.xdo.oa.util.FontCacheManager.getFontFromDB(FontCacheManager.java:320)
    at oracle.apps.xdo.oa.util.FontCacheManager.getFontFilePath(FontCacheManager.java:198)
    at oracle.apps.xdo.oa.util.FontHelper.createFontProperties(FontHelper.java:431)
    at oracle.apps.xdo.oa.util.ConfigHelper.getFontProperties(ConfigHelper.java:166)
    at oracle.apps.xdo.oa.schema.server.TemplateHelper.runProcessTemplate(TemplateHelper.java:5768)
    at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3438)
    at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3527)
    at oracle.apps.xdo.oa.template.server.TemplatesAMImpl.processTemplate(TemplatesAMImpl.java:2130)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:190)
    at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:153)
    Thanks
    Tom...

  • How oracle standard code to create/write concurrent log/output to $APPLCSF on the application tier server.

    Dear all,
    Could you please let me know how oracle standard code create/write concurrent log/output to $APPLCSF on the application tier server? utl_file ? or any other API?
    Thanks.
    Best & regards,

    APPS.FND_FILE
    PL/SQL APIs for Concurrent Processing
    http://docs.oracle.com/cd/E18727_01/doc.121/e12897/T302934T458258.htm
    PACKAGE: APPS.FND_FILE
    http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_details?c_name=FND_FILE&c_owner=APPS&c_type=PACKAGE&c_detail_type=sou…
    PACKAGE BODY: APPS.FND_FILE
    http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_details?c_name=FND_FILE&c_owner=APPS&c_type=PACKAGE%20BODY&c_detail_t…
    Thanks,
    Hussein

  • Mapping question - how to remove empty recordsets from output XML?

    Hello everyone!
    I have a mapping problem I hope you can help me out with.
    Here is an example of the source message:
    <IDOC>
    .    <HEAD>
    .    </HEAD>
    .    <DET>
    .    .    <Node>
    .    .    .    <nodeA>001</nodeA>
    .    .    .    <nodeB>OA</nodeB>
    .    .    </Node>
    .    .    <Node>
    .    .    .    <nodeB>OB</nodeB>
    .    .    </Node>
    .    .    <Node>
    .    .    .    <nodeA>002</nodeA>
    .    .    .    <nodeB>OC</nodeB>
    .    .    </Node>
    .    </DET>
    </IDOC>
    After testing the above XML in the message mapping, here's what my target looks like:
    <FILE>
    .    .    <Rec>
    .    .    .    <nA>001</nA>
    .    .    .    <nB>OA</nB>
    .    .    </Rec>
    .    .    <Rec>
    .    .    .    <nB>
    .    .    .    <nA>
    .    .    </Rec>
    .    .    <Rec>
    .    .    .    <nA>002</nA>
    .    .    .    <nB>OC</nB>
    .    .    </Rec>
    </FILE>
    "Node" in the "source" message is mapped to "Rec" in my "target" message.
    "Node=" -
    > "Rec"
    You may notice the the "Rec" in the second entry has empty fields. The reason this is so is because I put an "IF" condition in field "nA" and field "nB" that checks whether "nodeA" in the "source" exists/has a value, and if it doesn't, empty values should be given.
    Here's my problem, I need the XML output to be clean. All empty Recs should be removed from the Output XML so that it resembles the one below:
    <FILE>
    .    .    <Rec>
    .    .    .    <nA>001</nA>
    .    .    .    <nB>OA</nB>
    .    .    </Rec>
    .    .    <Rec>
    .    .    .    <nA>002</nA>
    .    .    .    <nB>OC</nB>
    .    .    </Rec>
    </FILE>
    I've tried several ways to get this done to no avail. Would anyone be able to help me out? I would really, really appreciate it!
    Warm regards,
    Glenn

    Hello,
    Here's how the Display Queue looks like from the "CreateIF"
    Default Context:
    0     [false]     [suppress]
    1     [false]     [suppress]
    2     [false]     [suppress]
    3     [true]     []
    4     [false]     [suppress]
    5     [true]     []
    6     [false]     [suppress]
    7     [false]     [suppress]
    8     [false]     [suppress]
    9     [true]     []
    10     [false]     [suppress]
    11     [false]     [suppress]
    12     [false]     [suppress]
    13     [true]     []
    14     [false]     [suppress]
    15     [false]     [suppress]
    16     [false]     [suppress]
    17     [true]     []
    18     [false]     [suppress]
    19     [false]     [suppress]
    20     [false]     [suppress]
    21     [true]     []
    CreateIF Context up one notch:
    0     [false]     [suppress]
    1     [true]     []
    2     [true]     []
    3     [true]     []
    4     [true]     []
    5     [true]     []
    6      [true]     []     
    7     [true]     []
    8     [false]     [suppress]
    9     [false]     [suppress]
    10     [false]     [suppress]
    11     [false]     [suppress]
    Here's how the Display Queue looks like from the "NodeA"
    SUPPRESS     [false]
    SUPPRESS     [false]
    [0000000292]     [false]
    [0000000292]     [true]
    [0000000252]     [false]
    [0000000252]     [true]
    SUPPRESS     [false]
    [0000000078]     [false]
    [0000000078]     [false]
    SUPPRESS     [true]
    [0000000109]     [false]
    [0000000109]     [false]
    SUPPRESS     [false]
    [0000000292]     [true]
    [0000000292]     [false]
    SUPPRESS     [false]
    [0000000076]     [false]
    [0000000076]     [true]
    SUPPRESS     [false]
    [0000000292]     [false]
    [0000000292]     [false]
    SUPPRESS     [true]
    SUPPRESS     [false]
    NodeA context one notch up:
    SUPPRESS     [false]
    [0000000292]     [true]
    [0000000252]     [true]
    [0000000078]     [true]
    [0000000109]     [true]
    [0000000292]     [true]
    [0000000076]     [true]
    [0000000292]     [true]
    [0000000074]     [true]
    [0000000077]     [true]
    [0000000081]     [true]
    [0000000292]     [true]
    [0000000252]     [true]
    [0000000081]     [true]
    [0000000081]     [false]
    SUPPRESS
    Hope that helps you help me!
    Glenn

  • Sql insert statement will fail if the data value has empty line

    Hi,
    I notice if the insert statement in my .sql file contains data that has new line (enter key), the insert will fail.
    For example:
    insert into mytable (message)
    values ('this is the first line
    this is the second line that will cause insert statement to fail
    so as this third line');
    commit;
    How to overcome this?
    Please advise.
    Thank you.
    Message was edited by:
    bchurn
    Message was edited by:
    bchurn

    It did not return me any error. What is the error you are receiving ??
    SQL> create table mytable (message varchar2(500));
    Table created.
    SQL> insert into mytable (message)
      2  values ('this is the first line
      3  this is the second line that will cause insert statement to fail
      4  so as this third line');
    1 row created.
    SQL> @c:\test.txt
    1 row created.contents of c:\test.txt
    <<
    insert into mytable (message)
    values ('this is the first line
    this is the second line that will cause insert statement to fail
    so as this third line');
    >>

  • Empty page in browser after i run my application

    Hi OTN
    When i try to run my application in the browser, it shows an empty page in the browser, i have try to rebuild my application and there's no error, im currently using Build JDEVADF_11.1.1.1.0_GENERIC_090615.0017.5407 studio edition of jdeveloper
    Please help me.
    Thanks and Regards
    Timmie

    Do you see any errors in the log window of JDeveloper?
    If you open your JSF page in the source editor view and look at the file margin on the right, is there any red marks indicating a syntax error?

  • Creating a line break in xml?

    Using dreamweaver cs3 I have created a spry table that is connected to a spry accordian with a detailregion where the accordian shows additional data pulled from a mutual xml file.  Everything works very well.   The problem I have is that some of the text in the xml file is 2 separate paragraphs and I can't find a way to insert a paragraph break in the xml. It all comes out as one paragraph of text.  ugh  I got it to print <p> using escape characters &lt: etc but it would actually print out the <P> and not respond to the html tag.  lol  There must be a way to insert a simple paragraph break but I can't find anything that shows how to do that. Any help would be very much appreciated.
    Thanks
    mrtom

    Thanks very much Donald.  I fear I am a newbie and still a bit confused.  I tried the CDATA solution
    and that ended  up simply printing the html on the accordian page in the same way it did when I used the escape
    characters.  The other solution listed on the page you linked says:
    "To fix this, we have to entity decode the "description" column value  of each row so that when Spry re-generates the spry:region, it inserts  the entity decoded version of the HTML markup. The result of this  pre-processing allows the HTML markup to appear properly:"
    When they say "description" column what are they referring to?  Sounds like they are referring to a database row but my data is from a simple and small hand-written xml file.  I'm not sure what I need to do here?   Thanks for any guidance you might offer.
    Tom

  • How do I create a digital signature to use when filling out applications online?

    The application is asking me to add or create a digital ID to sign and encrypt documents. The certificate that comes with your digital ID is sent to others so that they can verify your signature.
    I have four options: Browse for an existing digital ID file
    Configure a roaming ID for use on this computer
    Create a self-signed digital ID for use with Acrobat
    Look for newly inserted hardware tokens

    Formscentral does not support forms with digital signature workflows. I suggest you see if our Echosign product meets your needs.

  • Can I turn off a output message when running Javascript in a batch?

    I recently wrote a batch script that performs some Javascript while running. It works really well and is saving me a lot of time, but as each file goes through the batch loop, I get a Javascript output warning that reads "The PDF document contains JavaScripts that can cause problems while opeing the PDF". Then I have to hit a button to let it continue.  I'm betting there must be an easy way to turn this message off but I haven't found it yet. Anyone have the answer?

    Change the security settings of Acrobat via Edit - Preferences.

  • Is it possible to use an XML Data Template to create a report in APEX?

    Hi,
    I have created an XML Data Template in BI Publisher passing one parameter and running two queries, then created an RTF Document Template to present the data.
    I can create a nice report in BI Publisher using the two elements. I have used RTF Document Templates to publish reports in APEX but the data comes from a Report region running a single query.
    I would like to run a report based in this kind of XML Data Template, in order to use several children queries related to a parent query. Is it possible to do it in APEX, or you have to use BI Publisher?
    Francisco
    ===========================
    Below is a simple data template definition:
    <dataTemplate name="cotizacion_template" description="Prueba de data template para cotizaciones" dataSourceRef="dbxprts">
         <parameters>
              <parameter name="p_id_cotizacion" dataType="character" defaultValue="1009" include_in_output="true"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="header_query">
                   <![CDATA[select id_cotizacion, fecha_cotizacion, id_clipro from f_cotizaciones where id_cotizacion = :p_id_cotizacion]]>
              </sqlStatement>
              <sqlStatement name="detail_query">
                   <![CDATA[select id_cotizacion as id_cot_child, id_detalle_cotizacion, partida, cantidad, id_producto from f_detalle_cotizaciones where id_cotizacion = :id_cotizacion]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="F_COTIZACIONES" source="header_query">
                   <element name="ID_COTIZACION" value="ID_COTIZACION"/>
                   <element name="ID_CLIPRO" value="ID_CLIPRO"/>
                   <element name="SUMA_CANTIDAD" value="F_DETALLE_COTIZACIONES.CANTIDAD" function="SUM()"/>
                   <group name="F_DETALLE_COTIZACIONES" source="detail_query">
                        <element name="PARTIDA" value="PARTIDA"/>
                        <element name="CANTIDAD" value="CANTIDAD"/>
                        <element name="ID_PRODUCTO" value="ID_PRODUCTO"/>
                   </group>
              </group>
         </dataStructure>
    </dataTemplate>

    Hi,
    I have the similar question. I used data templates in BI Publisher but now I want to use the same data template in Apex to print some reports.
    I tried to some examples but these were only using report queries. I also tried with the Web Service but this didn't work for me either maybe because I didn't
    used it in the right way. When I used the WS I received the binary of the report so the WS worked it was just the how and where to use it that didn't work for me.
    Now this older entry is BUMPED maybe we find a solution for our problem this way.
    regards,
    Steven

  • How to create Data Template for creation of BI Pulisher Report

    Hi,
    I m having all the steps for creation of BI Pulisher report using Data Template, like 1st create Data Template, Add new Data Definition, upload Data Template, Create Concurrent Program and run the request, save o/p and create rtf layout, upload Template and again run Concurrent program to view output.
    All steps are working fine.. but my simple question is every time we need to write code for Data Template i.e. xml file ? is there is tool or something which will create this Data template for us using rdf? or is there any other way ?
    Please guide ..
    Regards,
    Priyanka.

    Hi;
    Please see below note which could be helpful for your issue:
    NOTE:367394.1 - About Oracle XML Publisher Release 5.6.2
    Also see:
    http://www.adivaconsulting.com/adiva-blog/item/5-datatemplate
    http://apps2fusion.com/at/51-ps/262-xml-publisher-and-data-template-sql-query-to-develop-bi-publisher-reports
    http://blogs.oracle.com/xmlpublisher/data_extraction/data_templates/
    Regard
    Helios

  • Data Template using Multiple XML's

    I have a requirement to create a data template with data from multiple XML files and this is dynamic based on user selection.
    Here is an example
    Data Hirerachy
    |-PO Header (POHeader.xml)
    |-----PO Line (POLine.xml)
    |-----PO Receipts (POreciepts.xml)
    Now use can choose to print all children or selectively one child . I can do it by creating 3 data templates and then using the appropriate one based on user selection. I am exploring the possibility to use one single dynamic data template created on the fly and passed to the publisher.
    Appreciate any pointer to achieve this
    Message was edited by:
    skarimis

    Hey
    I think I answered this on the internal forum
    Tim

  • How to remove empty lines from xml files after removing nodes from document

    <pre>
    Hi
    <b>i have xml document, which is shown below
    after removing some nodes from the document ,i am getting empty lines in place of removed nodes,how to resolve this and get the proper xml document without any errors</b>
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE Message SYSTEM "TRD01.dtd">
    <Message>
    <Header>
    <CounterPartyType>CLIENT</CounterPartyType>
    <CreationTime>20134455</CreationTime>
    <ErrorCode>363 </ErrorCode>
    <ErrorEnterPriseId>N</ErrorEnterPriseId>
    <ErrorStatus>1</ErrorStatus>
    <ErrorSystemId>STL</ErrorSystemId>
    <ErrorTimes>31</ErrorTimes>
    <MessageType>T</MessageType>
    <RecipientEnterpriseId>N</RecipientEnterpriseId>
    <RecipentSystemId>EXM</RecipentSystemId>
    <Remarks>REMARSK</Remarks>
    <SenderEnterpriseId>N</SenderEnterpriseId>
    <SenderSystemId>TR</SenderSystemId>
    </Header>
    </Message>
    <ErrorCode>363 </ErrorCode>
    <ErrorEnterPriseId>NIHK</ErrorEnterPriseId>
    <ErrorStatus>1</ErrorStatus>
    <ErrorSystemId>STL</ErrorSystemId>
    <ErrorTimes>31</ErrorTimes>
    XPathExpression expression5 = xpath.compile(xmlpath5);
    Object result5 = expression5.evaluate(doc, XPathConstants.NODE);
    Node node5 = (Node) result5;
    node5.getParentNode().removeChild(node5);
    XPathExpression expression6 = xpath.compile(xmlpath6);
    Object result6 = expression6.evaluate(doc, XPathConstants.NODE);
    Node node6=(Node) result6;
    node6.getParentNode().removeChild(node6);
    XPathExpression expression7 = xpath.compile(xmlpath7);
    Object result7 = expression7.evaluate(doc, XPathConstants.NODE);
    Node node7=(Node) result7;
    node7.getParentNode().removeChild(node7);
    doc.normalize();
    doc.normalizeDocument();
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer();
    t.setOutputProperty(OutputKeys.INDENT, "yes");
    t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
    t.setOutputProperty(OutputKeys.METHOD,"xml");
    t.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
    the xml output i am getting is
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <Message>
    <Header>
    <CounterPartyType>CLIENT</CounterPartyType>
    <CreationTime>20134455</CreationTime>
    <MessageType>TRD01</MessageType>
    <RecipientEnterpriseId>N</RecipientEnterpriseId>
    <RecipentSystemId>STL</RecipentSystemId>
    <Remarks>REMARSK</Remarks>
    <SenderEnterpriseId>N</SenderEnterpriseId>
    <SenderSystemId>T</SenderSystemId>
    </Header>
    </Message>
    <b>could you please let me know how to avoid empty lines in the xml doucment output</b>
    this is the method i am using to get the result
    public void ValidateRecord(String xml){
    try{
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = factory.newDocumentBuilder();
    //parse file into DOM
    /*DOMParser parser = new DOMParser();
    parser.setErrorStream(System.err);
    parser.setValidationMode(DTD_validation);
    parser.showWarnings(true);*/
    System.out.println ("HI THIS xml is validation "+xml);
    Resolver res = new Resolver();
    db.setEntityResolver(res);
    Document doc = db.parse(new InputSource(new StringReader(xml)));
    XPathFactory xpf = XPathFactory.newInstance();
    XPath xpath = xpf.newXPath();
    // XPathExpression expression = xpath.compile("//A/B[C/E/text()=13]");
    String xmlpath="/Message/Header/CounterPartyType/text()";
    String xmlpath1="/Message/Header/RecipentSystemId/text()";
    String xmlpath2="/Message/Header/ErrorSystemId/text()";
    XPathExpression expression = xpath.compile(xmlpath);
    XPathExpression expression1 = xpath.compile(xmlpath2);
    Object result = expression.evaluate(doc, XPathConstants.NODE);
    Object result1 = expression1.evaluate(doc, XPathConstants.NODE);
    Node node = (Node) result;
    Node node1 = (Node) result1;
    System.out.println("the values of the string is " +node.getNodeValue());
    System.out.println("the values of the string is " +node1.getNodeValue());
    // for (int i = 0; i < nodes.getLength(); i++) {
    //System.out.println(nodes.item(i).getNodeValue());
    // CAHNGING THE RECEIPENT NODE
    XPathExpression expression2 = xpath.compile(xmlpath1);
    Object result2 = expression2.evaluate(doc, XPathConstants.NODE);
    Node node2 = (Node) result2;
    System.out.println(node2);
    node2.setNodeValue(node1.getNodeValue());
    System.out.println(node2);
    //removing the nodes from document
    String xmlpath3="/Message/Header/ErrorCode";
    String xmlpath4="/Message/Header/ErrorEnterPriseId";
    String xmlpath5="/Message/Header/ErrorStatus";
    String xmlpath6="/Message/Header/ErrorSystemId";
    String xmlpath7="/Message/Header/ErrorTimes";
    XPathExpression expression3 = xpath.compile(xmlpath3);
    Object result3 = expression3.evaluate(doc, XPathConstants.NODE);
    Node node3 = (Node) result3;
    node3.getParentNode().removeChild(node3);
    XPathExpression expression4 = xpath.compile(xmlpath4);
    Object result4 = expression4.evaluate(doc, XPathConstants.NODE);
    Node node4 = (Node) result4;
    System.out.println("node value");
    System.out.println(node4.getParentNode().getNodeName());
    node4.getParentNode().removeChild(node4);
    XPathExpression expression5 = xpath.compile(xmlpath5);
    Object result5 = expression5.evaluate(doc, XPathConstants.NODE);
    Node node5 = (Node) result5;
    node5.getParentNode().removeChild(node5);
    XPathExpression expression6 = xpath.compile(xmlpath6);
    Object result6 = expression6.evaluate(doc, XPathConstants.NODE);
    Node node6=(Node) result6;
    node6.getParentNode().removeChild(node6);
    XPathExpression expression7 = xpath.compile(xmlpath7);
    Object result7 = expression7.evaluate(doc, XPathConstants.NODE);
    Node node7=(Node) result7;
    node7.getParentNode().removeChild(node7);
    // Node b13Node = (Node) expression.evaluate(doc, XPathConstants.NODE);
    //b13Node.getParentNode().removeChild(b13Node);
    doc.normalize();
    doc.normalizeDocument();
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer();
    t.setOutputProperty(OutputKeys.INDENT, "yes");
    t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
    t.setOutputProperty(OutputKeys.METHOD,"xml");
    t.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
    t.transform(new DOMSource(doc), new StreamResult(System.out));
    catch (Exception e) {
         e.printStackTrace();
    System.out.println(e.getMessage());
    </pre>
    Edited by: user12185243 on Apr 6, 2013 6:38 AM
    Edited by: user12185243 on Apr 6, 2013 6:41 AM
    Edited by: user12185243 on Apr 6, 2013 6:43 AM
    Edited by: user12185243 on Apr 6, 2013 6:45 AM
    Edited by: user12185243 on Apr 6, 2013 9:00 AM

    either this way we can do this
    1)
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    <b> factory.setIgnoringElementContentWhitespace(true); </b>
    DocumentBuilder db = factory.newDocumentBuilder();
    or
    2)
    java.io.StringWriter sw = new java.io.StringWriter();
    StreamResult sr = new StreamResult(sw);
    t.transform(new DOMSource(doc), sr);
    String xml1 = sw.toString().trim();
    <b> xml1=xml1.replaceAll("\\s",""); </b>
    System.out.println(xml1.trim());

  • Getting error when try to upload xml file into Data Template

    Hi,
    Getting error when try to upload xml file into Data Template.error:"The uploaded file XXSLARPT.xml is invalid. The file should be in XML-DATA-TEMPLATE format."Plz anybody help me.
    Thanks,
    Prasad.

    Hi,
    Anybody Help Plzzzzzz.
    thx,
    Prasad

Maybe you are looking for