XML context search with escape characters

Hi,
I have a piece of XML in an XMLTYPE column which is context indexed. The xml looks like
<content>
<EndDate/>
<Councillor>Smith John</Councillor>
<Committee>Inspection Leader's Advisory Body </Committee>
<StartDate/>
<LinkType>Committee Link</LinkType>
<Text/>
</content>
My query which escapes the search field between {} is
select xmlType.getStringVal(xmlType.extract(CI.CONTENT_XML,'/content/Committee/text()')) Committee
from CMPS.CM$CONTENT_ITEMS CI
where CONTAINS(content_xml,'{Inspection&a} INPATH(/content/Committee)') > 0
returns the row successfully
However
select xmlType.getStringVal(xmlType.extract(CI.CONTENT_XML,'/content/Committee/text()')) Committee
from CMPS.CM$CONTENT_ITEMS CI
where CONTAINS(content_xml,'{Inspection&am} INPATH(/content/Committee)') > 0
--Note the extra character in between {}
does not return anything.
Can someone tell me if I am escaping the reserved characters correctly?
Is there something that I missed when I created my index i.e
CREATE INDEX CIM_CONTEXT ON
cm$content_items(content_xml) indextype is ctxsys.context;
I am running 9.2.0.4 on RED HAT 3.
Thanks
Joel.

From the text team...
The default section group for XMLType column is path section group.
As for his question, the reason why he gets a hit for the first query:
{Inspection&a} INPATH(/content/Committee), is because {Inspenction&a} is lexed as
a phrase "Inspection a" and a by default is 'a' stop word.
And {Inspection&am} is lexed as a phrase "Inspection am". Since there is no such phrase ("am" is not a stop word), the query does not return the row.
If he tries {Inspection&an}, he will get the row because "an" is again by default a stop word.
The behavior is independent of INPATH operator. He will see the same behavior without INPATH operator:
select * from CMPS.CM$CONTENT_ITEMS CI where CONTAINS(content_xml,'{Inspection&a}') > 0;
select * from CMPS.CM$CONTENT_ITEMS CI where CONTAINS(content_xml,'{Inspection&am}') > 0;
select * from CMPS.CM$CONTENT_ITEMS CI where CONTAINS(content_xml,'{Inspection&an}') > 0;
Note sure I understand it but I hope it helps

Similar Messages

  • Web Logic 10.3 upgrade causes issues with escaped characters in JSP.

    We recently upgraded our application servers from Weblogic 9.2 to Weblogic 10.3 and we are having an issue with escaped characters in a JSP code. Here is an example of what we are seeing:
    var convertedBody1 = document.getElementById('body').value.replace(/\$FIRST_NAME\$/g, firstName);
    This code works in Weblogic 9.2. In Weblogic 10.3 we have to make the following changes:
    var convertedBody1 = document.getElementById('body').value.replace(/\$FIRST_NAME\$/g, firstName);
    Thanks, Tom

    Hi:
    I have resolved the issue with the following in the jspx page.
    Put an
    <jsp:scriptlet>
    response.setContentType(“text/html; charset=UTF-8”);
    </jsp:scriptlet>
    Inside the <f:view> on the jspx file.
    Please refer the link http://www.oracle.com/global/il/support/tip/nlss11061.html for more details. It is helpful.
    Thanks & Regards
    Sridhar Doki

  • Issue with escaping characters and php

    Greetings,
    We are working on a web page using php and Oracle. We have troubles dealing with the diferent escaping characters when inserting/retrieving data (magic quotes is on but adding the backslash doesn't help :( ).
    We would like to know the correct way of dealing with those characters ( ' " / /n ...).
    Thank you in advance,
    Sincerely,
    Oriol Nonell

    Do NOT use addslashes/stripslashes to escape your queries. I use this function to do the escaping:
    function escapeSQL($string, $wildcard=false)
    $result = str_replace("'","''",$string);
    if ($wildcard == true) $result = str_replace("%","%%",$result);
    return $result;
    It basically replaces ' with ''.
    If you set $wildcard to false, then '%' is considered to be an actual '%' (for 'like' expressions). If you set it to true, a % is escaped to %% too.

  • Dealing with escape characters

    I have a command that works if I represent it as "\003"+command+"\r" because my command needs to be preceded by the char 'x03' and tailed by the char 'x0d'. The literals "\003" and "\r" are being converted as I wish into their equivalent byte values.
    If I use Java string variables 'start' and 'end' to hold the values "\003" and "\r" and I issue my command as 'start+command+end', the start and end values are NOT converted into byte values. They remain represented as they are written i.e my string command is preceded by '\003' and ends with '\r'.
    How can I convert escape characters stored in string variable into their byte equivalents?
    David

    Please show us the code, because what you say isn't clear. If the Strings are written as
    String start = "\003";  // etx
    String end = "\r";   //crIt should work.
    Often this sort of thing is easier to do with character variable. eg.
    char start = 3;  // etx
    char end = 13;  // crI also wonder why you are using etx (end of text) as the start of text, the usual choice would be stx=\002. Also, none of this has anything to do with "byte" values, they are characters and take 2 bytes each. Your network code can do that conversion for you after you choose your character set. Is it UTF8, Latin-1, or some other.

  • Creating XML DOM with Escape characters

    I am using DOM to generate xml fie. Setting some chinese character string which is hardcoded for one of node value.
    When i am setting value to xml node i am passing it as "&#x2206;" but DOM automatically converts this string and store into xml file as "&#x2206"
    Because of this i can not show proper chinese characters in PDF. How i can avoid this ? Is it possible to store chinese character as "&#x2206" itself inside xml?
    regards
    Manisha

    When setting the value from java you can use the real unicode character. Assuming with &#2206; you want to write the Unicode-Character at Codepoint 0x2206 you could just use "\u2206" in a java String to encode it. The XML library has to take care of how it's encoded in the final xml file.

  • How to deal with escaping characters?

    Using SQLDeveloper v1.2.0 with Oracle 9i.
    I'm converting a sql script that used to use Jakarta Jelly syntax (xml). I'm replacing it with a pure SQL syntax so I can execute it directly in both SQLDeveloper and SQLPlus. The text in the row data has a bunch of occurrences of special characters that I need to escape somehow, to avoid prompting and other issues.
    I tried replacing strings like "a & b" with "a \& b". My script begins like the following:
    set pagesize 0
    set echo off
    set verify off
    set feed off
    set prompt off
    set head off
    set line 200
    set esc on \
    truncate table <tablename>;
    However, when I run the script, it still prompts me when it finds a string like "... \& ...".
    What can I do to get this to work in SQLDeveloper, and to work in SQLPlus at the same time?

    Actually, the SCAN system variable was obsoleted by DEFINE.
    Ref: http://download.oracle.com/docs/cd/B10501_01/server.920/a90842/apc.htm
    So SET DEFINE OFF would have the same effect without any possible compatibility issues.
    However, that would disable DEFINEs/substitution variables altogether. If, you want to escape specific instances of the DEFINE character (&), you would have to go with your SET ESC[APE] approach.
    Now, the syntax for that is SET ESC[APE] {\|c|ON|OFF}.
    Ref: http://download.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1012530
    So, you'd want to use either...
    set esc on
    ... or...
    set esc /
    ... and not both options (ON as well as /).
    But (and here's where it gets really interesting!) there seems to be a problem in how SQL Developer handles the SET command with the ESCAPE system variable. If you try to set ESCAPE to the same character two times in immediate sequence within the same Worksheet, the whole Worksheet goes berserk and every subsequent SQL statement hrows a SQL Error: ORA-00900: invalid SQL statement!
    I sense a bug!

  • Search with special characters in Internet Sales

    Hi,
    In the Internet Sales application, a user can search for products. When it uses as search query A3+ i only want to have products with A3+ but now it returns all the A3 as well without the plus sign.
    I assume that the + sign has a special meaning but can't seem to find how to influence this.
    In the CatalogQueryAction.class you have the following piece of code:
            IQueryStatement queryStmt = theCatalog.getCatalog().createQueryStatement();
            //queryStmt.setStatementAsString(queryStr);
              queryStmt.setStatementAsString(queryStr, 1, CatalogParameters.maxSearchResults);
            IQuery query = theCatalog.getCatalog().createQuery(queryStmt);
            if (log.isDebugEnabled())
              log.debug("CatalogQueryAction: Query Stmt="+queryStmt.toString());
            itemList = new WebCatItemList(theCatalog, query);
    In the debugger I see that it has A3+ as value for the queryStr variable. Is this something I can influence in the Java code or is this a config file or something in a setting?
    Thanks,
    Lee

    Hi,
    Please try the escape character "\" with the "+" character to include it as part of the query.
    queryString should be: A3\+.
    Another solution could be:
    queryString = "\"A3\"" (this means the string is ""A3"").
    Please try and let me know.
    HTH
    Thanks.
    p256960

  • Excel XML map problem with Greek characters.

    Hi,
    I created a dashboard with XML map connetion. My embeded spreadsheet is linked to an xml file which contains my TOP 50 Customers.
    Customers names are in Greek so my xml Header is like:
    <?xml version="1.0" encoding="ISO-8859-7"?>
    ISO-8859-7 is the Greek encoding for xml.
    After embeding the spreadsheet into the dashboard i add a list component to present my TOP 50 Customers.
    So far so good.
    Then i add a refresh conection button to update my TOP 50 list. In preview mode everythinng works fine. But when i try to update my data by clicking the refresh button my list is updated but the customers names is turned to unidentified characters.
    Is there any encoding problem or this is Xcelsius issue?
    I use Xcelsius 2008 sp3 fp 3.2

    You are right.
    I opened the XML file with notepad and saved it with utf-8 encode, also changed the xml tag to <?xml version="1.0" encoding="UTF-8"?> and it worked fine.
    I map it in Excel Spreadsheet without problems and after refreshing in Xcelsius the characters are diplayed normaly.
    So, correct me if i am wrong, the problem is the file encoding, no the xml encoding.
    Both, file and xml encoding should be UTF-8.
    As i mentioned before my xml files are Crystal Report 2008 reports which are exported as text files with .xml extension, so i have to look for answers in other forum.
    thank you

  • Oracle Apps.XML reports ending with warning when the report output contains

    Hi I have XML reports. When we run these reports as concurrent program through Oracle Apps. window and if the report output contains special characters(like Chineese data) in between of English, then the concurrent program is ending with warning. If we remove special characters then it is working fine or when we run the report query directly from backend it is working fine.
    We are importing this data from legacy system into oracle apps. and we can't control these characters or decode them with some other charactes.
    Can any one guide me how to get the XML report output with special characters.
    Thanks in advance.
    Chandra Babu Lankipalli.

    Hi Hussein,
    The concurrent program is ending with Warning. It is unable to publish output file.
    For the same when we remove special characters and run the program it is completing and generating the
    output. The log fine is as follows when the data file contains special characters.
    Custom Application: Version : UNKNOWN
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    XXFA_AR_WIN_EXCEPTION module: XXFA AR Wintrack Customer Interface Exception Report
    Current system time is 23-MAR-2009 05:33:19
    +-----------------------------
    | Starting concurrent program execution...
    +-----------------------------
    Arguments
    P_CUST_ERRORED='3'
    P_CUST_SUCCESS='0'
    P_CUST_TOTAL='3'
    P_REQUEST_ID='4661283'
    P_USER_NAME='SYSADMIN'
    APPLLCSP Environment Variable set to :
    XML_REPORTS_XENVIRONMENT is :
    /d01/oracle/fadevora/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
    XENVIRONMENT is set to /d01/oracle/fadevora/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
    Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
    American_America.UTF8
    Report Builder: Release 6.0.8.25.0 - Production on Mon Mar 23 05:33:19 2009
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    Enter Username:
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Executing request completion options...
    ------------- 1) PUBLISH -------------
    Beginning post-processing of request 4661284 on node FAHQSNA01SFTD03 at 23-MAR-2009 05:33:20.
    Post-processing of request 4661284 failed at 23-MAR-2009 05:33:21 with the error message:
    One or more post-processing actions failed. Consult the OPP service log for details.
    ------------- 2) PRINT   -------------
    Not printing the output of this request because post-processing failed.
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 23-MAR-2009 05:33:21
    Thanks in advance.
    Chandra

  • Setting escape characters for a MySQL insertion

    Hello all. I'm trying to format an incoming string with escaped characters so I can insert them into a mysql database... a quick rundown would be
    ' replaced with \'
    " replaced with \"
    escaping newline characters with the literal text "\n" (without quotes)
    escaping arriage return characters with the literal text "\r" (without quotes)
    for some reason it's not working out. Here's the method I made to handle it:
      public static String mysqlEncode(String stringToEncode) {
        String returnString = stringToEncode;
        // Replace " with \"
        if (returnString.matches("\\\"")) returnString = returnString.replaceAll("\\\"", "\\\"");
        // Replace ' with \'
        if (returnString.matches("'")) returnString = returnString.replaceAll("'", "\\'");
        // Replace \ with \\
        if (returnString.matches("\\\\")) returnString = returnString.replaceAll("\\\\", "\\\\");
        // Replace newlines with \n
        if (returnString.matches("\\n")) returnString = returnString.replaceAll("\\n", "\\n");
        // Replace carriage returns with \r
        if (returnString.matches("\\r")) returnString = returnString.replaceAll("\\r", "\\r");
        return returnString;
      }and it keeps bombing out , I'm on my 3rd hour at this and it's really starting to irk me...
    questions:
    are my regular expressions formed correctly?
    is that if statement calling the .matches() method necessary?
    Thanks so much for your help.

    String sql = "SELECT * FROM MyTable WHERE author = ? AND text = ?";
    PreparedStatement pstm = connection.prepareStatement(sql);
    synchronized(pstm){  // if you're doing multithreading stuff (if single thread..you can ignore the synchronized
        pstm.clearParameters();
        pstm.setString(1, "Anne Rice");    //  1 = the first question mark in the String sql
        pstm.setString(2, "The Vampire Lestat's long fangs");
    ResultSet res = pstm.executeQuery();
    while (res.next()){
    }same thing for INSERT, UPDATE, etc..

  • Escape characters using Oracle JDBC

    We use Oracle JDBC driver to do some operations on an Oracle 9i database, and ran into some problems with escape characters. Basically we'd like to escape the _ and % characters.
    The following two example statements both work:
    ResultSet rs = stmt.executeQuery("select * from identifier_protein where upper(IDENTIFIER_ACCNO) like 'NM\\_%' escape '\\' ");
    ResultSet rs = stmt.executeQuery("select * from identifier_protein where upper(IDENTIFIER_ACCNO) like 'NM\\_%' {escape '\\' }");
    However, when we have multiple query terms and the "escape" clause doesn't immediately follows EACH "like" clause, we got errors saying the sql statement does not end properly. One such example is the following:
    ResultSet rs = stmt.executeQuery("select * from identifier_protein where upper(IDENTIFIER_ACCNO) like 'NM\\_%' and creator = 'ABC' {escape '\\'} ");
    If we put an "escape" clause following each "like" clause, then it works.
    My question is, is there a smart way of letting JDBC knows that you want to use an escape character everywhere in the query? We often do very complicated dynamic queries, frequently with table joins and boolean logic and subqueries with tons of query terms. Trying to add the escape clause to each "like" clause is very painful. Any help is highly appreciated. Thanks!
    BL

    I'd use PreparedStatements, if you're not already. Let the JDBC driver escape things properly for you. That's what the setString() and setDate() methods are all about.

  • Performance issue with context search

    We have a performance problem with a table tise with about 10 mio rows
    and a text column tise_desc with short descriptions (about 300 characters per row).
    We currently use mixed queries of the form (here very simple)
    SELECT /*+ FIRST_ROWS(10) */ * FROM tise
    WHERE reg_id = 'REGI0000000000000132'
    AND contains(tise_desc, '(employment)' ) > 0
    When the structured query part (here reg_id) and the fulltext part (contains) is not selective some queries take about 30 sec to 90 sec to process.
    When we repeat the query it only takes about 1-3 sec (may be due to caching).
    We are not interested in scoring nor in sorting the data.
    Until now we have tried to use different hints, use different index types (btree versus bitmap), use different sql query syntax, use one fulltext index with xml and within syntax without any real progress.
    Has any body addtional ideas?

    Since you are doing a combination of structured queries and simple text queries on only one column, a ctxcat index with a catsearch may be better than a context index with a contains search. The catsearch has fewer additional features available than contains, but some context features can be done with catsearch through a query template. If you only do simple searches and don't need those extra features then it doesn't matter.
    Make sure you have current statistics, so that the optimizer can use them to select the best execution plan.
    Use bind variables instead of literal values in your searches. When you use bind variables, the previous query in the SGA can be reused for different variable values without reparsing, so that every query with new values has the same effect as rerunning the previous query. This alone could account for the different between 30 to 90 seconds on the first run and 1-3 seconds on the second run.
    If you are not using scoring or sorting, then you might be better off without the first_rows hint, which chooses the best path for sorting. Try it both ways and see which works best for you.
    Once you have tested with a ctxcat index, current statistics, and bind variables, if it is still slow you may be able to use some tracing to determine the cause of the slowness and adjust some memory settings or some such thing. You can find more tuning hints for Oracle Text here:
    http://download.oracle.com/docs/cd/B28359_01/text.111/b28303/aoptim.htm#i1007227
    Please see the demonstration below that implements the recommendations above.
    SCOTT@orcl_11g> CREATE TABLE tise
      2    (reg_id        VARCHAR2 (20),
      3       tise_desc  VARCHAR2 (300))
      4  /
    Table created.
    SCOTT@orcl_11g> INSERT INTO tise VALUES ('REGI0000000000000132', 'employment')
      2  /
    1 row created.
    SCOTT@orcl_11g> INSERT INTO tise SELECT object_id, object_name FROM all_objects
      2  /
    68770 rows created.
    SCOTT@orcl_11g> -- try a ctxcat index instead of a context index
    SCOTT@orcl_11g> -- (make sure the index is not fragmented by periodically
    SCOTT@orcl_11g> --  dropping and recreating or altering and rebuilding or optimizing)
    SCOTT@orcl_11g> BEGIN
      2    CTX_DDL.CREATE_INDEX_SET ('tise_iset');
      3    CTX_DDL.ADD_INDEX ('tise_iset', 'reg_id');
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> CREATE INDEX tise_id_desc_idx ON tise (tise_desc)
      2  INDEXTYPE IS CTXSYS.CTXCAT
      3  PARAMETERS ('INDEX SET tise_iset')
      4  /
    Index created.
    SCOTT@orcl_11g> -- make sure you have current statistics:
    SCOTT@orcl_11g> EXEC DBMS_STATS.GATHER_TABLE_STATS (USER, 'TISE')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> -- use bind variables so that the query in the sga can be reused
    SCOTT@orcl_11g> -- for different variable values without reparsing:
    SCOTT@orcl_11g> VARIABLE search_reg_id VARCHAR2 (20)
    SCOTT@orcl_11g> VARIABLE search_desc VARCHAR2 (2000)
    SCOTT@orcl_11g> EXEC :search_reg_id := 'REGI0000000000000132'
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> EXEC :search_desc := 'employment'
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> -- query using catsearch with a ctxcat index and bind variables:
    SCOTT@orcl_11g> COLUMN tise_desc FORMAT A30 WORD_WRAPPED
    SCOTT@orcl_11g> SET AUTOTRACE ON EXPLAIN
    SCOTT@orcl_11g> SELECT *
      2  FROM   tise
      3  WHERE  CATSEARCH (tise_desc, :search_desc, 'reg_id=''' || :search_reg_id || '''') > 0
      4  /
    REG_ID               TISE_DESC
    REGI0000000000000132 employment
    Execution Plan
    Plan hash value: 409728589
    | Id  | Operation                   | Name             | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                  |  3439 |   100K|   102   (0)| 00:00:02 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TISE             |  3439 |   100K|   102   (0)| 00:00:02 |
    |*  2 |   DOMAIN INDEX              | TISE_ID_DESC_IDX |       |       |            |          |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CATSEARCH"("TISE_DESC",:SEARCH_DESC,'reg_id='''||:SEARCH_REG_ID|
                  |'''')>0)
    SCOTT@orcl_11g> SET AUTOTRACE OFF
    SCOTT@orcl_11g>

  • Txt to xml. Problems with characters(&, , ',...)

    I want to generate a xml file with text from a txt file but i have problems with special characters such as &, <... I'd like to know if there�s any class or library to filter the text in order to generate my xml without problems.
    Thank you.

    Use JDOM to generate your XML. It will worry about escaping issues for you.
    Here's a (probably rather inelegant) example for you to play around with:
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.*;
    public class DateBoom {
         public static void main(String[] args)
              throws Exception
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              DocumentBuilder builder = factory.newDocumentBuilder();
              String dodgyText = "< & '";
              Document document = builder.newDocument();
              Element root = document.createElement("root");
              root.setAttribute("dodgy",dodgyText);
              document.appendChild(root);
              Element child = document.createElement("child");
              root.appendChild(child);
              child.appendChild(document.createTextNode(dodgyText));
              Transformer transform = TransformerFactory.newInstance().newTransformer();          
              Source source = new DOMSource(document);
              Result result = new StreamResult(System.out);
              transform.transform(source,result);
    }Your alternative is to use something like String regular expressions (regex) to do this manually, but the XML oriented libraries will catch more corner cases than you're likely to anticipate, making them more reliable.

  • Escaping characters in SOAP Envelope XML string

    Hello,
    I have a manual web service reference (i.e. a XML String parametrized with more fields from my apex page). Sometimes the web service call fails because the user can enter special XML characters in the text field (this in consequence makes the XML String invalid XML). Do you know any elegant way to deal with this problem? Having a process that does htf.escape_sc for each text field in the same page I have my text field is a bit complcated in my case.
    Are there any other options?
    Many thanks in advance

    Hi "user11085282",
    you might try to wrap the user input in CDATA sections ... this is the "XML way" to have special characters in a document without escaping them. CDATA sections look
    as follows
    <tag><![CDATA[& & < <> >]]></tag>
    http://www.w3schools.com/xml/xml_cdata.asp
    Hope this helps ...
    Carsten Czarski
    Deutschsprachige APEX-Community: Tipps, Tricks, Best Practice
    http://tinyurl.com/apexcommunity
    SQL und PL/SQL: Tipps, Tricks & Best Practice
    http://sql-plsql-de.blogspot.com
    Twitter: @cczarski @oraclebudb                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem with base64 encoding an xml file with accented characters

    Oracle 10.2.0.1.0 Enterprise Edition running under windows 2003 server
    DB Characterset UTF-8
    I have a routine which takes an xml file and base64 encodes it, and the base64encoded text is stored in a clob column of a table.
    The xml file is stored in UTF-8 format.
    The routine works correctly, except when there are accented characters.
    I am using dbms_lob.loadclobfrom file to load the file.
    DBMS_LOB.OPEN(src_clob, DBMS_LOB.LOB_READONLY);
        DBMS_LOB.LoadCLOBFromFile(
              DEST_LOB     => dest_clob
            , SRC_BFILE    => src_clob
            , AMOUNT       => DBMS_LOB.GETLENGTH(src_clob)
            , DEST_OFFSET  => dst_offset
            , SRC_OFFSET   => src_offset
            , BFILE_CSID   =>dbms_lob.default_csid
            , LANG_CONTEXT => lang_ctx
            , WARNING      => warning
        DBMS_LOB.CLOSE(src_clob);base 64 encoded xml with accented character -- incorrect
    PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxncDpBcHBs
    aWNhdGlvblByb2ZpbGUgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAx
    L1hNTFNjaGVtYS1pbnN0YW5jZSINCiAgICB4c2k6c2NoZW1hTG9jYXRpb249Imh0
    dHA6Ly9uYW1lc3BhY2VzLmdsb2JhbHBsYXRmb3JtLm9yZy9zeXN0ZW1zLXByb2Zp
    bGVzLzEuMS4wIGh0dHA6Ly9uYW1lc3BhY2VzLmdsb2JhbHBsYXRmb3JtLm9yZy9z
    eXN0ZW1zLXByb2ZpbGVzLzEuMS4wL0dQLnN5c3RlbXMucHJvZmlsZXMuMS4xLjAu
    QXBwbGljYXRpb25Qcm9maWxlLnhzZCINCiAgICB4bWxuczpncD0iaHR0cDovL25h
    bWVzcGFjZXMuZ2xvYmFscGxhdGZvcm0ub3JnL3N5c3RlbXMtcHJvZmlsZXMvMS4x
    LjAiDQogICAgVW5pcXVlSUQ9Ik1FIiBQcm9maWxlVmVyc2lvbj0iMS4xLjAiIEVy
    cmF0YVZlcnNpb249IjAiPg0KICAgIDxncDpEZXNjcmlwdGlvbj5Gb3J1bSBUZXN0
    PC9ncDpEZXNjcmlwdGlvbj4NCiAgICA8Z3A6RGF0YUVsZW1lbnQgTmFtZT0iw6Fj
    Y2VudCIgRXh0ZXJuYWw9InRydWUiIFR5cGU9IkJ5dGVTdHJpbmciIEVuY29kaW5n
    PSJIRVgiIEZpeGVkTGVuZ3RoPSJmYWxzZSIgTGVuZ3RoPSIxNiIgUmVhZFdyaXRl
    PSJ0cnVlIiBVcGRhdGU9InRydWUiIE9wdGlvbmFsPSJ0cnVlIiAvPiAgICANCjwv
    Z3A6QXBwbGljYXRpb25Qcm9maWxlPg0Kbase 64 encoded xml without accented character -- correct
    PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxncDpBcHBs
    aWNhdGlvblByb2ZpbGUgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAx
    L1hNTFNjaGVtYS1pbnN0YW5jZSINCiAgICB4c2k6c2NoZW1hTG9jYXRpb249Imh0
    dHA6Ly9uYW1lc3BhY2VzLmdsb2JhbHBsYXRmb3JtLm9yZy9zeXN0ZW1zLXByb2Zp
    bGVzLzEuMS4wIGh0dHA6Ly9uYW1lc3BhY2VzLmdsb2JhbHBsYXRmb3JtLm9yZy9z
    eXN0ZW1zLXByb2ZpbGVzLzEuMS4wL0dQLnN5c3RlbXMucHJvZmlsZXMuMS4xLjAu
    QXBwbGljYXRpb25Qcm9maWxlLnhzZCINCiAgICB4bWxuczpncD0iaHR0cDovL25h
    bWVzcGFjZXMuZ2xvYmFscGxhdGZvcm0ub3JnL3N5c3RlbXMtcHJvZmlsZXMvMS4x
    LjAiDQogICAgVW5pcXVlSUQ9Ik1FIiBQcm9maWxlVmVyc2lvbj0iMS4xLjAiIEVy
    cmF0YVZlcnNpb249IjAiPg0KICAgIDxncDpEZXNjcmlwdGlvbj5Gb3J1bSBUZXN0
    PC9ncDpEZXNjcmlwdGlvbj4NCiAgICA8Z3A6RGF0YUVsZW1lbnQgTmFtZT0iYWNj
    ZW50IiBFeHRlcm5hbD0idHJ1ZSIgVHlwZT0iQnl0ZVN0cmluZyIgRW5jb2Rpbmc9
    IkhFWCIgRml4ZWRMZW5ndGg9ImZhbHNlIiBMZW5ndGg9IjE2IiBSZWFkV3JpdGU9
    InRydWUiIFVwZGF0ZT0idHJ1ZSIgT3B0aW9uYWw9InRydWUiIC8+ICAgIA0KPC9n
    cDpBcHBsaWNhdGlvblByb2ZpbGU+DQo=the xml file in use is
    <?xml version="1.0" encoding="UTF-8"?>
    <gp:ApplicationProfile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://namespaces.globalplatform.org/systems-profiles/1.1.0 http://namespaces.globalplatform.org/systems-profiles/1.1.0/GP.systems.profiles.1.1.0.ApplicationProfile.xsd"
        xmlns:gp="http://namespaces.globalplatform.org/systems-profiles/1.1.0"
        UniqueID="ME" ProfileVersion="1.1.0" ErrataVersion="0">
        <gp:Description>Forum Test</gp:Description>
        <gp:DataElement Name="áccent" External="true" Type="ByteString" Encoding="HEX" FixedLength="false" Length="16" ReadWrite="true" Update="true" Optional="true" />   
    </gp:ApplicationProfile>The file is being loaded from a windows xp professional 32 bit system.
    If I just convert the xml text of the file using
    select utl_raw.cast_to_varchar2(
    utl_encode.base64_encode(
    utl_raw.cast_to_raw(
    '<?xml version="1.0" encoding="UTF-8"?>
    <gp:ApplicationProfile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://namespaces.globalplatform.org/systems-profiles/1.1.0 http://namespaces.globalplatform.org/systems-profiles/1.1.0/GP.systems.profiles.1.1.0.ApplicationProfile.xsd"
        xmlns:gp="http://namespaces.globalplatform.org/systems-profiles/1.1.0"
        UniqueID="ME" ProfileVersion="1.1.0" ErrataVersion="0">
        <gp:Description>Forum Test</gp:Description>
        <gp:DataElement Name="áccent" External="true" Type="ByteString" Encoding="HEX" FixedLength="false" Length="16" ReadWrite="true" Update="true" Optional="true" />   
    </gp:applicationprofile>'
    ))) from dual;I get the following
    PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGdwOkFwcGxp
    Y2F0aW9uUHJvZmlsZSB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEv
    WE1MU2NoZW1hLWluc3RhbmNlIgogICAgeHNpOnNjaGVtYUxvY2F0aW9uPSJodHRw
    Oi8vbmFtZXNwYWNlcy5nbG9iYWxwbGF0Zm9ybS5vcmcvc3lzdGVtcy1wcm9maWxl
    cy8xLjEuMCBodHRwOi8vbmFtZXNwYWNlcy5nbG9iYWxwbGF0Zm9ybS5vcmcvc3lz
    dGVtcy1wcm9maWxlcy8xLjEuMC9HUC5zeXN0ZW1zLnByb2ZpbGVzLjEuMS4wLkFw
    cGxpY2F0aW9uUHJvZmlsZS54c2QiCiAgICB4bWxuczpncD0iaHR0cDovL25hbWVz
    cGFjZXMuZ2xvYmFscGxhdGZvcm0ub3JnL3N5c3RlbXMtcHJvZmlsZXMvMS4xLjAi
    CiAgICBVbmlxdWVJRD0iTUUiIFByb2ZpbGVWZXJzaW9uPSIxLjEuMCIgRXJyYXRh
    VmVyc2lvbj0iMCI+CiAgICA8Z3A6RGVzY3JpcHRpb24+Rm9ydW0gVGVzdDwvZ3A6
    RGVzY3JpcHRpb24+CiAgICA8Z3A6RGF0YUVsZW1lbnQgTmFtZT0iw6FjY2VudCIg
    RXh0ZXJuYWw9InRydWUiIFR5cGU9IkJ5dGVTdHJpbmciIEVuY29kaW5nPSJIRVgi
    IEZpeGVkTGVuZ3RoPSJmYWxzZSIgTGVuZ3RoPSIxNiIgUmVhZFdyaXRlPSJ0cnVl
    IiBVcGRhdGU9InRydWUiIE9wdGlvbmFsPSJ0cnVlIiAvPiAgICAKPC9ncDphcHBs
    aWNhdGlvbnByb2ZpbGU+Edited by: Keith Jamieson on Jul 13, 2012 9:59 AM
    added code tag for last base64 encoded object

    Not sure if utl_i18n is already there in version prior to 11.2.0.2.
    But on above mentioned version I can do the simplified method
    SQL> SELECT utl_i18n.raw_to_char (
             utl_encode.base64_encode (
               xmltype (
                 '<?xml version="1.0" encoding="UTF-8"?>
    <gp:ApplicationProfile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://namespaces.globalplatform.org/systems-profiles/1.1.0 http://namespaces.globalplatform.org/systems-profiles/1.1.0/GP.systems.profiles.1.1.0.ApplicationProfile.xsd"
        xmlns:gp="http://namespaces.globalplatform.org/systems-profiles/1.1.0"
        UniqueID="ME" ProfileVersion="1.1.0" ErrataVersion="0">
        <gp:Description>Forum Test</gp:Description>
        <gp:DataElement Name="áccent" External="true" Type="ByteString" Encoding="HEX" FixedLength="false" Length="16" ReadWrite="true" Update="true" Optional="true" />   
    </gp:ApplicationProfile>').getblobval (
                 NLS_CHARSET_ID ('utf8'))),
             'utf8')
             x
      FROM DUAL
    X                                                                                                                                                    
    PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGdwOkFwcGxp                                                                                     
    Y2F0aW9uUHJvZmlsZSB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEv                                                                                     
    WE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6c2NoZW1hTG9jYXRpb249Imh0dHA6Ly9u                                                                                     
    YW1lc3BhY2VzLmdsb2JhbHBsYXRmb3JtLm9yZy9zeXN0ZW1zLXByb2ZpbGVzLzEu                                                                                     
    MS4wIGh0dHA6Ly9uYW1lc3BhY2VzLmdsb2JhbHBsYXRmb3JtLm9yZy9zeXN0ZW1z                                                                                     
    LXByb2ZpbGVzLzEuMS4wL0dQLnN5c3RlbXMucHJvZmlsZXMuMS4xLjAuQXBwbGlj                                                                                     
    YXRpb25Qcm9maWxlLnhzZCIgeG1sbnM6Z3A9Imh0dHA6Ly9uYW1lc3BhY2VzLmds                                                                                     
    b2JhbHBsYXRmb3JtLm9yZy9zeXN0ZW1zLXByb2ZpbGVzLzEuMS4wIiBVbmlxdWVJ                                                                                     
    RD0iTUUiIFByb2ZpbGVWZXJzaW9uPSIxLjEuMCIgRXJyYXRhVmVyc2lvbj0iMCI+                                                                                     
    CiAgPGdwOkRlc2NyaXB0aW9uPkZvcnVtIFRlc3Q8L2dwOkRlc2NyaXB0aW9uPgog                                                                                     
    IDxncDpEYXRhRWxlbWVudCBOYW1lPSLDoWNjZW50IiBFeHRlcm5hbD0idHJ1ZSIg                                                                                     
    VHlwZT0iQnl0ZVN0cmluZyIgRW5jb2Rpbmc9IkhFWCIgRml4ZWRMZW5ndGg9ImZh                                                                                     
    bHNlIiBMZW5ndGg9IjE2IiBSZWFkV3JpdGU9InRydWUiIFVwZGF0ZT0idHJ1ZSIg                                                                                     
    T3B0aW9uYWw9InRydWUiLz4KPC9ncDpBcHBsaWNhdGlvblByb2ZpbGU+Cg==                                                                                         
    1 row selected.which encodes and decodes properly on my system even with accented characters.

Maybe you are looking for

  • Connecting lines missing from binary TOC

    Hello! Hope you can help me...I'm using X5. My problem is that I lose the connecting lines between the square/minus boxes in the TOC when I select binary. Is there a way to have both? Thanks much, Deb

  • Shortcuts netbeans 6.1

    Does anyone know the shortcuts in netbeans 6.1 for include a directive '<%@ page import="..." %>' in a jsp? Thanks.

  • How to download upgrade to PSE 10

    I have PSE 6 downloaded on my pc and have now purchased PSE 10 - how do I install the upgrade - I have the installation code.

  • IW31 - Copy planned cost to estimated cost cost - user exit/BADI

    Hi all, My requiremnt is such. While creating an order via IW31: - the user clicks on the release button directly and saves. - the user does not click on the cost calculate button. The value of planned cost in the cost tab should be copied to estimat

  • [SOLVED] Windows 8 made all my arch partition unallocated space

    Hi, I've been using arch for the past 8 months without any problem. I used to have win 7 and fedora on my laptop also.I used the bootloader from fedora to boot arch. Yesterday I decided to replace win7 with win8. After playing around with it, it was