Xml data formatting

Hi everybody!
I'm trying to output some xml data using this query:
select xmlelement("Sectie",
     os1(s.cods, trim(s.den),
     cast ( multiset(
          select p.codp, p.den, p.pret
          from produse p, vanzari v
          where p.codp = v.codp and v.cods=s.cods
          ) as list_produse
     )as "xml"
     from sectii s
     where s.cods =1;
However, the result is not formatted:
<Sectie><OS1><CODS>1</CODS><DEN>Sectia 1 </DEN><PROD_VANDUTE><OP1><CODP>3</CODP><DEN>Prod.3 </DEN><PRET>300</PRET></OP1><OP1><CODP>5</CODP><DEN>Pr
od.5 </DEN><PRET>100</PRET></OP1><OP1><CODP>7</CODP><DEN>Prod.7 </DEN><PRET>350</PRET></OP1></PROD_VANDUTE></OS1></Sectie>
Is there an easy way to make this xml more human readable?
Like:
<Sectie>
<OS1>
<CODS>1</CODS>
etc.

SQL> with t as (
  2             select xmltype('<Sectie><OS1><CODS>1</CODS><DEN>Sectia 1 </DEN><PROD_VANDUTE><OP1><CODP>3</CODP><DEN>Prod.3 </DEN><PRET>300</PRET></OP1><OP1><CODP>5</CODP>
  3  <DEN>Prod.5 </DEN><PRET>100</PRET></OP1><OP1><CODP>7</CODP><DEN>Prod.7 </DEN><PRET>350</PRET></OP1></PROD_VANDUTE></OS1></Sectie>') "Sectie" from dual
  4            )
  5  select  "Sectie"
  6    from  t
  7  /
Sectie
<Sectie><OS1><CODS>1</CODS><DEN>Sectia 1 </DEN><PROD_VANDUTE><OP1><CODP>3</CODP><DEN>Prod.3 </DEN><PRET>300</PRET></OP1><OP1><CODP>5</CODP>
<DEN>Prod.5 </DEN><PRET>100</PRET></OP1><OP1><CODP>7</CODP><DEN>Prod.7 </DEN><PRET>350</PRET></OP1></PROD_VANDUTE></OS1></Sectie>
SQL> with t as (
  2             select xmltype('<Sectie><OS1><CODS>1</CODS><DEN>Sectia 1 </DEN><PROD_VANDUTE><OP1><CODP>3</CODP><DEN>Prod.3 </DEN><PRET>300</PRET></OP1><OP1><CODP>5</CODP>
  3  <DEN>Prod.5 </DEN><PRET>100</PRET></OP1><OP1><CODP>7</CODP><DEN>Prod.7 </DEN><PRET>350</PRET></OP1></PROD_VANDUTE></OS1></Sectie>') "Sectie" from dual
  4            )
  5  select  xmlserialize(document "Sectie" as clob indent size=2)
  6    from  t
  7  /
XMLSERIALIZE(DOCUMENT"SECTIE"ASCLOBINDENTSIZE=2)
<Sectie>
  <OS1>
    <CODS>1</CODS>
    <DEN>Sectia 1 </DEN>
    <PROD_VANDUTE>
      <OP1>
        <CODP>3</CODP>
        <DEN>Prod.3 </DEN>
        <PRET>300</PRET>
      </OP1>
      <OP1>
XMLSERIALIZE(DOCUMENT"SECTIE"ASCLOBINDENTSIZE=2)
        <CODP>5</CODP>
        <DEN>Prod.5 </DEN>
        <PRET>100</PRET>
      </OP1>
      <OP1>
        <CODP>7</CODP>
        <DEN>Prod.7 </DEN>
        <PRET>350</PRET>
      </OP1>
    </PROD_VANDUTE>
  </OS1>
XMLSERIALIZE(DOCUMENT"SECTIE"ASCLOBINDENTSIZE=2)
</Sectie>
SQL> SY.

Similar Messages

  • CPM error: Graphic: Invalid XML data format

    Hi guru's
    When I execute a cockpit the system shows the error: "Graphic: Invalid XML data format"
    We have BI 7.0 and SEM-BW 600 SAPKGS6014
    What can I do.
    Thanks
    Jose

    Hi guru's
    I still with the problem, I found a  Note 768114 - Message 'Invalid XML format' if chart should be displayed. the note decribe my proble exactly. But the correction in the note are only until version 400 of SEM any our company is in 600.
    With this clue, maybe you can help me.
    Jose

  • DeleteXml() causing xml data format error in database

    Hi, guys,
      I'm using the oracle  xml db 11g in my website application. Last week I found that using the deletexml() to delete a node in the xml may cause a terrible problem that the rest data in the database had wrong xml format. I wonder is it a bug when using binary xml storage.
      My xml data is describe below,
    <root>
         <nodes>
              <node id="1">
                   <name>John</name>
                   <age>16</age>
                   <hobby>football</hobby>
              </node>
              <node id="2">
                   <name>Alex</name>
                   <age>22</age>
                   <hobby>table tenisl</hobby>
             </node>
         <nodes>
    </root>
      I using deletexml() to delete just a node once time,
    "update projects set object_value=deletexml(object_value, '/root/nodes/node[@id="1"]')"
    Usually it successes and the rest data is as excepted, but sometime, I find that after deleting a node, any query in the database except "select * from projects" gets null. And the rest data has wrong format like below,
    <root>
         <nodes>
              <node id="1">
                   <name>John</name>
                   <age>/hobby>
              </node>
              <node id="2">
                   <name>Alex</name>
                   <age>22</age>
                   <hobby>table tenisl</hobby>
             </node>
         <nodes>
    </root>
    Just one format error causes the whole xml data valueless, but it seems that in most time the deletexml() works well, does anyone knows what happens?
    Thanks a lot.

    KnightOfBlueArmor wrote:
    The better idea is to use XMLPatch() if you can.
    XMLPatch?
    Do you use it yourself on a regular basis?
    Personally, I find it fun to use but the performance doesn't match my expectations (no piecewise update/streaming eval AFAIK).
    Message was edited by: odie_63

  • Infopath 2013/REST Web Service - XML Data format

    I've created an Infopath 2013 form and connected it to an existing REST Web Service. The form connects successfully, but I can't get to the nodes that contain the actual data. The REST results look like this:
    <wddxPacket version='1.0'>
    <header/>
    <data>
    <struct>
    <var name='MIDDLENAME'><string>S</string></var>
    <var name='FIRSTNAME'><string>John</string></var>
    <var name='UID'><string>jdoe</string></var>
    <var name='EMAIL'><string>[email protected]</string></var>
    <var name='DEPARTMENT'><string>IT ADMINISTRATION</string></var>
    <var name='TITLE'><string>Director</string></var>
    <var name='LASTNAME'><string>Doe</string></var>
    </struct>
    </data>
    </wddxPacket>
    When I connect to the web service in InfoPath, here is what I see:
    Notice that when we expand the tree, it only shows the "struct" node. How do I get down to the actual data fields?
    Thanks in advance.
    cflbasser

    Hi cflbasser ,
    According to your description, my understanding is that you want to query data using rest web service in InfoPath 2013.
    For achieving your demand, please refer to the blog:
    http://johnliu.net/blog/2012/4/26/infopath-2010-query-using-the-rest-interface.html
    http://sharepointlessons.blogspot.com/2013/09/infopath-and-sharepoint-web-services.html
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How i can transfer XML data from internet to SAP R/3?

    Hi all,
    I have an issue to catch data from internet (perticular website) in xml format and i want to update that xml data format into SAP R/3 database. so how i can do that?
    Can I do directly or i should use any third party tools?

    Hi Deepak,
        Refer these two weblogs,
    /people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
    /people/jin.shin/blog/2007/05/21/handling-web-service-soap-fault-responses-in-sap-netweaver-xi
    I hope, this will solve your problem
    Regards,
    Deviprasad

  • XML Publisher to Excel Report : Date format problem

    Hi,
    I am trying to create an Excel report with XML Publisher. I have an issue with the Date Fomatting.
    In the XML template, I have set the "Date" column in date format. But the excel output report "Date" column returns as "General text" (string) and it is sorted as text, not as date.
    Can anyone please help me out?
    Thanks!!!

    Hi,
    Did this post solve your problem? I have the same issue that I need to solve.
    I have an xsl-fo template with dates in it.
    The dates are in english.
    My excel is setup to use danish.
    When I export to excel it knows the month jan, feb, mar, apr, ... which are the same in danish and english.
    But months where it differs like may (danish maj) the cell is a general text instead of date.
    Is there anyway you can set/transform the date in the xsl-fo template so it does not care about the language in excel?
    Thank you in advance.
    BR Kenneth

  • Date format in XML conversion

    Hello,
    I am using oracle8i. The date format is not giving the proper date values in XML conversion..
    create table test(dt date);
    insert into test values(sysdate);
    insert into test values(sysdate);
    insert into test values(sysdate);
    TEST.WORLD> select * from test;
    DT
    28-NOV-04
    28-NOV-04
    28-NOV-04
    set autoprint on
    set long 100000
    set linesize 100000
    set longchunksize 100000
    var g_clob clob
    declare
    l_ctx dbms_xmlquery.ctxType;
    l_clob clob;
    begin
    l_ctx := dbms_xmlquery.newContext('select dt from test');
    dbms_lob.createtemporary(:g_clob,true,dbms_lob.session);
    dbms_xmlquery.setdateformat(l_ctx,'yyyy-mm-dd');
    :g_clob := dbms_xmlquery.getXml(l_ctx);
    end;
    Here is the output . It is dispalying the 03 For the month november.
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <DT>2004-03-28</DT>
    </ROW>
    <ROW num="2">
    <DT>2004-03-28</DT>
    </ROW>
    <ROW num="3">
    <DT>2004-03-28</DT>
    </ROW>
    </ROWSET>

    When you call DBMS_XMLQUERY.SETDATEFORMAT, you must supply the mask using the syntax defined by java.text.SimpleDateFormat.
    You need to use "yyyy-MM-dd".
    In your case, "yyyy-mm-dd", the lower case "mm" is the mask for minutes.

  • Date format in xml file

    Hi,
    I am relatively new to XML and JSP.I am on a project where i have to transfer data to and from an Oracle 8i database to XML using JSP.everything worked fine except for the follwing:
    the date format in xml is always 'yyyy-mm-dd HH:MM:SS'.
    the datatype is date in oracle and string in jsp.when i try to upload the data in XML to oracle it gives me date format not recognised error.I ve tried using trunc and to_char in the query which fetches records into a recordset in JSP but to no avail.i keep getting the same format.
    Can someone please help with with having the date format as 'dd-mon-yyyy'.
    Thanks a heap for the help
    regards,
    Vinayak

    Hi,
    I ve tried out the solutions suggested by you and tried using java.sql.Timestamp
    as follow:
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="oracle.sql.*" %>
    String dateString = rset.getString("installation_dt");
    java.sql.Timestamp date = new java.sql.Timestamp.valueOf(dateString);
    But tomcat throws up the following error
    :104:
    cannot resolve symbol
    symbol : class valueOf
    location: class java.sql.Timestamp
    java.sql.Timestamp date = new java.sql.Timestamp.valueOf(dateString);
    Hope you can help me.
    Thanks a heap
    Regards,
    Vinayak

  • URGENT: XML-SQL: Error parsing different date formats in the same XML file.

    Hi Everyone,
    I have a big problem while using the XML-SQL utility. I have a XML file with different date formats. I get exception like the one below.
    "oracle.xml.sql.OracleXMLSQLException: 'java.text.ParseException: Unparseable date:"
    And the XML file is :
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Info Key="ID">
         <Insert>
              <ID>1</ID>
              <BookingDate>10.12.2001</BookingDate>
              <OpeningTime>19:16</OpeningTime>
         </Insert>
    </Info>
    I have tried using different setDateFormat which is contrary.
    sav.setDateFormat("d.M.y");
    sav.setDateFormat("H:m:s");
    Can someone help me on the same.
    Thanks in advance.
    Subramanian.

    You might have to describe the columns as varchar then modify the table to the right format.

  • Converting Java.util date to XML date in format YYYY-MMM-dd

    I'm using below code to convert java.util.date to XML date
    public static XMLGregorianCalendar toXMLDate(Date dte) {
       try {
       // this may throw DatatypeConfigurationException
       DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
       GregorianCalendar calendar = new GregorianCalendar();
       // reset all fields
      calendar.clear();
       Calendar parsedCalendar = Calendar.getInstance();
      parsedCalendar.setTime(dte);
      calendar.set( parsedCalendar.get(Calendar.YEAR ),
      parsedCalendar.get(Calendar.MONTH),
      parsedCalendar.get(Calendar.DATE ));
       XMLGregorianCalendar xmlCalendar = datatypeFactory.newXMLGregorianCalendar( calendar );
      xmlCalendar.setTimezone( DatatypeConstants.FIELD_UNDEFINED );
      xmlCalendar.setFractionalSecond( null );
       return xmlCalendar;
    I need to get the date in the format YYYY-MMM-dd, but it returns in a format YYYY-MM-dd. Can anyone tell me how can i change the format? Thanks

    >
    The snippet of ApplicationClient where the assignment took place and the syntax occurred were:
    1. DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    2. DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
    3. Date date = new Date();
    4. CustomerDetail customerDetail = new CustomerDetail();
    5. customerDetail.setCollectionDate(dateFormat.format(date)); //got the above syntax error
    6. customerDetail.setCollectionTime(timeFormat.format(date)); //got the above syntax error
    .....I am running JDK 1.6.0_10, Glassfish v2r2, MySQL 5.0, Netbeans 6.1 on Windows XP platform.The format method returns a String not a Date. Why not just store the Date as is without formatting, and format it when you want to retrieve it from the DB and display it?
    m

  • LabVIEW webservice: How to format the published XML data

    Hi,
    Im trying to  publish some measurement data with LabVIEW webservice and read the data with Android client. However i have some problems with the XML output from the LabVIEW webservice.
    I want to publish the data in in this form:
    <Response>
     -<Terminal>
            <Parameter> Temperature</Parameter>
             <Value> 5 </Value>
            <Unit> ºC </Unit>
           <Description> Measurements from Sensor 1</Description>
       </Terminal>
    </Response>
    Any ideas how i can do this? i havent found any good example on how to format the XML output this way. 

    Hi,
    You can format the data using Format Into String as shown in the attached snippet. Is this maybe something you can use?
    Willy
    Willy
    Attachments:
    format xml data.png ‏31 KB

  • How to convert an xml data(clob) in database to string format in bpel??

    Now I am learning SOA ,I have one scenario which I store the each record  in xml format in database  from file adapter ,extract the xml data and store the data in another  table ...Give me any suggestions which I slove these issue .
    Thanks in advance.

    Hi
    You can try the below xpath function to convert the xml into string - orcl:get-content-as-string(/xsdLocal:SAPOrderRequest)
    To convert the string back to XML - ora:parseEscapedXML(bpws:getVariableData('stringpayloadVar'))
    Regards
    Albin I

  • The file should be in XML-DATA-TEMPLATE format

    Hi,
    When I am trying to upload the Data Definition file in XML publisher with EBS 11.5.10.2, I got "The uploaded file GLPAYBDXDO.xml is invalid. The file should be in XML-DATA-TEMPLATE format". I have tried changing the file name to different names including XML-DATA-TEMPLATE but I could not succeed. I appreciate for any help.
    Thanks,
    Ram.

    What is the content of your xml file. Is this sample xml file or Data Template.

  • Change PaymentAmountText value in XML Data file of Format Payment Instructr

    How to change the value of PaymentAmountText in XML file generated during of IBY_FD_PAYMENT_FORMAT module: Format Payment Instructions?? This XML Data file is being used by the Check Print rtf template.
    The checks will be used for a Singapore$ (S$) Bank account and USD$ Bank account.
    For the S$ check in XML data file :
    <PaymentAmountText>Eighty-Five Dollars And Sixty***********************</PaymentAmountText> for S$85.60
    For the USD$ check in XML data file:
    <PaymentAmountText>Eighty-Five Dollars And Sixty Cents***********************</PaymentAmountText> for USD$85.60
    I have to add 'cents' for the value of the S$ check.
    It looks to me that since it shows for USD and not for SGD, that one can change this in some kind of set up issue. But where and how?? Or can I manipulate this value in the rtf template too??
    Edited by: user1596364 on 24-mei-2012 8:54

    I have solved my problem in following way.
    For example, I would like 'POUNDS' instead of 'DOLLARS'. Currently my check reads 1000 Dollars and 50 cents. It should read 1000 Pounds and 50 pennies
    You need to change the verbiage in the options field for the payment format. (This is the explanation for GUI users.)
    Copy your Format Payment and add some options to it to make the verbiage read Pounds and pennies. Then create a new Payment Format that uses this new Format Payment. Then put this new Payment Format on the Bank Payment Document for the bank account that needs to pay in Irish Pounds.
    1. Define a new Payment Program under System Administrator.
    Navigate to Concurrent -> Program -> Define
    Query up the Evergreen payment program you are using (ex. APXPBFEG).
    2. Click on the 'Copy to' button.
    Enter a value in the 'Program' field type, for example, "Irish Pounds Program".
    Enter a value in the 'Short name' field type, for example, "APXPBIPP".
    3. Edit the Options field in the Executable zone (Do not click the 'Parameters' button.) In the 'Options' field, enter the following 4 options on one line with one blank space between each option:
    P_UNIT_SINGULAR="Pound"
    P_UNIT_PLURAL="Pounds"
    P_SUB_UNIT_SINGULAR="penny"
    P_SUB_UNIT_PLURAL="pennies"
    (For other currencies, replace "Pound" with "Lira", "Peso",etc.)

  • I have a acrobat reader, can I import text delimited data format to a PDF Form so that it can auto fill into forms that was created? If not, what about FDF and XML data

    I have a acrobat reader, can I import text delimited data format to a PDF Form so that it can auto fill into forms that was created? If not, what about FDF and XML data

    Yes, you can do all of that via Tools - Forms - More Form Options - Import Data, if you have Acrobat.
    If you only have the free Reader then you can still do it, but it requires a script.

Maybe you are looking for