Unable to convert BLOB to XML using XMLTYPE

Hello (XML) Experts
I need your help with manipulating a BLOB column containing XML data - I am encountering the following error:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00200: could not convert from encoding UTF-8 to WINDOWS-1252
Error at line 1
ORA-06512: at "SYS.XMLTYPE", line 283
I am on Windows 7 64 bit, Oracle 11.2.0.3 64 bit and database character set is WE8MSWIN1252, NLS_LANG is set to AMERICAN_AMERICA.AL32UTF8. The BLOB column contains the following XML data:
<?xml version="1.0" encoding="utf-8"?>
<Root CRC="-4065505">
  <Header Converted="0">
    <Version Type="String" Value="512" />
    <Revision Type="String" Value="29" />
    <SunSystemsVersion Type="String" Value="" />
    <Date Type="String" Value="20080724" />
    <Time Type="String" Value="165953" />
    <DAG Type="String" Value="" />
    <ChkID Type="String" Value="" />
    <FormType Type="String" Value="1" />
    <DB Type="String" Value="AllBusinessUnits" />
    <FuncID Type="String" Value="SOE" />
    <Status Type="String" Value="" />
    <FileType Type="String" Value="SFL" />
    <Descriptions>
      <Default Type="String" Value="Sales Order Entry" />
      <L01 Type="String" Value="Sales Order Entry" />
      <L33 Type="String" Value="Saisie commande client" />
      <L34 Type="String" Value="Entrada de órdenes de venta" />
      <L39 Type="String" Value="Inserimento ordine di vendita" />
      <L49 Type="String" Value="Aufträge erfassen" />
      <L55 Type="String" Value="Entrada de pedido de venda" />
      <L81 Type="String" Value="å?—注オーダー入力" />
      <L86 Type="String" Value="销售订å?•å½•å…¥" />
      <L87 Type="String" Value="銷售訂單錄入" />
    </Descriptions>
  </Header>
<FormDesignerAppVer Type="String" Value="5.1" SFLOnly="1" />
</Root>I am using the XMLTYPE constructor and passing in the BLOB column and the character set id of the XML data stored in the BLOB column in order to extract and update a node in the XML as follows:
select xmltype(srce_form_detail,873) from SRCE_FORM where 873 above corresponds to the utf-8 encoding of the XML data in the BLOB column i.e. AL32UTF8, but this results in the above error.
I have also tried converting the BLOB to a CLOB first as below where BLOB2CLOB is a function that converts the BLOB to a CLOB:
select xmltype(BLOB2CLOB(srce_form_detail)).EXTRACT('/Root/Header/DB').getStringVal() XMLSrc  from SRCE_FORM;This results in the following error:
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00210: expected '<' instead of '¿'
Error at line 1
ORA-06512: at "SYS.XMLTYPE", line 272
ORA-06512: at line 1
Looking at the XML in the BLOB I noticed that it contains a BOM(byte order mark) and this is causing the XML parsing to fail and I don't know how to deal with it and I don't want to simply SUBSTR it out.
What I am trying to achieve is to extract the contents of the DB node in the XML and depending on its value I need to update the 'Value' part of that node. I am stuck at the point of extracting the contents of the DB node.
I hope I have provided enough information and I would appreciate any suggestions on how best to resolve this - my XML knowledge is very limited so I would appreciate any help.
Regards,
Mohinder

Hi Marc
Thanks for your response.
You are correct that the blob contains Japanese and Chinese characters but I was expecting that using the XMLTYPE constructor would convert the character set albeit with some data loss or then not display the Chinese and Japanese characters correctly.
It seems to me that XMLTYPE is not handling/interpreting the BOM contained in the BLOB since even converting the BLOB to CLOB is resulting in an error. If I use SUBSTR and ignore the BOM to extract the XML from the BLOB then it works and as expected the Chinese and Japanese characters are not displayed correctly, they are displayed as '¿' corresponding to the lines beginning with L81, L86 & L87 , see below:
select xmltype(SUBSTR(BLOB2CLOB(srce_form_detail),4)) from SRCE_FORM
<?xml version="1.0" encoding="utf-8"?>
<Root CRC="-4065505">
  <Header Converted="0">
    <Version Type="String" Value="512" />
    <Revision Type="String" Value="29" />
    <SunSystemsVersion Type="String" Value="" />
    <Date Type="String" Value="20080724" />
    <Time Type="String" Value="165953" />
    <DAG Type="String" Value="" />
    <ChkID Type="String" Value="" />
    <FormType Type="String" Value="1" />
    <DB Type="String" Value="AllBusinessUnits" />
    <FuncID Type="String" Value="SOE" />
    <Status Type="String" Value="" />
    <FileType Type="String" Value="SFL" />
    <Descriptions>
      <Default Type="String" Value="Sales Order Entry" />
      <L01 Type="String" Value="Sales Order Entry" />
      <L33 Type="String" Value="Saisie commande client" />
      <L34 Type="String" Value="Entrada de ¿¿rdenes de venta" />
      <L39 Type="String" Value="Inserimento ordine di vendita" />
      <L49 Type="String" Value="Auftr¿¿ge erfassen" />
      <L55 Type="String" Value="Entrada de pedido de venda" />
      <L81 Type="String" Value="¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿" />
      <L86 Type="String" Value="¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿" />
      <L87 Type="String" Value="¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿" />
    </Descriptions>
  </Header>Can you please let me know how I can extract the binary dump of the BLOB and post it on the forum as I don't know how to do this. Below is snippet of the hexadecimal dump, that includes the BOM. I can post the full hexadecimal dump if this can help you to reproduce the error ?
EFBBBF3C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D227574662D38223F3E0D0A3C526F6F74204352433D222D34303635353035223E0D0A20203C48656164657220436F6E7665727465643D2230223E0D0A202020203C56657273696F6E20547970653D22537472696E67222056616C75653D2235313222202F3E0D0A202020203C5265766973696F6E20547970653D22537472696E67222056616C75653D22323922202F3E0D0A202020203C53756E53797374656D7356657273696F6E20547970653D22537472696E67222056616C75653D2222202F3E0D0A202020203C4461746520547970653D22537472696E67222056616C75653D22323030383037323422202F3E0D0A202020203C54696D6520547970653D22537472696E67222056616C75653D2231363539353322202F3E0D0A202020203C44414720547970653D22537472696E67222056616C75653D2222202F3E0D0A202020203C43686B494420547970653D22537472696E67222056616C75653D2222202F3E0D0A202020203C466F726D5479706520547970653D22537472696E67222056616C75653D223122202F3E0D0A202020203C444220547970653D22537472696E67222056616C75653D22416C6C427573696E657373556E69747322202F3E0D0A202020203C46756E63494420547970653D22537472696E67222056616C75653D22534F4522202F3E0D0A202020203C53746174757320547970653D22537472696E67222056616C75653D2222202F3E0D0A202020203C46696C655479706520547970653D22537472696E67222056616C75653D2253464C22202F3E0D0A202020203C4465736372697074696F6E733E0D0A2020202020203C44656661756C7420547970653D22537472696E67222056616C75653D2253616C6573204F7264657220456E74727922202F3E0D0A2020202020203C4C303120547970653D22537472696E67222056616C75653D2253616C6573204F7264657220456E74727922202F3E0D0A2020202020203C4C333320547970653D22537472696E67222056616C75653D2253616973696520636F6D6D616E646520636C69656E7422202F3E0D0A2020202020203C4C333420547970653D22537472696E67222056616C75653D22456E747261646120646520C3B37264656E65732064652076656E746122202F3E0D0A2020202020203C4C333920547970653D22537472696E67222056616C75653D22496E736572696D656E746F206F7264696E652064692076656E6469746122202F3E0D0A2020202020203C4C343920547970653D22537472696E67222056616C75653D224175667472C3A4676520657266617373656E22202F3E0D0A2020202020203C4C353520547970653D22537472696E67222056616C75653D22456E74726164612064652070656469646F2064652076656E646122202F3E0D0A2020202020203C4C383120547970653D22537472696E67222056616C75653D22E58F97E6B3A8E382AAE383BCE38380E383BCE585A5E58A9B22202F3E0D0A2020202020203C4C383620547970653D22537472696E67222056616C75653D22E99480E594AEE8AEA2E58D95E5BD95E585A522202F3E0D0A2020202020203C4C383720547970653D22537472696E67222056616C75653D22E98AB7E594AEE8A882E596AEE98C84E585A522202F3E0D0A202020203C2F4465736372697074696F6E733E0D0A20203C2F4865616465723E0D0A20203C466F726D3E0D0A202020203C4372656174696F6E4C616E6720547970653D22537472696E67222056616C75653D223031222053464C4F6E6C793D223122202F3E0D0A202020203C416374696F6E733E0D0A2020202020203C5065726D697373696F6E73202F3E0D0A202020203C2F416374696F6E733E0D0A202020203C48656C70202F3E0D0A202020203C466F6E743E0D0A2020202020203C446566466F6E7453697A6520547970653D22496E7465676572222056616C75653D2238222053464C4F6E6C793D223122202F3E0D0A2020202020203C466F6E743E0D0A20202020202020203C4C616E677561676520547970653D22537472696E67222056616C75653D2244656661756C7422202F3E0D0A20202020202020203C466F6E744E616D6520547970653D22537472696E67222056616C75653D224D532053616E7320536572696622202F3E0D0A2020202020203C2F466F6E743E0D0A2020202020203C466F6E743E0D0A20202020202020203C4C616E677561676520547970653D22537472696E67222056616C75653D22383122202F3E0D0A20202020202020203C466F6E744E616D6520547970653D22537472696E67222056616C75653D224D5320554920476F7468696322202F3E0D0A2020202020203C2F466F6E743E0D0A202020203C2F466F6E743E0D0A202020203C436F6E74726F6C733E0D0A2020202020203C436F6E74726F6C3E0D0A20202020202020203C436F6E74726F6C5479706520547970653D22496E746567657222204644496E743D2231222056616C75653D223122202F3E0D0A20202020202020203C446973706C61795479706520547970653D22537472696E6722204644496E743D2230222056616C75653D22466F726D2057696E646F77222053464C4F6E6C793D223122202F3E0D0A20202020202020203C43617074696F6E20547970653D22537472696E6722204644496E743D2230222056616C75653D2253597C3F7C55547C3F7C3F3F3F3F3F3F22202F3E0DThe XML I posted so far is actually truncated as the full XML is quite big but I showed the beginning of it as this is the section I believe that is not being handled properly. Furthermore I am able to write the BLOB out to a file successfully without any errors using DBMS_LOB & UTL_FILE.PUT_RAW and this seems to handle the BOM without any issues but what I really need to do is read a single node in the XML and update it directly preferably using XMLTYPE directly with the BLOB.
I would welcome your suggestions on how best to read a single node and update it when the XML is contained in a BLOB.
Regards,
Mohinder

Similar Messages

  • How to convert to ' ' in xml using xsl.

    Hi all,
    I have a string downloaded which has the following string
    String= text1 <I> text2 </I&it;
    I have italics tag in my xml file. But my browser does not identifies italics. So i decided to comment out italics tag in my xml using xsl
    So what i need is
    String = text1 <!--I-->text2<!--I-->
    basically to comment out italics tag alone.
    How can i replace <I> to <!--I-->?
    Is there any way in xsl to do the above in a string?
    or
    Any other ways where i can just remove <I> in my out xml file using xsl?
    Thanks in advance.
    Menaga.

    Hi,
    The ultimate solution would be that you also install also a cocoon server (http://cocoon.apache.org/), but that might be overkill.
    Have a look at /people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp for detailed info on creating PDF from BSP.
    If you want to use XSL(-FO), you might have a look at things like http://alt-soft.com/products_xml2pdf.jsp to be called as external command.
    Eddy

  • Extracting data from XML using xmltype and extract

    Hello all,
    I want to write a pl/sql functions that takes a clob as an input and return a some data extracted from the data passed into it.
    the input will be an xml similar to the following:
    <FIXML xsi:schemaLocation="http://www.finacle.com/fixml executeFinacleScript.xsd" xmlns="http://www.finacle.com/fixml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <Header>
            <ResponseHeader>
                <RequestMessageKey>
                    <RequestUUID>IVR201306180841060310000000000000000</RequestUUID>
                    <ServiceRequestId>executeFinacleScript</ServiceRequestId>
                    <ServiceRequestVersion>10.3</ServiceRequestVersion>
                    <ChannelId>IVR</ChannelId>
                </RequestMessageKey>
                <ResponseMessageInfo>
                    <BankId>01</BankId>
                    <TimeZone></TimeZone>
                    <MessageDateTime>2013-06-18T05:36:55.918</MessageDateTime>
                </ResponseMessageInfo>
                <UBUSTransaction>
                    <Id/>
                    <Status/>
                </UBUSTransaction>
                <HostTransaction>
                    <Id/>
                    <Status>SUCCESS</Status>
                </HostTransaction>
                <HostParentTransaction>
                    <Id/>
                    <Status/>
                </HostParentTransaction>
                <CustomInfo/>
            </ResponseHeader>
        </Header>
        <Body>
            <executeFinacleScriptResponse>
                <ExecuteFinacleScriptOutputVO>
                    <executeFinacleScript_customData>
                        <DataCategory>ACC</DataCategory>
                        <New_Data>0001019300101001</New_Data>
                    </executeFinacleScript_customData>
                </ExecuteFinacleScriptOutputVO>
            </executeFinacleScriptResponse>
        </Body>
    </FIXML>'
    I want to extract the value of new_data.
    I wrote the following anonymous block to test the code :
    declare
    xparam xmltype;
    v_xpath varchar2(500);
    begin
    xparam:=xmltype('<FIXML xsi:schemaLocation="http://www.finacle.com/fixml executeFinacleScript.xsd"  xmlns="http://www.finacle.com/fixml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <Header>
            <ResponseHeader>
                <RequestMessageKey>
                    <RequestUUID>IVR201306180841060310000000000000000</RequestUUID>
                    <ServiceRequestId>executeFinacleScript</ServiceRequestId>
                    <ServiceRequestVersion>10.3</ServiceRequestVersion>
                    <ChannelId>IVR</ChannelId>
                </RequestMessageKey>
                <ResponseMessageInfo>
                    <BankId>01</BankId>
                    <TimeZone></TimeZone>
                    <MessageDateTime>2013-06-18T05:36:55.918</MessageDateTime>
                </ResponseMessageInfo>
                <UBUSTransaction>
                    <Id/>
                    <Status/>
                </UBUSTransaction>
                <HostTransaction>
                    <Id/>
                    <Status>SUCCESS</Status>
                </HostTransaction>
                <HostParentTransaction>
                    <Id/>
                    <Status/>
                </HostParentTransaction>
                <CustomInfo/>
            </ResponseHeader>
        </Header>
        <Body>
            <executeFinacleScriptResponse>
                <ExecuteFinacleScriptOutputVO>
                    <executeFinacleScript_customData>
                        <DataCategory>ACC</DataCategory>
                        <New_Data>0001019300101001</New_Data>
                    </executeFinacleScript_customData>
                </ExecuteFinacleScriptOutputVO>
            </executeFinacleScriptResponse>
        </Body>
    </FIXML>');
    v_xpath:='//New_Data/text()';-
    dbms_output.put_line(xparam.EXTRACT(v_xpath).GETSTRINGVAL());
    end;
    but I get the following Error:
    dbms_output.put_line(xparam.EXTRACT(v_xpath).GETSTRINGVAL());
    end;
    Error at line 1
    ORA-30625: method dispatch on NULL SELF argument is disallowed
    ORA-06512: at line 46
    the problem is that when I remove : xmlns="http://www.finacle.com/fixml" attribute from the root node the code works correctly.
    of course , I can simply use replace to remove it, but I want to know what is causing the error.
    I am using oracle database 10g

    Let me explain that the issue is not only related to Oracle.
    If you google a bit for default namespace and Xpath you will find many topic.
    Basically when you have an XML having a definition of namespace without a prefix:
    i.e.:
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title>Example XHTML document</title>
      </head>
      <body>
        <p>Sample content</p>
      </body>
    </html>
    this means that all unprefixed elements are belonging to this default namespace.
    In this case an Xpath equal to '//title/text()' will not get anything because it is assuming to find the element title within a null namespace. But title in this case is automatically assigned to the default namespace.
    When you specify a prefix in a namespace then all elements without prefix are associated to namespace NULL. Using a default namespace is causing a lot of headache.
    These links can be giving a clearer picture:
    http://www.edankert.com/defaultnamespaces.html
    Assuming that you have data like this:
    WITH mydata AS
    (   SELECT '
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title>Example XHTML document</title>
      </head>
      <body>
        <p>Sample content</p>
      </body>
    </html>' xmldata FROM DUAL
    SELECT xmltype (xmldata).EXTRACT ('//title/text()').getstringval ()
      FROM mydata;
    This query will not give anything back to you. You will have to specify:
    SELECT xmltype (xmldata).EXTRACT ('//title/text()', 'xmlns="http://www.w3.org/1999/xhtml"').getstringval ()
      FROM mydata;
    Note also that you should be able to get the default namespace when it is specified (without prefix) by using:
    SELECT xmltype(xmldata).getnamespace() from mydata;
    Post your Oracle version to see if it something related to your version. In mine I got this:
    SQL*Plus: Release 11.2.0.1.0 Production on Thu Jun 20 18:32:58 2013
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> WITH mydata AS
      2  (   SELECT '
      3  <html xmlns="http://www.w3.org/1999/xhtml">
      4    <head>
      5      <title>Example XHTML document</title>
      6    </head>
      7    <body>
      8      <p>Sample content</p>
      9    </body>
    10  </html>' xmldata FROM DUAL
    11  )
    12  SELECT xmltype(xmldata).getnamespace() from mydata;
    XMLTYPE(XMLDATA).GETNAMESPACE()
    http://www.w3.org/1999/xhtml
    SQL>
    If this would work, then it would be enough to add the optional additional parameter namespace. In case it is null it will be set as xmlsn="" and it will work anyway:
    Please note that it will work both if the XML has a default namespace or not
    i.e.:
    with default namespace:
    SQL> DECLARE
      2     xparam         XMLTYPE;
      3     v_xpath        VARCHAR2 (500);
      4     v_ns           VARCHAR2 (500);
      5  BEGIN
      6     xparam :=
      7        xmltype ('
      8  <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ns="http://www.w3.org/1999/xhtml" >
      9    <head>
    10      <title>Example XHTML document</title>
    11    </head>
    12    <body>
    13      <p>Sample content</p>
    14    </body>
    15  </html>');
    16     v_xpath := '//title/text()';
    17     v_ns := 'xmlns="' || xparam.getnamespace () || '"';
    18     DBMS_OUTPUT.
    19      put_line (
    20        'Value of title:' || xparam.EXTRACT (v_xpath, v_ns).getstringval ());
    21  END;
    22  /
    Value of title:Example XHTML document
    PL/SQL procedure successfully completed.
    SQL>
    and without default namespace
    SQL> DECLARE
      2     xparam         XMLTYPE;
      3     v_xpath        VARCHAR2 (500);
      4     v_ns           VARCHAR2 (500);
      5  BEGIN
      6     xparam :=
      7        xmltype ('
      8  <html xmlns:ns="http://www.w3.org/1999/xhtml" >
      9    <head>
    10      <title>Example XHTML document</title>
    11    </head>
    12    <body>
    13      <p>Sample content</p>
    14    </body>
    15  </html>');
    16     v_xpath := '//title/text()';
    17     v_ns := 'xmlns="' || xparam.getnamespace () || '"';
    18     DBMS_OUTPUT.
    19      put_line (
    20        'Value of title:' || xparam.EXTRACT (v_xpath, v_ns).getstringval ());
    21  END;
    22  /
    Value of title:Example XHTML document
    PL/SQL procedure successfully completed.
    Regards.
    Al
    Message was edited by: AlbertoFaenza
    IF removed as it is working anyway.

  • IDOC to XML using HTTP

    Hi Friends,
    Is there any possibilities to Convert IDOCs as XML using HTTP Adapter in SAP PI?
    Because in my Scenario i need to send Idocs from ECC to Red Prariie using SAP PI.
    Also is it there any possibilities using FTPS?
    Please help me.
    Thanks.

    Hi PIstarter,
    Sure this is possible. Just treat the IDoc like any other Service Interface that you use in the HTTP Receiver Adapter. You can even use the no-mapping approach if no additional processing is required by PI.
    Hope this helps,
    Greg

  • Convert BLOB from database to XML. - *URGENT*

    Hi,
    I have converted xml data into BLOB object and inserted into database.
    Now when I retrieve the BLOB object,from my DB, using DBadapter, in the invokeOutputVariable, i have the following. This i copied from the 'Flow Trace'
    <Invoke1_GetSourceXML_OutputVariable>
    <part name="GetSourceXMLOutputCollection" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <GetSourceXMLOutputCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/GetSourceXML">
    <GetSourceXMLOutput>
    <INSTANCE_ID>1</INSTANCE_ID>
    *<SOURCE_XML>weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB@78f9a</SOURCE_XML>*
    <TARGET_XML xsi:nil="true"/>
    <ORDER_ID>1</ORDER_ID>
    <TASK_INSTANCE_ID>1</TASK_INSTANCE_ID>
    <ORDER_DATE xsi:nil="true"/>
    <TRANSLATION_TYP_CD xsi:nil="true"/>
    <EBM_ID>1</EBM_ID>
    <STATUS xsi:nil="true"/>
    <STATUS_DETAIL xsi:nil="true"/>
    </GetSourceXMLOutput>
    </GetSourceXMLOutputCollection>
    </part>
    </Invoke1_GetSourceXML_OutputVariable>
    1) Here i want to confirm, whether we l get weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB@78f9a sort of value when we retrieve a BLOB object.
    2) Variable declaration is like below.
    <variable name="binaryXML" type="xsd:string"/>
    <variable name="decodedString" type="xsd:string"/>
    binaryXML - value assignment_
    <assign name="Assign2">
    <copy>
    <from variable="Invoke1_GetSourceXML_OutputVariable"
    part="GetSourceXMLOutputCollection"
    query="/ns2:GetSourceXMLOutputCollection/ns2:GetSourceXMLOutput/ns2:*SOURCE_XML*"/>
    <to variable="binaryXML"/>
    </copy>
    </assign>
    I have written java embedding code for converting this BLOB to  xml as below
    String input = (String)getVariableData("binaryXML");
    try
    /* *** INITIALLY I TRIED LIKE THIS*** */
    //byte[] decodedBytes = Base64Decoder.decode(input.getBytes());
    //String decoded = new String(decodedBytes);
    //setVariableData("decodedString",decoded);
    /* *** MY NEW CODE *** /
    String decoded = Base64Decoder.decode(input);
    setVariableData("decodedString",decoded);
    catch(Exception ex)
    ex.printStackTrace();
    My Doubt
    When I try to write this 'decodedString' to a .txt file, I couldnt find any output there.
    <assign name="Assign3">
    <copy>
    <from variable="decodedString"/>
    <to variable="Invoke2_Write_InputVariable" part="body"
    query="/ns4:Root/ns4:C1"/>
    </copy>
    </assign>
    Regarding the schema for the file to be written, i tried with 'opaque' schema.. I dint work. Later i tried with the schema as below (which is comma delimited)
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    xmlns:tns="http://TargetNamespace.com/WriteToFile"
    targetNamespace="http://TargetNamespace.com/WriteToFile"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    nxsd:version="NXSD"
    nxsd:stream="chars"
    nxsd:encoding="US-ASCII"
    >
    <xsd:element name="Root">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="C1" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy="&quot;" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    Kindly help me in ths regard.
    Thanks,
    Sabarisri. N
    Edited by: Sabarisri N on Jul 22, 2011 2:37 PM

    Read this :
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14252/adx_j_xsu.htm#sthref508

  • Insert XML file into Relational database model without using XMLTYPE tables

    Dear all,
    How can I store a known complex XML file into an existing relational database WITHOUT using xmltypes in the database ?
    I read the article on DBMS_XMLSTORE. DBMS_XMLSTORE indeed partially bridges the gap between XML and RDBMS to a certain extent, namely for simply structured XML (canonical structure) and simple tables.
    However, when the XML structure will become arbitrary and rapidly evolving, surely there must be a way to map XML to a relational model more flexibly.
    We work in a java/Oracle10 environment that receives very large XML documents from an independent data management source. These files comply with an XML schema. That is all we know. Still, all these data must be inserted/updated daily in an existing relational model. Quite an assignment isn't it ?
    The database does and will not contain XMLTYPES, only plain RDBMS tables.
    Are you aware of a framework/product or tool to do what DBMS_XMLSTORE does but with any format of XML file ? If not, I am doomed.
    Constraints : Input via XML files defined by third party
    Storage : relational database model with hundreds of tables and thousands of existing queries that can not be touched. The model must not be altered.
    Target : get this XML into the database on a daily basis via an automated process.
    Cheers.
    Luc.

    Luc,
    your Doomed !
    If you would try something like DBMS_XMLSTORE, you probably would be into serious performance problems in your case, very fast, and it would be very difficult to manage.
    If you would use a little bit of XMLType stuff, you would be able to shred the data into the relational model very fast and controlable. Take it from me, I am one of those old geezers like Mr. Tom Kyte way beyond 40 years (still joking). No seriously. I started out as a classical PL/SQL, Forms Guy that switched after two years to become a "DBA 1.0" and Mr Codd and Mr Date were for years my biggest hero's. I have the utmost respect for Mr. Tom Kyte for all his efforts for bringing the concepts manual into the development world. Just to name some off the names that influenced me. But you will have to work with UNSTRUCTURED data (as Mr Date would call it). 80% of the data out there exists off it. Stuff like XMLTABLE and XML VIEWs bridge the gap between that unstructured world and the relational world. It is very doable to drag and drop an XML file into the XMLDB database into a XMLtype table and or for instance via FTP. From that point on it is in the database. From there you could move into relational tables via XMLTABLE methods or XML Views.
    You could see the described method as a filtering option so XML can be transformed into relational data. If you don't want any XML in your current database, then create an small Oracle database with XML DB installed (if doable 11.1.0.7 regarding the best performance --> all the new fast optimizer stuff etc). Use that database as a staging area that does all the XML shredding for you into relational components and ship the end result via database links and or materialized views or other probably known methodes into your relational database that isn't allowed to have XMLType.
    This way you would keep your realtional Oracle database clean and have the Oracle XML DB staging database do all the filtering and shredding into relational components.
    Throwing the XML DB option out off the window beforehand would be like replacing your Mercedes with a bicycle. With both you will be able to travel the distance from Paris to Rome, but it will take you a hell of lot longer.
    :-)

  • I have a Nikon D600 and D800 and I shoot everything in Raw. I use Photoshop Elements 9 for processing but I have been unable to convert any RAW files to open in PSE. Says unable to parse the file. What does this mean and how do I fix it?

    I have a Nikon D600 and D800 and I shoot everything in Raw. I use Photoshop Elements 9 for processing but I have been unable to convert any RAW files to open in PSE. Says unable to parse the file. What does this mean and how do I fix it?

    Since pse 9 can only use up to camera raw 6.5 and the d600 needs at least 7.3 and the d800 needs at least 6.7, you can use the
    8.6 adobe dng converter to convert those files to dng copies, which then pse 9 should open.
    8.6 dng converter
    windows
    Adobe - Adobe Camera Raw and DNG Converter : For Windows : Adobe DNG Converter 8.6
    mac
    Adobe - Adobe Camera Raw and DNG Converter : For Macintosh : Adobe DNG Converter 8.6
    Note:
    If you have windows xp or vista or mac os x 10.6, then you'll need to use the 8.3 dng converter instead
    windows
    Adobe - Adobe Camera Raw and DNG Converter : For Windows : Adobe DNG Converter 8.3
    mac
    Adobe - Adobe Camera Raw and DNG Converter : For Macintosh : Adobe DNG Converter 8.3
    how to use the dng converter
    Camera Raw: How to use Adobe DNG Converter - YouTube
    more info on supported cameras and camera raw plugins required
    Camera Raw plug-in | Supported cameras
    Camera Raw-compatible Adobe applications

  • Methods in bapi used to convert data into XML

    Methods in bapi used to convert data into XML,
    how to implement those also,
    points will be rewarded
    Thank you,
    Regards,
    Jagrut BharatKumar Shukla

    Hi
    Check this
    http://www.sap-img.com/abap/sample-xml-source-code-for-sap.htm
    https://forums.sdn.sap.com/click.jspa?searchID=2889167&messageID=3406594
    Reward points for useful Answers
    Regards
    Anji

  • Convertion of flat file to XML using DOM

    Hi!
    I need help for convert a flat file to XML using DOM and by taking the validation of a specified DTD. Can any body help me in this regard.
    Bye,
    lat

    first you have to decide how the flat file will map to xml. Will you use attributes or pcdata for your fields, or both? Will there be a hierarchy, or will it be mostly flat?
    Once decided, you'd probably just use a BufferedReader to read the lines one at a time, and generate Dom nodes as appropriate, and stick them in the tree.

  • How to convert blob data into clob using plsql

    hi all,
    I have requirement to convert blob column into clob .
    version details
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE     11.1.0.7.0     Production
    TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production
    DECLARE
       v_blob      temp.blob_column%TYPE;------this is blob data type column contains  (CSV file which is  inserted  from screens)
       v_clob      CLOB; --i want to copy blob column data into this clob
       v_warning   NUMBER;
    BEGIN
       SELECT blob_column
         INTO v_blob
         FROM temp
        WHERE pk = 75000676;
       DBMS_LOB.converttoclob (dest_lob          => v_clob,
                               src_blob          => v_blob,
                               amount            => DBMS_LOB.lobmaxsize,
                               dest_offset       => 1,
                               src_offset        => 1,
                               blob_csid         => 1, -- what  is the use of this parameter
                               lang_context      => 1,
                               warning           => v_warning
       DBMS_OUTPUT.put_line (v_warning);
    EXCEPTION
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.put_line (SQLCODE);
          DBMS_OUTPUT.put_line (SQLERRM);
    END;I am not getting what is the use of blob_csid , lang_context parameters after going the trough the documentation .
    Any help in this regard would be highly appreciated .......
    Thanks
    Edited by: prakash on Feb 5, 2012 11:41 PM

    Post the 4 digit Oracle version.
    Did you read the Doc for DBMS_LOB.CONVERTTOCLOB? - http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_lob.htm
    The function can convert data from one character set to another. If the source data uses a different character set than the target you need to provide the character set id of the source data.
    The blob_csid parameter is where you would provide the value for the source character set.
    If the source and target use the same character set then just pass zero. Your code is passing a one.
    >
    General Notes
    You must specify the character set of the source data in the blob_csid parameter. You can pass a zero value for blob_csid. When you do so, the database assumes that the BLOB contains character data in the same character set as the destination CLOB.
    >
    Same for 'lang_context' - your code is using 1; just use 0. It is an IN OUT
    >
    lang_context
    (IN) Language context, such as shift status, for the current conversion.
    (OUT) The language context at the time when the current conversion is done.
    This information is returned so you can use it for subsequent conversions without losing or misinterpreting any source data. For the very first conversion, or if do not care, use the default value of zero.

  • Using ABAP Web Service tor convert IDoc to XML and transfer to SOAP Server

    Hi all,
    I have a problem to use ABAP Web Service to convert IDoc's to XML and then send them to a SOAP Server.
    Currently we have the following landscape:
    SAP->XI->Archive
    The sap-system (ECC6.0) sends an IDoc to the Exchange Infrastructe. The XI maps the IDoc and converts it to the required XML format, used by the archive. Afterwards, the XML documents are sended to the SOAP Server.
    So I'm trying to replace the Exchange Infrastructure with ABAP Web Service.
    I've read a lot of posts and documents reagarding ABAP Web Serivce, converting IDoc's to XML, RFC and so on, but I'm not able to do the replacement.
    I don't know how to start and which steps are required.
    The required roles and authorizations at the sap-system and the service for soamanager and the Web Service Viewer are available.
    First I thought to create the RFC and partner profiles and then the report to convert IDoc to XML as a BAPI. With this BAPI I supposed to create and define a Web Service. The problem is, I don't know how to trigger the report if the Idoc should be send to the archive.
    Hopefully, someone has an idea or a how-to for me.
    Thanks in advance.
    Regards,
    Christoph
    Edited by: BigTicket on May 12, 2010 9:36 AM

    Hi BigTicket.
    A suggestion to trigger the BAPI / WebService at the IDoc receiving is to use a user exit or enhanced inside the idoc function module. When the idoc arrived to the idoc port the system start the related function module and then your user exit/enhanced in which you invoke your BAPI.
    I hope this help.
    Ciao.
    Nicola

  • How to retrieve data from catsdb table and convert into xml using BAPI

    How to retrieve data from catsdb table and convert into xml using BAPI
    Points will be rewarded,
    Thank you,
    Regards,
    Jagrut BharatKumar Shukla

    Hi,
    This is not your requirment but u can try this :
    CREATE OR REPLACE DIRECTORY text_file AS 'D:\TEXT_FILE\';
    GRANT READ ON DIRECTORY text_file TO fah;
    GRANT WRITE ON DIRECTORY text_file TO fah;
    DROP TABLE load_a;
    CREATE TABLE load_a
    (a1 varchar2(20),
    a2 varchar2(200))
    ORGANIZATION EXTERNAL
    (TYPE ORACLE_LOADER
    DEFAULT DIRECTORY text_file
    ACCESS PARAMETERS
    (FIELDS TERMINATED BY ','
    LOCATION ('data.txt')
    select * from load_a;
    CREATE TABLE A AS select * from load_a;
    SELECT * FROM A
    Regards
    Faheem Latif

  • Unable to convert file to PDF for using in Microsoft Word.

    I purchased Convert file to PDF $19.99.    After several attempts it will not do anything other than  "Converting file to Word using Adobe Export PDF online"   This keeps going up to 20 mins. Still nothing happens. Could anyone help.

    Hi TheaCloneWindsong,
    Do you face this issue with any particular pdf file or any pdf you wish to convert via Export PDF?

  • Problem converting flat file to XML using JMS Adapter

    I need to take an MQSeries message in a flat file format and convert it to XML before processing.  I have configured the modules as described by the screenshot located here:
    http://www.radesix.com/JMSConfig.jpg
    The message is received however it isn't converting to XML.  When I view the payload I get the message indicated by the screenshot located here:
    http://www.radesix.com/JMSError.jpg
    I am new to XI.  Any ideas?

    For simple plain conversion here is a config, which works in our system:
    (left parameter key, right parameter value, module key always the same)
    Transform.Class com.sap.aii.messaging.adapter.Conversion
    TransformContentType text/xml;charset=utf-8
    xml.conversionType SimplePlain2XML
    xml.addHeaderLine 0
    xml.processFieldNames fromConfiguration
    xml.documentName SA02_Identnummer
    xml.documentNamespace urn:mycompany-com:logistics:DFT:HWL
    xml.structureTitle SA02_Identnummer_Satz
    xml.fieldNames Satzart,Identnummer,Status
    xml.fieldFixedLengths 2,10,3
    Be aware, that you must delete all spaces in the config, especially when you copy and paste values.
    For struct. conversion the entries are a little bit more complex.
    Regards
    Stefan

  • Unpredictable problem using XMLTYPE in Oracle 11g?

    We recently upgraded from Oracle 10g to Oracle 11g, which caused some of our stored procedures to start acting funny.
    Our database stores BLOBs containing XML data in a table. We then asynchronously convert these BLOBs into XMLTYPE objects, and use them to perform operations in our database. This logic started failing when we moved to 11g.
    Our original code looked like this:
    PROCEDURE submitTpfdd(shipmentDataId IN VARCHAR2) AS
         shipmentData XMLTYPE;
      csid INTEGER;
      shipmentName VARCHAR(128);
      gk_namespaces VARCHAR(1024) := 'xmlns:a="http://my.app/1.0.0.0"';
    BEGIN
      SELECT NLS_CHARSET_ID('UTF8') INTO csid FROM dual;
      SELECT XMLTYPE(tf.shipmentData, csid)
        INTO shipmentData
        FROM SHIPQ.SHIPMENT_FILE tf
        WHERE tf.shipment_id = shipmentDataId;
      shipmentName := shipmentData.extract('/a:Shipment/shipmentName/text()', gk_namespaces).getStringVal();
      ... (more logic)
    END submitTpfdd;When we switched to 11g, this code started frequently failing with an "unsupported character set" error. It happens about half the time, and it's unpredictable. It will sometimes pass and sometimes fail, even if the same BLOB is being read both times. I haven't been able to reproduce the error with any of XMLTYPE's other constructors.
    Has anybody encountered similar behavior with the XMLTYPE in 11g? Should I submit a tracker?

    I have created a SQL program which can be run independently to reproduce the problem.
    DECLARE namespaces constant VARCHAR2(1024) := 'xmlns:a="http://morton.com/"';
    CURSOR cursor0(reeves XMLTYPE) IS
    SELECT EXTRACT(VALUE(t), 'text()').getstringval() AS
    bullock
    FROM TABLE(xmlsequence(reeves.EXTRACT('/a:hopper', namespaces))) t;
    CURSOR cursor1(reeves XMLTYPE) IS
    SELECT EXTRACT(VALUE(t), 'text()').getstringval() AS
    bullock
    FROM TABLE(xmlsequence(reeves.EXTRACT('/a:hopper', namespaces))) t;
    CURSOR cursor2(reeves XMLTYPE) IS
    SELECT EXTRACT(VALUE(t), 'text()').getstringval() AS
    bullock
    FROM TABLE(xmlsequence(reeves.EXTRACT('/a:hopper', namespaces))) t;
    CURSOR cursor3(reeves XMLTYPE) IS
    SELECT EXTRACT(VALUE(t), 'text()').getstringval() AS
    bullock
    FROM TABLE(xmlsequence(reeves.EXTRACT('/a:hopper', namespaces))) t;
    CURSOR cursor4(reeves XMLTYPE) IS
    SELECT EXTRACT(VALUE(t), 'text()').getstringval() AS
    bullock
    FROM TABLE(xmlsequence(reeves.EXTRACT('/a:hopper', namespaces))) t;
    CURSOR cursor5(reeves XMLTYPE) IS
    SELECT EXTRACT(VALUE(t), 'text()').getstringval() AS
    bullock
    FROM TABLE(xmlsequence(reeves.EXTRACT('/a:hopper', namespaces))) t;
    CURSOR cursor6(reeves XMLTYPE) IS
    SELECT EXTRACT(VALUE(t), 'text()').getstringval() AS
    bullock
    FROM TABLE(xmlsequence(reeves.EXTRACT('/a:hopper', namespaces))) t;
    CURSOR cursor7(reeves XMLTYPE) IS
    SELECT EXTRACT(VALUE(t), 'text()').getstringval() AS
    bullock
    FROM TABLE(xmlsequence(reeves.EXTRACT('/a:hopper', namespaces))) t;
    CURSOR cursor8(reeves XMLTYPE) IS
    SELECT EXTRACT(VALUE(t), 'text()').getstringval() AS
    bullock
    FROM TABLE(xmlsequence(reeves.EXTRACT('/a:hopper', namespaces))) t;
    CURSOR cursor9(reeves XMLTYPE) IS
    SELECT EXTRACT(VALUE(t), 'text()').getstringval() AS
    bullock
    FROM TABLE(xmlsequence(reeves.EXTRACT('/a:hopper', namespaces))) t;
    xml_clob CLOB := empty_clob;
    xml_blob BLOB := empty_blob;
    xml_varchar VARCHAR2(4000);
    xml_xmltype XMLTYPE;
    warning INTEGER;
    dest_offset INTEGER := 1;
    src_offset INTEGER := 1;
    lang_context INTEGER := 0;
    char_set INTEGER := nls_charset_id('UTF8');
    BEGIN
      dbms_lob.createtemporary(xml_clob, TRUE);
      dbms_lob.createtemporary(xml_blob, TRUE);
      dbms_lob.OPEN(xml_clob, dbms_lob.lob_readwrite);
      dbms_lob.OPEN(xml_blob, dbms_lob.lob_readwrite);
      xml_varchar := '<a:hopper xmlns:a="http://morton.com"/>';
      dbms_lob.writeappend(xml_clob, length(xml_varchar), xml_varchar);
      dbms_lob.converttoblob(xml_blob, xml_clob, dbms_lob.lobmaxsize, dest_offset, src_offset, char_set, lang_context, warning);
      xml_xmltype := XMLTYPE(xml_blob, char_set);
      FOR daniels IN cursor0(xml_xmltype)
      LOOP
        CONTINUE;
      END LOOP;
      FOR daniels IN cursor1(xml_xmltype)
      LOOP
        CONTINUE;
      END LOOP;
      FOR daniels IN cursor2(xml_xmltype)
      LOOP
        CONTINUE;
      END LOOP;
      FOR daniels IN cursor3(xml_xmltype)
      LOOP
        CONTINUE;
      END LOOP;
      FOR daniels IN cursor4(xml_xmltype)
      LOOP
        CONTINUE;
      END LOOP;
      FOR daniels IN cursor5(xml_xmltype)
      LOOP
        CONTINUE;
      END LOOP;
      FOR daniels IN cursor6(xml_xmltype)
      LOOP
        CONTINUE;
      END LOOP;
      FOR daniels IN cursor7(xml_xmltype)
      LOOP
        CONTINUE;
      END LOOP;
      FOR daniels IN cursor8(xml_xmltype)
      LOOP
        CONTINUE;
      END LOOP;
      FOR daniels IN cursor9(xml_xmltype)
      LOOP
        CONTINUE;
      END LOOP;
    END;If someone else could run this program and verify that it acts unpredictably, that would be helpful. I have submitted a metalink tracker but the person who is working the tracker is not able to duplicate the same behavior.

Maybe you are looking for