Optimize XML parsing query

My developers have come up with a query that is hogging CPU and leading to unacceptable execution times. My initial analysis is that the problem is caused by the fact that the query is heavily parsing XML data with multiple calls to getClobVal() and extract(). I'm looking for suggestions on how to improve the performance of this query-- radical suggestions if necessary.
My first thought is to denormalize the data: pull out the XML fields that are being parsed frequently and put them into their own table columns. This would take quite a while (it's a large table), and there is no guarantee that tomorrow they won't come up with another field that needs to be parsed out. Can anyone offer other ideas, based on the details provided here?
It's an 11g database that consists of little more than a 20-million row table of XML CLOBs with an Oracle Text index (about 2 TB in size). The following is the problematic query. Its purpose is to parse certain fields out of the XML, transform some of them, and then dump those fields to a spreadsheet. It gets called on an ad-hoc basis by a web-based reporting app.
SELECT /*+ FIRST_ROWS( 500 ) */ a.* FROM (
  SELECT /*+ FIRST_ROWS( 500 ) */ SCORE(0) as SCORE ,
  extract( mytable.xmldata , '/document/biblio/doc_num/text()').getClobVal() AS Document,
  extract( mytable.xmldata , '/document/biblio/kind_code/text()').getClobVal() AS Kind_Code,
  extract( mytable.xmldata , '/document/biblio/filing_date/text()').getClobVal() AS Filed,
  extract( mytable.xmldata , '/document/biblio/pub_date/text()').getClobVal() AS Published,
  REPLACE(REPLACE(extract( mytable.xmldata , '/document/biblio/classification/classes[@type="abc"]/class/text()').getClobVal() , '<![CDATA[', ''), ']]>', '') AS ABC,
  REPLACE(REPLACE(extract( mytable.xmldata , '/document/biblio/classification/classes[@type="abcd"]/class/text()').getClobVal() , '<![CDATA[', ''), ']]>', '') AS ABC_D,
  REPLACE(REPLACE(extract( mytable.xmldata , '/document/biblio/title/text/text()').getClobVal() , '<![CDATA[', ''), ']]>', '') AS Title,
  extract( mytable.xmldata , '/document/biblio/author/name/text()').getClobVal() AS Author,
  extract( mytable.xmldata , '/document/biblio/assignees/assignee/name/text()').getClobVal() AS Assignee,
  REPLACE(REPLACE(extract( mytable.xmldata , '/document/biblio/abstract/text/text()').getClobVal() , '<![CDATA[', ''), ']]>', '') AS Abstract
  FROM mytable WHERE contains(xmldata, :yesclause , 0)>0 ORDER BY SCORE(0) DESC
) a WHERE ROWNUM<=500  Thanks for any thoughts on this.

when parse xml try to manipulate character set
like
select <data>
    from (XMLTABLE('*'
                   PASSING (XMLTYPE(bfilename('XMLSTORE','data.xml'),NLS_CHARSET_ID('AL32UTF8')))
                   COLUMNS <data> xmltype PATH '/*'
         )

Similar Messages

  • Xml parsing error while selecting whole result set for sql query

    Hi All,
    I am having xml parsing error while selecting whole query result set. The data is coming fine for default result set of 50 rows.
    My exception is below.
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00234: namespace prefix "xsi" is not declared
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    *31011. 00000 - "XML parsing failed"*
    **Cause: XML parser returned an error while trying to parse the document.*
    **Action: Check if the document to be parsed is valid.*
    My sql query is below that is giving results for default result set of 50 rows.
    select extract(xmlType(clob_xml_colm_name), '//v2:node1//childnode/text()','xmlns:v2="namespace_url"').getStringVal()  from table_name
    My sql developer version is below.
    Java(TM) Platform     1.7.0_04
    Oracle IDE     3.1.07.42
    Versioning Support     3.1.07.42
    My database version is below.
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit
    Please could any one help me urgently as the sql query is supposed to be correct as it is returning query results, but the problem happening when i try to select whole result set.
    Thanks and regards,

    What does the XML look like? It appears that some of the supposed XML stored as a CLOB is not really valid XML. Find the row in the table that is causing your issue and review the "XML" in it.

  • How does XDB optimize XML Query?

    I found the query speed of XDB is much slower than Berkeley XML DB.
    How does XDB optimize XML Query?
    Are there any documents on this subject?
    And can XDB create indices on XMLType ( e.g. the index on element/attribute value and/or structure index)? if yes, how to do that?

    lezhou had a valid question and asked about:
    "I found the query speed of XDB is much slower than Berkeley XML DB"
    "How does XDB optimize XML Query?"
    These point to a "XML DB Concepts Guide", which does not yet exist.
    The procedures are explained, the methods are explained. If you enable event tracing as described in the XMLDB Developers Guide 10gR2, you will see statements in your trace file which will tell you more about the XML DB architecture (and therefor you can deduct performance impact) then the manual will reveal.
    An other example:
    The xdbconfig.xsd file is neatly explained - in regards of http-port-etc
    But not what the implecations are if you alter one of the other ones (the not explained parameters).
    If you know the architecture (GROUND LEVEL), you can give an correct answer to the initial question "I found the query speed of XDB is much slower than Berkeley XML DB. How does XDB optimize XML Query?"
    The balanced tree index is constructed the same way (on the same theory) in Oracle, DB2, but apparantly X is faster because in with the same buildup/architecture/databasestructure for both products, with the same data, with the same X --> value Y is beter constructed and delivers a better performance.
    apples = apples
    oracle xmldb = berkeley xmldb --> how can i test the o.apples=b.apples and that under these circumstances o.apples are faster ;-)
    THEREFOR:
    "I have to disagree a little bit...("It speaks about all these in detail").
    Still waiting for the XMLDB Concepts Guide / Administrators Guide / Performance Guide.

  • How can I use a 3rd party XML parser such as xerces with OC4J ?

    Hi all tech experts,
    I am using Oracle Application Server 10g Release 2 (10.1.2) and i have
    installed Portal and Wireless and OracleAS Infrastructure on the same
    computer.
    i tried all the solutions on this thread
    Use of Xerces Parser in out application with Oracle App Server 9.0.4
    but still fighting.
    I have also posted this query on OTN on following thread
    How can I use a 3rd party XML parser such as xerces with OC4J?
    but no reply....
    Please help me on this issue.
    Since OC4J is preconfigured to use the Oracle XML parser which is xmlparserv2.jar.
    i have read the following article which states that
    OC4J is preconfigured to use the Oracle XML parser. The Oracle XML parser is fully JAXP 1.1 compatible and will serve the needs of applications which require JAXP functionality. This approach does not require the download, installation, and configuration of additional XML parsers.
    The Oracle XML parser (xmlparserv2.jar) is configured to load as a system level library of OC4J through it's inclusion as an entry in the Class-Path entry of the oc4j.jar Manifest.mf file. This results in the Oracle XML parser being used for all common deployment and packaging situations. You are not permitted to modify the Manifest.mf file of oc4j.jar.
    It must be noted that configuring OC4J to run with any additional XML parser or JDBC library is not a supported configuration. We do know customers who have managed to successfully replace the system level XML parser and the Oracle JDBC drivers that ship with the product, but we do not support this type of configuration due to the possibility of unexpected system behavior and system errors that might occur from replacing the tested and certified libraries.
    If you absolutely must use an additional XML parser such as xerces, then you have to start OC4J such that the xerces.jar file is loaded at a level above the OC4J system classpath. This can be accomplished using the -Xbootclasspath flag of the JRE.
    i have also run the following command
    java -Xbootclasspath/a:d:\xerces\xerces.jar -jar oc4j.jar
    but no success.
    How could i utilize my jar's like xerces.jar and xalan.jar for parsing instead of OC4J in-built parser ?
    All reply will be highly appreciated.
    Thnx in advance to all.
    Neeraj Sidhaye
    try_catch_finally @ Y !

    Hi Neeraj Sidhaye,
    I am trying to deploy a sample xform application to the Oracle Application Server (10.1.3). However, I encountered the class loader issue that is similar to your stuation. I tried all the three solutions but the application is still use the Oracle xml paser class. I am wondering if you have any insight about this?
    Thanks for your help.
    Xingsheng Qian
    iPass Inc.
    Here is the error message I got.
    Message:
    java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
    Stack Trace:
    org.chiba.xml.xforms.exception.XFormsException: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
         at org.chiba.xml.xforms.Container.dispatch(Unknown Source)
         at org.chiba.xml.xforms.Container.dispatch(Unknown Source)
         at org.chiba.xml.xforms.Container.initModels(Unknown Source)
         at org.chiba.xml.xforms.Container.init(Unknown Source)
         at org.chiba.xml.xforms.ChibaBean.init(Unknown Source)
         at org.chiba.adapter.servlet.ServletAdapter.init(ServletAdapter.java:153)
         at org.chiba.adapter.servlet.ChibaServlet.doGet(ChibaServlet.java:303)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
         at org.chiba.xml.xforms.Instance.iterateModelItems(Unknown Source)
         at org.chiba.xml.xforms.Bind.initializeModelItems(Unknown Source)
         at org.chiba.xml.xforms.Bind.init(Unknown Source)
         at org.chiba.xml.xforms.Initializer.initializeBindElements(Unknown Source)
         at org.chiba.xml.xforms.Model.modelConstruct(Unknown Source)
         at org.chiba.xml.xforms.Model.performDefault(Unknown Source)
         at org.chiba.xml.xforms.XFormsDocument.performDefault(Unknown Source)
         at org.chiba.xml.xforms.XFormsDocument.dispatchEvent(Unknown Source)
         at org.apache.xerces.dom.NodeImpl.dispatchEvent(Unknown Source)
         ... 18 more

  • Swapping XML Parser and XSLT to Xalan 2.7.0 - Not Working (OC4J 10.1.3)

    Hi-
    I'm trying to use the latest Xercies/Xalan classes in OC4J 10.1.3 as described in the How-To swap XML Parsers document:
    http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html
    What I can see happening is that the oracle.xml shared library is successfully 'turned off', but the xalan libraries are not added. Instead, the default xml classes that are distributed with the JDK become visible. For instance, using a slightly modified version of the index.jsp page from the how-to, I get this result:
    ------ Output from JSP page ----------------
    TransformerFactory Instance: org.apache.xalan.processor.TransformerFactoryImpl
    Transformer Instance: org.apache.xalan.transformer.TransformerIdentityImpl
    Transformer Version: Xalan Java 2.4.1 (!!)
    What I expect is for that last line to say version 2.7.0, which is the version of the xalan.jar included in my shared library (code to add that line to the how-to shown below).
    I suspect what is happening is that the class loader is simply not letting a shared library override a system library - to do that you probably need to place the jar files in system endorsed directory.
    Has anyone gotten this how-to to work - actually replacing the XML parser/transform classes with the latest Xalan classes? Are you sure it is seeing the current version you placed in the shared library?
    Thanks,
    Eric Everman
    ---- My modified getXSLTDetails() method in the index.jsp page of the how-to -------
    <!-- Additional Import -->
    <%@ page import="org.apache.xalan.Version" %>
    public static String getXSLTDetails()
    Transformer transformer=null;
    TransformerFactory transformerfactory = TransformerFactory.newInstance();
         Version ver = null;
         String br = "<" + "br" + ">"; //otherwise the otn forum chocks on the break.
    try
    transformer = transformerfactory.newTransformer();
              ver = (Version) transformer.getClass().forName("org.apache.xalan.Version").newInstance();
              String ret_val =
                   "TransformerFactory Instance: "+transformerfactory.getClass().getName() + br +
                   "Transformer Instance: "+transformer.getClass().getName() + br;
              if (ver != null) {
                   ret_val = ret_val + "Transformer Version: " + ver.getVersion() + br;
              } else {
                   ret_val = ret_val + "Transformer Version not Available" + br;
              return ret_val;
    catch (Exception e)
    e.printStackTrace();
    return e.getMessage();
    }--------------------------------------------------------------------

    Steve - Thanks for responding on this.
    The Xalan SQL extension is built into Xalan. The most painless way to try it out is to run it via JEdit: www.jedit.org
    JEdit a OS Java application with a fairly painless install process (I'm assuming you already have a current JRE installed). Once its installed, you'll need to install the XSLT plugin - in JEdit goto Plugins | Plugin Manager | Install and pick the XSLT plugin. You'll need the Oracle JDBC classes on your classpath - this can be done by copying the oracle_jdbc4.jar into the [JEdit install directory]/jars directory.
    Restart to load that jar and you should be all set.
    I included a sample XSLT page at the bottom of this post that is somewhat of a template transform for the SQL extension - its more complicated then it needs to be, but it does some nice things with the results of the query. Save it as a file and make the appropriate changes to the 'datasource' parameter near the top of the file.
    Then in JEdit, open the file and make sure the XSLT plugin is visible (Plugins | XSLT | XSLT Processor Toggle - or alternately dock it in the window via global prefs). In the XSLT plugin: Allow the current buffer to be used as the source, Add that same file as a stylesheet via the '+' button, and pick a result file at the bottom. Then click the 'Transform XML' button.
    Troubleshooting: I seem to remember having some classpath errors when I tried this on windows, but others have had it work w/o issues. I do remeber that the XSLT plugin had a popup window that gave a pretty good explaintion of the problem, if it occurs. Also, for some reason the XSLT plugin will not create a new file for the output, so its often best to create a file first, then choose it as the output. Of course, you can always run a transformation from the command line or w/in an applicatoin. Full docs on the Xalan SQL extension can be found at: http://xml.apache.org/xalan-j/extensionslib.html#sql
    Here is my sample XSLT transform using the SQL extension:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              xmlns:sql="http://xml.apache.org/xalan/sql"
              xmlns:str="http://exslt.org/strings"
              xmlns:xalan="http://xml.apache.org/xalan"
              extension-element-prefixes="sql str xalan">
         <xsl:output indent="yes"/>
         <xsl:param name="driver">oracle.jdbc.OracleDriver</xsl:param>
         <xsl:param name="datasource">jdbc:oracle:thin:jqpublic/jqpublic@server_name:1521:dbname</xsl:param>
         <xsl:param name="jndiDatasource"><!-- jndi source for production use w/in enterprise environment --></xsl:param>
         <xsl:param name="debug">true</xsl:param>
         <xsl:variable name="connection" select="sql:new()"/>
         <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
         <xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'"/>
         <!--
              The query:  You could pass parameters in to this query to build a where clause, but here is a simple example.
              Also, its nice to wrap the query with a max row number to prevent huge results.
         -->
         <xsl:param name="query">
         select * from (
      SELECT
              'One' FIELD_1,
              'Two' FIELD_2
         FROM DUAL
         ) where rownum < 100
         </xsl:param>
         <!-- Essentially, create a XConnection object -->
         <xsl:variable name="connection" select="sql:new()"/>
         <xsl:template match="/">
        <xsl:choose><!-- Connect using JNDI -->
          <xsl:when test="$jndiDatasource != ''">
            <xsl:if test="not(sql:connect($connection, $jndiDatasource))">
              <xsl:message>Failed to connect to db via jndi connection</xsl:message>
              <xsl:comment>Failed to connect to db via jndi connection</xsl:comment>
              <xsl:if test="$debug = 'true'">
                <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
            </xsl:if>
          </xsl:when>
          <xsl:otherwise><!-- Connect using connection string -->
            <xsl:if test="not(sql:connect($connection, $driver, $datasource))">
              <xsl:message>Failed to connect to db via driver/url connection</xsl:message>
              <xsl:comment>Failed to connect to db via driver/url connection</xsl:comment>
              <xsl:if test="$debug = 'true'">
                <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
            </xsl:if>
          </xsl:otherwise>
        </xsl:choose>
              <!--
              The results of the query.  The rowset is brought back in 'streaming' mode,
              so its not possible to ask it for the number of rows, or to check for zero
              rows.  There is a switch to disable streaming mode, but this requires all
              rows to be brought into memory.
              -->
              <xsl:variable name="table" select="sql:query($connection, $query)"/>
              <xsl:if test="not($table)">
                   <xsl:message>Error in Query</xsl:message>
                   <xsl:copy-of select="sql:getError($connection)/ext-error"/>
              </xsl:if>
              <page>
                   <!-- Your xalan environment -->
                   <xsl:copy-of select="xalan:checkEnvironment()"/>
                   <!-- Build a bunch of metadata about the rows -->
                   <meta>
                        <cols>
                             <xsl:apply-templates select="$table/sql/metadata/column-header"/>
                        </cols>
                   </meta>
                   <rowset>
                        <!--
                             With streaming results, you must use the apply-temmplates contruct,
                             not for-each, since for-each seems to attempt to count the rows, which
                             returns zero.
                        -->
                        <xsl:apply-templates select="$table/sql/row-set"/>
                   </rowset>
              </page>
              <xsl:value-of select="sql:close($connection)"/><!-- Always close -->
         </xsl:template>
         <xsl:template match="row">
              <row>
                   <xsl:apply-templates select="col"/>
              </row>
         </xsl:template>
         <xsl:template match="column-header">
              <col>
                   <xsl:attribute name="type">
                        <xsl:value-of select="@column-typename"/>
                   </xsl:attribute>
                   <xsl:attribute name="display-name">
                        <xsl:call-template name="create-display-name"/>
                   </xsl:attribute>
                   <xsl:value-of select="@column-name"/>
              </col>
         </xsl:template>
         <!-- Convert column names to proper caps: MY_FIELD becomes My Field -->
         <xsl:template name="create-display-name">
              <xsl:variable name="col-name">
                   <xsl:for-each select="str:tokenize(@column-name, '_')">
                        <xsl:value-of
                             select="concat(translate(substring(., 1, 1), $lowercase, $uppercase), translate(substring(.,2), $uppercase, $lowercase), ' ')"/>
                   </xsl:for-each>
              </xsl:variable>
              <xsl:value-of select="substring($col-name, 1, string-length($col-name) - 1)"/>
         </xsl:template>
         <!-- Creates data columns named 'col' with a column-name attribute -->
         <xsl:template match="col">
              <col>
                   <xsl:attribute name="column-name"><xsl:value-of select="@column-name"/></xsl:attribute>
                   <xsl:value-of select="."/>
              </col>
         </xsl:template>
    </xsl:stylesheet>

  • XML parser error; when XPath elements starts with "_"

    Hi,
    I have a problem in extracting elements from XML which is starting with "_". please check the queries below executed on Oracle 10g.
    Query 1:
    SELECT EXTRACTVALUE(XMLTYPE('<A><_B>1</_B><_C>2</_C><_D>3</_D><E>4</E></A>'),'/A/_B') FROM DUAL;
    Error starting at line 1 in command:
    SELECT EXTRACTVALUE(XMLTYPE('<A><_B>1</_B><_C>2</_C><_D>3</_D><E>4</E></A>'),'/A/_B') FROM DUAL
    Error report:
    SQL Error: ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in: '/A/_B'
    31011. 00000 - "XML parsing failed"
    *Cause:    XML parser returned an error while trying to parse the document.
    *Action:   Check if the document to be parsed is valid.
    Query 2:
    SELECT EXTRACTVALUE(XMLTYPE('<A><_B>1</_B><_C>2</_C><_D>3</_D><E>4</E></A>'),'/A/E') FROM DUAL;
    EXTRACTVALUE(XMLTYPE('<A><_B>1</_B><_C>2</_C><_D>3</_D><E>4</E></A>'),'/A/E')
    4
    Oracle version:
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Please let me know if there is any workaround for this.*
    Thanks,
    Veerababu Kanumilli.

    Hi MichaelS,
    - I have executed the queries provided by you, but I am not able to get the result in 10g when I am trying to access elements with "_" in XPath.
    select * from v$version where rownum = 1;
    select extractvalue (xmltype ('&lt;A&gt;<_B>1</_B><_C>2</_C><_D>3</_D><E>4</E>&lt;/A&gt;'), '/A/_B') "_B" from dual;
    select extractvalue (xmltype ('&lt;A&gt;<_B>1</_B><_C>2</_C><_D>3</_D><E>4</E>&lt;/A&gt;'), '/A/E') "E" from dual;
    Output:
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    Error starting at line 4 in command:
    select extractvalue (xmltype ('&lt;A&gt;<_B>1</_B><_C>2</_C><_D>3</_D><E>4</E>&lt;/A&gt;'), '/A/_B') "_B" from dual
    Error report:
    SQL Error: ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in: '/A/_B'
    31011. 00000 - "XML parsing failed"
    *Cause:    XML parser returned an error while trying to parse the document.
    *Action:   Check if the document to be parsed is valid.
    E
    4
    Thanks,
    Veerababu Kanumilli

  • Creating chart leads in XML Parsing Error: mismatched tag. Expected: /svg

    Hello ALL,
    I searched this forum but unfortunately I find not a solution for the following use case:
    described in steps
    1.) create a region with chart (typ = line) -> o.k.
    2.) create a sql statement to have data in the chart -> o.k.
    3.) running report with this created region and chart -> vizualisation o.k.
    3.) create a data picker item ":P21_END_DATE"
    4.) replaced the where clause "WHERE a_timestamp >= To_date ('01.02.2007', 'dd/mm/yyyy HH24:MI') -1/24" with WHERE a_timestamp >= To_date (:P21_END_DATE, 'dd/mm/yyyy HH24:MI') -1/24
    5.) running report with this created region and chart and data picker item -> vizualisation not o.k. I get the attached error message.
    I read already in the forum and knows that the end tag of the svg section is lost put I only changed in my query the described value. Does any body can help me please ??
    king regards
    XML Parsing Error: mismatched tag. Expected: </svg>.
    Location: http://localhost:7777/pls/htmldb/f?p=103:9:8795066316806762442:FLOW_SVG_CHART_R2476324075306576_de
    Line Number 22, Column 1455:</style><script xlink:href="/i/javascript/svg_js_includes/svg_common/oracle.svgInit.js"/><script xlink:href="/i/javascript/svg_js_includes/svg_common/oracle.svgNodes.js"/><script type="text/ecmascript"><![CDATA[function svgSync(){window.reload();}function htmldb_Load(){try{oracleSvgInit(evt);throw "old version" }catch(er){}}]]></script><rect id="background" x="1" y="1" width="1022" height="398"/><text x="20" y="20" class="title">Chart 1</text><text id="XAxisTitle" x="50%" y="390">Minute</text><text id="YAxisTitle" x="15" style="writing-mode:lr;" y="200" transform="rotate(-90,15,200)" text-anchor="middle">Messages</text><g id="legend" transform="translate(0,25)"><rect class="legend" x="1" y="0" width="1022" height="60"/><g class="legenditem" transform="translate(20,18)"><line x1="0" y1="-5" x2="-15" y2="-5" class="data1"/><text class="legend" y="0" x="2">ALL</text></g><g class="legenditem" transform="translate(20,36)"><line x1="0" y1="-5" x2="-15" y2="-5" class="data2"/><text class="legend" y="0" x="2">SMS</text></g><g class="legenditem" transform="translate(20,54)"><line x1="0" y1="-5" x2="-15" y2="-5" class="data3"/><text class="legend" y="0" x="2">LL</text></g></g><svg width="1024" height="400" viewBox="-5 -5 1024 400" preserveAspectRatio="none"> <text class="nodatafound" x="40" y="20">No data found.</text><text class="nodatafound" x="40" y="20">no data found</text><text class="nodatafound" x="40" y="20">no data found</text></g></svg><g id="infobubble" transform="translate(0,0)" style="visibility:hidden"><rect id="infobackground" rx="2" ry="2" x="0" y="0" width="100" height="20" fill-opacity=".9" fill="#FFFFFF" stroke="#000000" stroke-width="1"/><text id="infotext" x="5" y="12">-</text></g><!-- USER FOOTER--></svg>
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^

    I found the solution:
    No data resulting to the query !!

  • Exception occurs when xml parser encounters a '&' in data

    I'm using xmlparserv2 and jdk1.3.1. When I run a query I convert it into xml using the oracle xmlparser classes and methods. Everything works fine until I encounter a '&' character in my data. The parser throws an exception about the character '&' not mapping to a valid unicode.
    How can I correct this error? Is there some way that I can define how the character '&' is mapped?
    What class file determines how special characters are mapped?
    Thanks
    Norm

    and if you don't want to or can not fix the data, than use REPLACE in your queries.
    This is normal behaviour with any XML parser. & has a special meaning in XML so in your data you have to & to reprasent &. Fix your data replace all occurrences of & with &

  • SQL Server 2012 Management Studio:Importing XML file to new Table of new Database-XML parsing: unexpected end of input???

    Hi all,
    In the Notepad, I created an xml file (ZenQroducts.xml) :
    <Qroducts>
    <Qroduct>
    <SKU>1</SKU>
    <Desc>Book</Desc>
    </Qroduct>
    <Qroduct>
    <SKU>2</SKU>
    <Desc>DVD</Desc>
    </Qroduct>
    <Qroduct>
    <SKU>3</SKU>
    <Desc>Video</Desc>
    </Qroduct>
    In my SQL Server 2012 Management Studio, I executed the following code:
    --to create a new object Qroducts in a new database OPENXMLtesting
    CREATE DATABASE OPENXMLtesting
    GO
    CREATE TABLE Qroducts(
    sku INT Primary KEY,
    qroduct_desc VARCHAR(30));
    INSERT INTO Qroducts (sku, qroduct_desc)
    SELECT X.qroduct.query('SKU').value('.', 'INT'),
    X.qroduct.query('Desc').value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'H:\ZenQroducts.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('Qroducts/Qroduct') AS X(qroduct);
    SELECT sku, qroduct_desc
    FROM Qroducts;
    I got the following message:
    Msg 9400, Level 16, State 1, Line 6
    XML parsing: line 13, character 12, unexpected end of input
    I have no ideas why I got this "XML parsing:line 13, character12, unexpected end of input" message. Please kindly help, advise me on where I made mistake and how I can resolve this problem, and respond in this Forum.
    Thanks in advance,
    Scott Chang
     

    Hi Manish, Thanks for your response.
    Yes, it is a duplicate with Qroducts/Qroduct instead of Products/Product. I did it, because I don't know how to remove the existing "Products" database.
    Again, I got the existing "Qroducts" database in this second trial!!??  I am comletely lost in doing "Importing XML file to SQL Table" now!!  I think that I have not touched T-SQL and XML programming, since 2008. I
    did not catch the new features of T-SQL 2008, XML, SQL/XML, XQuery, etc. for long time. Recently, I did not know what DECLARE, @x, SET,...were, and dived into the SQL/XML and XQuery programming. I knew the SQL Basics (SELECT, FROM, WHERE,..), creating
    the names of databases and tables in SQL Server 2008/2012 Management Studio (Express) before. This morning, I found an old T-SQL 2008 Prgrammer's Guide that has the new features of SQL Server 2008 for T-SQL, XML, XQuery, etc. I just starting reading
    it to know what DECLARE, @x, SET,... are. But, I still don't know where the existing databases "Products" and "Qroducts" (created by me) are - they are not in the Databases of SQL Server 2012 Management Studio I am using!!??  Could
    you please kindly point out where the "Products" and "Qroducts" databases are?
    Prashanth responded to my posted question too and he asked to to try his code: DECLARE @xml XML, SELECT @xml =' <Qroducts>.....SELECT product.value.....FROM @XML.nodes.....AS.... I just learned that his code is doing the thing we
    want to do and print the results below the SQL Query. This is not what I need in doing my SQL/XML programming. I am reading/studying the new (2008) features of T-SQL, XQuery 1.0: An XML Query Language (Second Edition), and Microsoft XQuery Language Reference
    (SQL Server 2012 Books Online) closely now. I hope that I can resume the T-SQL, XML Query, SQL/XML, XQuery in my SQL Server 2012 Management Studio soon.
    Please tell me  where the existing databases "Products" and "Qroducts" I created in my previous trials in my SQL Server 2012 Management Studio.  This is what I need to know and to delete them, before I do this kind of "Importing
    XML file to Table of SQL Server 2012 Management Studio"  programming again.
    Please kindly help, advise and respond again.
    Many Thanks,
    Scott Chang

  • SQL Server 2012 Management Studio: Import XML File to SQL Table - XML parsing: illegal qualified name character

    Hi all,
    In my SQL Server 2012 Management Studio, I executed the following code:
    CREATE TABLE Products(
    sku INT Primary KEY,
    product_desc VARCHAR(30));
    INSERT INTO Products (sku, product_desc)
    SELECT X.product.query('SKU').value('.', 'INT'),
    X.product.query('Desc').value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'H:\ZenProducts.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('Products/Product') AS X(product);
    SELECT sku, product_desc
    FROM Products;
    I got the following message:
    Msg 9455, Level 16, State 1, Line 5
    XML parsing: line 3, character 12, illegal qualified name character
    I have no ideas why the "product" in the statement "SELECT X.product.query('SKU').value('.','INT')" is not legal qualified name charcter!!!???  Please kindly help, advise and respond.
    Thanks in advance,
    Scott Chang

    Hi Manish, Thanks for your response.
    Here is a copy of my ZenProducts.xml:
    <Products>
    <Product>
    <SKU>1<</SKU>
    <Desc>Book</Desc>
    </Product>
    <Product>
    <SKU>2<</SKU>
    <Desc>DVD</Desc>
    </Product>
    <Product>
    <SKU>3<</SKU>
    <Desc>Video</Desc>
    </Product>
    I found the wrong "<<" in my xml file and changed it to the right "<" for the statement<SKU>1</sku>. I executed the corrected code and I got the following new message:
    Msg 2714, Level 16, State 6, Line 1
    There is already an object named 'Products' in the database.
    I don't know how to remove the old, existing the 'Products' object in the database and execute the corrected code again. Please kindly help, advise and tell me how to resolve this new problem.
    Many Thanks,
    Scott Chang
    P. S. I played with another project to get the 'Products' object in my database before. Frankly, I don't know where the old 'Products' object and the database are. Please enlighten me in resolving this matter more clearly.
    You welcome Scott, As Olaf mentioned in this post, there was already a table exists , so need to drop your Products table.
    Apart from this, I guess either you did not pasted the full XML file or what, I needed to have the (  </Products>)closing tag in your XML file as follows.
    <Products>
    <Product>
    <SKU>1</SKU>
    <Desc>Book</Desc>
    </Product>
    <Product>
    <SKU>2</SKU>
    <Desc>DVD</Desc>
    </Product>
    <Product>
    <SKU>3</SKU>
    <Desc>Video</Desc>
    </Product>
    </Products>
    You can use following script to drop if your 
    Products table is already existing.
    if exists(select 1 from sys.tables where name ='Products')
    drop table Products
    CREATE TABLE Products(
    sku INT Primary KEY,
    product_desc VARCHAR(30));
    INSERT INTO Products (sku, product_desc)
    SELECT X.product.query('SKU').value('.', 'INT'),
    X.product.query('Desc').value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'H:\ZenProducts.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('Products/Product') AS X(product);
    SELECT sku, product_desc
    FROM Products;
    Let us know if you face any other problem.
    Thanks
    Manish
    Please click Mark as Answer if my post solved your problem and click
    Vote as Helpful if this post was useful.

  • XML Parsing Error: no element found

    Hi,
    I'm working with BIPublisher 11g and I'm having the following error, this error occurred when I'm in the report and try to get the XML :
    XML Parsing Error: no element found
    Location: http://172.16.10.46:9704/xmlpserver/servlet/xdo
    Line Number 4, Column 1:
    And this is the DataEngine log I got:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <debugLog>
    - <msg time="2010-09-29T13:49:03.619+13:00" comp_id="bi_server1" type="NOTIFICATION" level="1" host_id="birepo.nzbus.net" host_addr="172.16.10.46" module="oracle.xdo" tid="45" user="<anonymous>" ecid="0000IhQxgQ15qYG6yzZf6G1Cbv8m0003n8" rid="0">
    <attr name="APP" value="bipublisher#11.1.1.3.0" />
    <txt>ReportModelContextImpl- Invoking dataengine dataprocessor..</txt>
    </msg>
    - <msg time="2010-09-29T13:49:03.817+13:00" comp_id="bi_server1" type="WARNING" level="1" host_id="birepo.nzbus.net" host_addr="172.16.10.46" module="oracle.xdo" tid="45" user="<anonymous>" ecid="0000IhQxgQ15qYG6yzZf6G1Cbv8m0003n8" rid="0">
    <attr name="APP" value="bipublisher#11.1.1.3.0" />
    <txt>java.lang.NullPointerException at oracle.xdo.dataengine.perf.StringPoolList.cleanup(StringPoolList.java:55) at oracle.xdo.dataengine.XMLPGEN.cleanup(XMLPGEN.java:1729) at oracle.xdo.dataengine.XMLPGEN.writeXMLDataStructure(XMLPGEN.java:220) at oracle.xdo.dataengine.XMLPGEN.processDataSet(XMLPGEN.java:1390) at oracle.xdo.dataengine.XMLPGEN.processMergedDataSet(XMLPGEN.java:1203) at oracle.xdo.dataengine.DataProcessor.processData(DataProcessor.java:365) at oracle.xdo.servlet.dataengine.DataProcessor.processData(DataProcessor.java:402) at oracle.xdo.servlet.dataengine.DataProcessor.processData(DataProcessor.java:389) at oracle.xdo.online.data.ClassicDataProcessor.process(ClassicDataProcessor.java:157) at oracle.xdo.servlet.ReportModelContextImpl.getReportXMLData(ReportModelContextImpl.java:188) at oracle.xdo.servlet.CoreProcessor.process(CoreProcessor.java:301) at oracle.xdo.servlet.CoreProcessor.generateDocument(CoreProcessor.java:87) at oracle.xdo.servlet.ReportImpl.renderBodyHTTP(ReportImpl.java:1038) at oracle.xdo.servlet.ReportImpl.renderReportBodyHTTP(ReportImpl.java:603) at oracle.xdo.servlet.XDOServlet.writeReport(XDOServlet.java:440) at oracle.xdo.servlet.XDOServlet.writeReport(XDOServlet.java:419) at oracle.xdo.servlet.XDOServlet.doGet(XDOServlet.java:235) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.xdo.servlet.metadata.track.MostRecentFilter.doFilter(MostRecentFilter.java:64) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.xdo.servlet.security.SecurityFilter.doFilter(SecurityFilter.java:116) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.xdo.servlet.init.InitCheckingFilter.doFilter(InitCheckingFilter.java:63) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)</txt>
    </msg>
    - <msg time="2010-09-29T13:49:03.818+13:00" comp_id="bi_server1" type="NOTIFICATION" level="1" host_id="birepo.nzbus.net" host_addr="172.16.10.46" module="oracle.xdo" tid="45" user="<anonymous>" ecid="0000IhQxgQ15qYG6yzZf6G1Cbv8m0003n8" rid="0">
    <attr name="APP" value="bipublisher#11.1.1.3.0" />
    <txt>Data Generation Completed...</txt>
    </msg>
    - <msg time="2010-09-29T13:49:03.818+13:00" comp_id="bi_server1" type="NOTIFICATION" level="1" host_id="birepo.nzbus.net" host_addr="172.16.10.46" module="oracle.xdo" tid="45" user="<anonymous>" ecid="0000IhQxgQ15qYG6yzZf6G1Cbv8m0003n8" rid="0">
    <attr name="APP" value="bipublisher#11.1.1.3.0" />
    <txt>Total Data Generation Time 0.0 seconds</txt>
    </msg>
    </debugLog>
    Any suggestions.
    Thanks,

    Hi,
    I am getting the same error.
    Do we have a fix for this? The query was working fine until recently. But has started failing now with dataengine log same as above.
    Is there any solution?
    Thanks,
    Divya
    Edited by: 900143 on May 29, 2012 2:03 AM

  • Error in Parsing XML using fx:XML/ [Error- 1090: XML parser failure: element is malformed]

    Hi All,
    I am getting error while loading XML in <fx:XML> tag.
    Error:
    TypeError: Error #1090: XML parser failure: element is malformed.
    MXML Code:
    <fx:Declarations>
    <fx:XML id="xmlSource2" source="sample.xml"/>
    </fx:Declarations>
    Sample XML Used: (sample.xml)
    <?xml version="1.0" encoding="UTF-8"?>
    <File>
        <Chemical id="000035676" displayFormula="C39-H45-N2-O6"
            displayName="Dimethyltubocurarine">
            <NameList>
                <NameOfSubstance>
                    Dimethyltubocurarine
                    <SourceList>
                        <Source>MESH</Source>
                    </SourceList>
                </NameOfSubstance>
                <SystematicName>
                    Tubocuraranium, 6,6',7',12'-tetramethoxy-2,2',2'-trimethyl-
                    <SourceList>
                        <Source>NLM</Source>
                    </SourceList>
                </SystematicName>
                <Synonyms>
                    Dimethyltubocurarine
                    <SourceList>
                        <Source>NLM</Source>
                    </SourceList>
                </Synonyms>
                <Synonyms>
                    Dimethyltubocurarinium
                    <SourceList>
                        <Source>NLM</Source>
                    </SourceList>
                </Synonyms>
                <Synonyms>
                    Methyltubocurarinum
                    <SourceList>
                        <Source>NLM</Source>
                    </SourceList>
                </Synonyms>
            </NameList>
            <NumberList>
                <CASRegistryNumber>
                    35-67-6
                    <SourceList></SourceList>
                </CASRegistryNumber>
                <RelatedRegistryNumber>
                    518-26-3 (iodide.hydriodide)
                    <SourceList>
                        <Source>MESH</Source>
                    </SourceList>
                </RelatedRegistryNumber>
            </NumberList>
            <ClassificationList>
                <ClassificationCode>
                    Neuromuscular nondepolarizing agents
                    <SourceList>
                        <Source>MESH</Source>
                    </SourceList>
                </ClassificationCode>
            </ClassificationList>
            <FormulaList>
                <MolecularFormula>
                    C39-H45-N2-O6
                    <SourceList>
                        <Source>NLM</Source>
                    </SourceList>
                </MolecularFormula>
            </FormulaList>
            <FormulaFragmentList></FormulaFragmentList>
            <NoteList></NoteList>
            <LocatorList>
                <FileLocator
                    url="http://cnetdb.nci.nih.gov/cgi-bin/srchcgi.exe?DBID=****3&SFMT=****_basic%2F10%2F0%2F0&TYPE=search&SRCHFORM=passthru%3D%Asrchform%3ASRCH%3A&FIELD_001=[CAS]35-67-6&#38;GoButton=Search&#38;FIELD_001_CTL=EXPR&#38;FIELD_908=&#38;FIELD908_CTL=HASABSTRACT&#38;FIELD_903=&#38;FIELD_903_CTL=YEARFORE&#38;DOCPAGE=10">CANCERLIT</FileLocator>
                <FileLocator
                    url="http://toxnet.nlm.nih.gov/cgi-bin/sis/search/r?dbs+toxline:@and+@term+@rn+35-67-6+@term+@org+DART">DART/ETIC</FileLocator>
                <FileLocator
                    url="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&db=PubMed&term=35-67-6[ECNO]+OR+&#34;~&#34;[MH]">MEDLINE</FileLocator>
                <FileLocator
                    url="http://www.nlm.nih.gov/cgi/mesh/2K/MB_cgi?term=35-67-6&rn=1">MESH</FileLocator>
                <FileLocator
                    url="http://toxnet.nlm.nih.gov/cgi-bin/sis/search/r?dbs+toxline:@term+@rn+35-67-6+@OR+@mh+""">TOXLINE</FileLocator>
            </LocatorList>
        </Chemical>
    </File>
    Also, when I am using HttpService to load same XML I am getting no such error!!
    <s:HTTPService id="employeeService"
                           url="sample.xml"
                           result="employeeService_resultHandler(event)"
                           fault="employeeService_faultHandler(event)"/>
    Please help!!
    Thanks.
    Abhinav

    I think url in XML is creating problem here.
    <FileLocator
                    url="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&db=PubMed&term=23-95-0[ECNO]+OR+&#34;~&#34;[MH]">MEDLINE</FileLocator>
    Is there any way to parse this XML using <fx:XML/> ??
    Thanks.

  • Exception in thread "main" java.lang.NoClassDefFoundError: oracle/xml/parse

    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/xml/parser/v2/
    XSLException
    Hi
    I have downloaded XDK and was trying to use the XSU feature..
    I unzipped the XDK file, I ran the following query on SQL plus
    select * from emp. It displayed the full table.
    Then i set the class path for XDK,XMLparserv2,oracle JDBC driver and then ran the same query on dos prompt(that is front end command line for java in my case).
    The following is the line i tried to execute on the command prompt
    java OracleXML getXML -user "scott/tiger" -conn "jdbc:oracle:thin:@localhost
    :1521:PomonaT" "select * from emp"
    PomonaT is the db name(Host string i use to enter SQL+)
    I get the following error
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/xml/parser/v2/
    XSLException
    at OracleXML.To_XML(OracleXML.java:1038)
    at OracleXML.ExecuteGetXML(OracleXML.java:917)
    at OracleXML.main(OracleXML.java:184)
    IS SOMETHING MISSING IN MY CLASSPATH??
    IF YES? Could anyone tell what??
    Kunal

    Add xmlparserv2.jar to Classpath & reboot.

  • XML Parse Failure : Diagnostics / workaround requested

    Hey people,
    I don't know if anyone else has had the issue but I have have hit it several times now and its very frustrating. (Usually as a result of trying to remove incorrect schemas via Enterprise Manager).
    If there is ever an invalid XML instance (ie. one that fails to parse) in the XDB views (PATH_VIEW, RESOURCE_VIEW), a select query to return clobs doesn't work. It fails with:
    "ORA-31013 XML Parse Failed"
    "ORA-19202 : Error occurred during XML processing"
    In this case it continues with
    "LPX-00234 : namespace 'ts' is not declared
    Error at line 5
    And some message extension errors and so on and so forth.
    A couple of questions...
    1) Is it actually necessary to validate the XML to return the CLOB value (or an approximation) of a stored XMLType anyway?
    2) Would it be possible to add a validity flag in order be able to restrict against these instances that fail parsing? (For diagnostics / removal purposes).
    3) Is there some other way that I am missing for deleting the invalid resource? Every time I try and find the resource or schema record, the XML processing fails and I can't identify it to delete it (manually or otherwise).
    Any ideas?
    Lachlan

    I'd avoid OEM for the moment
    From SQLPLUS
    call dbms_xdb.deleteResource('path',2) will delete a resource regardless of errors that were encounterd
    Also from ftp
    quot rm_rf path..
    -Mark

  • Diacritic screwing up XML parsing

    Hola -
    I've got a procedure which chews through some database input & produces RSS feeds (as taken from a Tyler Muth posting). It started bailing and I traced it down to a particular entry in the table which has a diacritic, which won't be uncommon for me - the name Çınlar seems to cause XML parsing to fail w/the ff. error:
    ORA-31011: XML parsing failed
    ORA-06512: at "SUPERVISOR.RSSLOOP3", line 30
    ORA-06512: at line 1
    31011. 00000 - "XML parsing failed"
    *Cause:    XML parser returned an error while trying to parse the document.
    *Action:   Check if the document to be parsed is valid.
    Questions are: 1) Why would this be, the data is all coming from the same 10gr2 instance; 2) How can I avoid this? The code for the procedure is below, although I assume this is simply a character set/XML parsing issue I'm unfamiliar with. Many, many thanks for any assistance here. I stand perplexed! I know I can scrub the data with translate but I'm hoping there's a better solution, ideally one which allows me to keep all the diacritics in place.
    create or replace
    procedure rssloop3 ( fund_in IN VARCHAR2)
    is
    -- customizable parameters
    l_title varchar2(255) := ' New Titles Since ' || to_char(sysdate - 90, 'MM/DD/YYYY');
    l_link varchar2(255) := 'replace this' || fund_in || '.rss';
    l_description varchar2(255) := 'This is a feed of changes to items ' || fund_in;
    l_language varchar2(255) := 'en-us';
    -- end customizable parameters
    l_version varchar2(10) := '2.0';
    l_clob clob;
    l_idx pls_integer := 1;
    l_len pls_integer := 255;
    l_defrows pls_integer := 100;
    l_maxrows pls_integer := 100;
    l_desclen pls_integer := 250;
    -- for output to file
    fh UTL_FILE.FILE_TYPE;
    path VARCHAR2(30);
    filename VARCHAR2(30);
    begin
    path := '/iiidb/http/live/screens/rss/';
    filename := fund_in || '.rss';
    fh := UTL_FILE.FOPEN(path, filename, 'w');
    -- fund := fund_in;
    for i in (
    select xmlelement( "rss",
    -- Begin XML Header Block
    xmlattributes( l_version as "version"),
    xmlelement( "channel",
    xmlforest( l_title as "title",
    l_link as "link",
    l_description as "description",
    l_language as "language"),
    -- End XML Header Block
    -- Begin List of Individual Articles or Items
    xmlagg(
    xmlelement( "item",
    xmlelement("title", x.title),
    xmlelement("link", x.link),
    xmlelement("description", x.description),
    xmlelement("callnum", x.callnum),
    xmlelement("pubDate", to_char(x.updated_on,'Dy, DD Mon RRRR hh24:mi:ss')),
    xmlelement("guid", XMLATTRIBUTES('false' as "isPermaLink"),x.id||to_char(x.updated_on,'JHH24MISS'))
    -- End List of Individual Articles or Items
    ) as result
    from ( -- Actual Database Query that populates the list of Items
    select id,title,link,description,updated_on, callnum
    from drx_rss_feeds
    where (fund like fund_in||'%')
    and rownum < (l_maxrows+1)) x)
    loop
    l_clob := xmltype.extract(i.result,'/').getclobval;
    exit;
    end loop; --i
    --- OUTPUT RESULTS
    for i in 1..ceil(dbms_lob.getlength(l_clob)/l_len) loop
    UTL_FILE.PUT_LINE(fh,(substr(l_clob,l_idx,l_len)));
    l_idx := l_idx + l_len;
    end loop; --i
    UTL_FILE.FCLOSE(fh);
    end rssloop3;

    NLS is UTF8 btw.

Maybe you are looking for