Problem to swap XML parser

Hi all,
I am trying to replace the official oracle XML library by apache xerces on a soa suite 10.1.3.1 developper hosted on a linux red hat platform.
I have found a how to on oracle web site (http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-swapxmlparser/doc/readme.html). I hadn't found any archive containing the source so I have buid a simple test using EJB 3 (In fact, I have created a "hello word" session bean that return a String containing the Dom builder factory class name).
I have create the shared library using Entreprise manager as described in the how to.
My test works fine if I deploy it with the default XML factory but if I add the following lines to the orion-application.xml, the deployment process ends with a null pointer exception :
<imported-shared-libraries>
<import-shared-library name="apache.xml" />
<remove-inherited name="oracle.xml" />
</imported-shared-libraries>
I have tried to deploy the test using the entreprise manager web UI (as explain in how to) but the result was the same.
I have tried to remove the "<remove-inherited name="oracle.xml" />" line but in this case, the XML parser still the oracle one.
Do you know if the library specification is available in the last soa suite ?
Thank in advance for your responses.
Alexandre CUCUMEL
PS: I can send the test code source if needed
PS2: here is the complete opmn stack trace when I try to deploy the test application
08/08/08 15:46:36 java.lang.RuntimeException: javax.xml.parsers.FactoryConfigurationError: Provider oracle.xml.jaxp.JXDocumentBuilderFactory could not
be instantiated: java.lang.NullPointerException
08/08/08 15:46:36 at oracle.j2ee.ws.common.processor.Processor.runActions(Processor.java:105)
08/08/08 15:46:36 at oracle.j2ee.ws.common.metadata.annotation.DeploymentGenerator$DeploymentCompileTool.run(DeploymentGenerator.java:205)
08/08/08 15:46:36 at oracle.j2ee.ws.common.metadata.annotation.DeploymentGenerator.generateDeploymentArtifacts(DeploymentGenerator.java:131)
08/08/08 15:46:36 at oracle.j2ee.ws.common.metadata.annotation.EJBWebServiceAnnotationParser.parseAnnotatedBean(EJBWebServiceAnnotationParser.ja
va:165)
08/08/08 15:46:36 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
08/08/08 15:46:36 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
08/08/08 15:46:36 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
08/08/08 15:46:36 at java.lang.reflect.Method.invoke(Method.java:585)
08/08/08 15:46:36 at oracle.j2ee.ws.server.deployment.oc4j.WebServiceAnnotationListener.parseAnnotatedClass(WebServiceAnnotationListener.java:85
08/08/08 15:46:36 at com.evermind.server.ejb.AnnotationParser.notifyAnnotationListeners(AnnotationParser.java:201)
08/08/08 15:46:36 at com.evermind.server.ejb.AnnotationParser.parseAnnotations(AnnotationParser.java:73)
08/08/08 15:46:36 at com.evermind.server.ejb.EJBPackageDeployment.parseMetaData(EJBPackageDeployment.java:939)
08/08/08 15:46:36 at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:832)
08/08/08 15:46:36 at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:217)
08/08/08 15:46:36 at com.evermind.server.Application.setConfig(Application.java:413)
08/08/08 15:46:36 at com.evermind.server.Application.setConfig(Application.java:314)
08/08/08 15:46:36 at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1853)
08/08/08 15:46:36 at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:512)
08/08/08 15:46:36 at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:196)
08/08/08 15:46:36 at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
08/08/08 15:46:36 at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
08/08/08 15:46:36 at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
08/08/08 15:46:36 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
08/08/08 15:46:36 at java.lang.Thread.run(Thread.java:595)
08/08/08 15:46:36 Caused by: javax.xml.parsers.FactoryConfigurationError: Provider oracle.xml.jaxp.JXDocumentBuilderFactory could not be instantiated:
java.lang.NullPointerException
08/08/08 15:46:36 at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:104)
08/08/08 15:46:36 at oracle.j2ee.ws.wsdl.extensions.oracle.schema.SchemaSchemaElement.<init>(SchemaSchemaElement.java:37)
08/08/08 15:46:36 at oracle.j2ee.ws.common.processor.generator.wsdl.WSDLTypeGenerator.generateSchema(WSDLTypeGenerator.java:435)
08/08/08 15:46:36 at oracle.j2ee.ws.common.processor.generator.wsdl.WSDLTypeGenerator.processElement(WSDLTypeGenerator.java:735)
08/08/08 15:46:36 at oracle.j2ee.ws.common.processor.generator.wsdl.WSDLTypeGenerator.processElementsInMessage(WSDLTypeGenerator.java:352)
08/08/08 15:46:36 at oracle.j2ee.ws.common.processor.generator.wsdl.WSDLTypeGenerator.run(WSDLTypeGenerator.java:207)
08/08/08 15:46:36 at oracle.j2ee.ws.common.processor.generator.wsdl.WSDLGenerator.generateTypes(WSDLGenerator.java:291)
08/08/08 15:46:36 at oracle.j2ee.ws.common.processor.generator.wsdl.WSDLGenerator.generateDocument(WSDLGenerator.java:242)
08/08/08 15:46:36 at oracle.j2ee.ws.common.processor.generator.wsdl.WSDLGenerator.doGeneration(WSDLGenerator.java:176)
08/08/08 15:46:36 at oracle.j2ee.ws.common.processor.generator.wsdl.WSDLGenerator.doGeneration(WSDLGenerator.java:141)
08/08/08 15:46:36 at oracle.j2ee.ws.common.processor.generator.wsdl.WSDLGenerator.perform(WSDLGenerator.java:126)
08/08/08 15:46:36 at oracle.j2ee.ws.common.processor.Processor.runActions(Processor.java:97)
08/08/08 15:46:36 ... 23 more
08/08/08 15:46:36 WARNING: Application.setConfig Application: testDeployement is in failed state as initialization failed.
java.lang.InstantiationException: Error initializing ejb-modules: nested exception is: java.lang.NullPointerException
08/08/08 15:46:36 oracle.oc4j.admin.internal.DeployerException: java.lang.InstantiationException: Application: testDeployement is in failed state as i
nitialization failed
08/08/08 15:46:36 at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:515)
08/08/08 15:46:36 at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:196)
08/08/08 15:46:36 at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
08/08/08 15:46:36 at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
08/08/08 15:46:36 at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
08/08/08 15:46:36 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
08/08/08 15:46:36 at java.lang.Thread.run(Thread.java:595)
08/08/08 15:46:36 Caused by: java.lang.InstantiationException: Application: testDeployement is in failed state as initialization failed
08/08/08 15:46:36 at com.evermind.server.Application.setConfig(Application.java:471)
08/08/08 15:46:36 at com.evermind.server.Application.setConfig(Application.java:314)
08/08/08 15:46:36 at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1853)
08/08/08 15:46:36 at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:512)
08/08/08 15:46:36 ... 6 more
08/08/08 15:46:36 Caused by: java.lang.InstantiationException: Error initializing ejb-modules: nested exception is: java.lang.NullPointerException
08/08/08 15:46:36 at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:1064)
08/08/08 15:46:36 at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:217)
08/08/08 15:46:36 at com.evermind.server.Application.setConfig(Application.java:413)
08/08/08 15:46:36 ... 9 more
08/08/08 15:46:36 Caused by: javax.ejb.EJBException: nested exception is: java.lang.NullPointerException
08/08/08 15:46:36 at com.evermind.server.ejb.EJBUtils.createEJBException(EJBUtils.java:365)
08/08/08 15:46:36 at com.evermind.server.ejb.EJBUtils.createEJBException(EJBUtils.java:356)
08/08/08 15:46:36 at oracle.j2ee.ws.server.deployment.oc4j.WebServiceAnnotationListener.parseAnnotatedClass(WebServiceAnnotationListener.java:92
08/08/08 15:46:36 at com.evermind.server.ejb.AnnotationParser.notifyAnnotationListeners(AnnotationParser.java:201)
08/08/08 15:46:36 at com.evermind.server.ejb.AnnotationParser.parseAnnotations(AnnotationParser.java:73)
08/08/08 15:46:36 at com.evermind.server.ejb.EJBPackageDeployment.parseMetaData(EJBPackageDeployment.java:939)
08/08/08 15:46:36 at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:832)
08/08/08 15:46:36 ... 11 more
08/08/08 15:46:36 Caused by: java.lang.NullPointerException
08/08/08 15:46:36 at oracle.j2ee.ws.common.metadata.annotation.DeploymentGenerator.generateDeploymentArtifacts(DeploymentGenerator.java:138)
08/08/08 15:46:36 at oracle.j2ee.ws.common.metadata.annotation.EJBWebServiceAnnotationParser.parseAnnotatedBean(EJBWebServiceAnnotationParser.ja
va:165)
08/08/08 15:46:36 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
08/08/08 15:46:36 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
08/08/08 15:46:36 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
08/08/08 15:46:36 at java.lang.reflect.Method.invoke(Method.java:585)
08/08/08 15:46:36 at oracle.j2ee.ws.server.deployment.oc4j.WebServiceAnnotationListener.parseAnnotatedClass(WebServiceAnnotationListener.java:85
08/08/08 15:46:36 ... 15 more
08/08/08 15:46:36 WARNING: DeployerRunnable.run java.lang.InstantiationException: Application: testDeployement is in failed state as initialization fa
iledoracle.oc4j.admin.internal.DeployerException: java.lang.InstantiationException: Application: testDeployement is in failed state as initialization
failed
at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:126)
at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.InstantiationException: Application: testDeployement is in failed state as initialization failed
at com.evermind.server.Application.setConfig(Application.java:471)
at com.evermind.server.Application.setConfig(Application.java:314)
at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1853)
at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:512)
at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:196)
at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
... 4 more
Caused by: java.lang.InstantiationException: Error initializing ejb-modules: nested exception is: java.lang.NullPointerException
at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:1064)
at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:217)
at com.evermind.server.Application.setConfig(Application.java:413)
... 9 more
Caused by: javax.ejb.EJBException: nested exception is: java.lang.NullPointerException
at com.evermind.server.ejb.EJBUtils.createEJBException(EJBUtils.java:365)
at com.evermind.server.ejb.EJBUtils.createEJBException(EJBUtils.java:356)
at oracle.j2ee.ws.server.deployment.oc4j.WebServiceAnnotationListener.parseAnnotatedClass(WebServiceAnnotationListener.java:92)
at com.evermind.server.ejb.AnnotationParser.notifyAnnotationListeners(AnnotationParser.java:201)
at com.evermind.server.ejb.AnnotationParser.parseAnnotations(AnnotationParser.java:73)
at com.evermind.server.ejb.EJBPackageDeployment.parseMetaData(EJBPackageDeployment.java:939)
at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:832)
... 11 more
Caused by: java.lang.NullPointerException
at oracle.j2ee.ws.common.metadata.annotation.DeploymentGenerator.generateDeploymentArtifacts(DeploymentGenerator.java:138)
at oracle.j2ee.ws.common.metadata.annotation.EJBWebServiceAnnotationParser.parseAnnotatedBean(EJBWebServiceAnnotationParser.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at oracle.j2ee.ws.server.deployment.oc4j.WebServiceAnnotationListener.parseAnnotatedClass(WebServiceAnnotationListener.java:85)
... 15 more

Andre,
Thanks for your interest on my problem.
In fact, I have created a test with just an interface and a class. No additional jars are added at compilation or ejb creation time.
My java code is very simple (I have just copied the example main method and convert it to a SOAP method :
package be.test;
import javax.ejb.Stateless;
import javax.jws.WebService;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@Stateless
@WebService(endpointInterface = "be.test.Test")
public class TestImpl implements Test {
     public String test() {
          DocumentBuilder builder=null;
          DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          try
          builder = factory.newDocumentBuilder();
          return "<BR><B>DocumentBuilderFactory Instance:</B> " + factory.getClass().getName() +
          "<BR><B>DocumentBuilder Instance:</B> " + builder.getClass().getName() +"<BR>"; }
          catch (Exception e)
          return "Error processing DOM -- " + e.getMessage();
Unfortunately, I think that the problem may come from EJB 3 stack that does not support an other XML library.
Thanks again for your help.
Best regards,
Alexandre
PS: appologies for the message formatting... I don't understand why the new line caracters are not corrects.

Similar Messages

  • 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 parsing problems with Oracle XML parser for PL/SQL

    I am using the Oracle XML parser for PL/SQL to transform XML into HTML usign XSL. The parser gives me sporadic errors trying to parse various XML documents. For the same XML source, the XMLPARSER will parse without errors one day and the next day will give me errors such as "invalid char in text", "Expected ';'.", or even Java null pointer exceptions.
    I have verified that the XML sources are well formed, so I am pretty certain that the problems I am having are bugs in the XMLPARSER.
    Is there going to be a XML parser for PL/SQL version 2 that will fix these bugs? If so, when??? If not, is there anything else I could do to fix these problems?
    Thanks!

    You can use the latest version.

  • Problems with namespace XML Parsing of ABAP PI 7.0 Integration Engine

    Hi,
    I discovered the following problem.
    The customer sends a SOAP message with is forwarded through a SOAP Adapter in the integration engine.
    The structure of the message is very simple:
    <Envelope>
    <Body>
    <ORDERS05>...</ORDERS05>
    </Body>
    </Envelope>
    The customer adds the namespace information a special way:
    <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope">
    <Body>
    <orders05 xmlns="">...</orders05>
    </Body>
    <Envelope>
    Here the namespaces is declared in the first element. It should be inherited into all child elements. The 'orders05' should not have the namespace ' xmlns="http://schemas.xmlsoap.org/soap/envelope" ', therefore the namespace is overwritten with ' xmlns="" '. However I don't know if this is a correct xml statement, the SAP system did not understand this.
    The integration throws an error which is stated in the message in the adapter engine:
    2008-11-06 17:31:44 Fehler SOAPFault empfangen vom Integration Server. ErrorCode/Category: XIProtocol/ITEM_MISSING; Params: /@mustUnderstand, ST: ST_XMS_MSGHDR30_RM; AdditionalText: Attribut 'mustUnderstand' erwartet; ApplicationFaultMessage: ; ErrorStack: Das XML-Element /@mustUnderstand fehlt im SOAP-Message Header (SAP XI Extension) Attribut 'mustUnderstand' erwartet
    2008-11-06 17:31:44 Fehler Fehler beim Übertragen der Message zum Endpunkt http://kas052.hauni.koerber.de:8036/sap/xi/engine?type=entry über die Verbindung SOAP_http://sap.com/xi/XI/System. Grund: com.sap.aii.af.ra.ms.api.RecoverableException: Received HTTP response code 500 : Error during parsing of SOAP header
    If I changed the SOAP message to the common format, it is accepted by the integration engine.
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope">
    <SOAP:Body>
    <orders05>...</orders05>
    </SOAP:Body>
    </SOAP:Envelope>
    Here the namespace ' xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope" ' is defined with a prefix and assigned to the elements 'envelope' and 'body'. The 'orders05' element has no namespace.
    However due to the xml syntax both messages are the same, so why the integration engine handle the messages different?
    Best regards,
    Nils Kloth

    The valid SOAP format supported by XI is as follows
    <SOAP:Envelope
      xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
      <SOAP:Body>
        <m:MessageTypeName xmlns:m="Some-URI">
          <Price>34.5</Price>
        </m:MessageTypeName>
      </SOAP:Body>
    </SOAP:Envelope>
    Ur sender system is not sending the data in correct Soap format and thats the cause of message rejection. The option you have to use the Soap adapter in "no soap" mode.
    Regards,
    Prateek

  • Xslproceesor problem and new xml parser.

    I'm curious how I can use javascript in xsl. I can use user defined script with xsl which provided by Microsoft. but I'm not sure with oracle. I heard that it's possible to use that. so I wanna know that.
    I need exact example to use this.
    This is an example for msxsl. if anybody know this to use with oracle. please let me know.
    and I need new xmlparserv2_2029, where can I get it? thanks. please let me know.
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              xmlns:msxsl="http://www-microsoft-com/XSL/Transform/"
              xmlns:user="urn:my-scripts"
    version="1.0">
    <msxsl:script language="JAVAScript" implements-prefix="user">
    </msxsl:script>

    Thanks for the pointers! I hadn't encountered lazy-DOM before. It sounds like an interesting idea, although I think its goal is quite different from PAX. I found the following quote in a description of it on the Xerces website: "This shortens the time it takes to parse an XML file and create a DOM tree at the expense of requiring more memory during parsing and traversing the document." So it takes even more memory than a standard DOM parser.
    I'll definitely check out the xml.org discussion list. I've been looking for a good place to get feedback, and this board seemed like a likely candidate.
    Peter

  • Oracle XML parser and IBM jdk bug

    Hello,
    From a few messages found in the XML forum it seems that IBM jvm could cause problems with oracle XML parser. ( see http://technet.oracle.com:89/ubb/Forum11/HTML/003823.html )
    I am using IBM jvm (jdk 1.3) on a linux box, and problems are starting to arise:
    I have
    - 1 BC4J based jsp app which works fine.
    - 2 XML parsing BC4J apps which cause strange errors (like parsing 40 documents fine and failing on the 41st for no apparent reason)
    Hopefully, Steven Muench provided precious advice on this (basically, disabling the JIT), however some issues are still open:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>You should file a bug with IBM to get this fixed, using your stylesheet as a testcase. Lots of people have hit this problem.<HR></BLOCKQUOTE>
    Has anyone (from oracle or else) done this yet? I have gone (quickly) through IBM website but I didn't find any bug report utility or the like...
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Disable your JIT compiler (or switch JVM's) and you won't have the error.<HR></BLOCKQUOTE>
    Turning off the JIT indeed made the errors vanish, thanks a lot for the tip!
    I have a few more questions though :
    * As the BC4J framework uses the xml parser, It is fairly possible that the ibm jvm bug will affect it...
    I haven't had any problems (yet?) with the BC4J part of my applications, but I'm a bit concerned about having random bugs lurking around (I have more than enough of my own :) )
    Has anyone stumbled upon IBM JVM vs oracle parser issues in BC4J? (oracle.xml.parser.v2.XXXXXX exceptions...)
    * If BC4J is indeed affected, what's the solution?
    - Disable the JIT? (And forget about performance?... hmmm... no)
    - Switch parsers? (oracle parser is too tightly integrated in the BC4J Framework isn't it?.. hmm... not possible either)
    - Wait for a patch from IBM (and use another one in the meantime) / switch JVM :
    In either case, I'd really like to know what is the JVM that oracle people use / would advise.
    Thanks for your help
    null

    For those interested,
    last week i reported this bug in the ibm jvm news forum.
    They said that the problem had been investigated and would be fixed in their next service release.
    FYI: the current release (SR7, labeled "build cx130-20010329) still has various problems wih oracle XML parser.
    Remi
    null

  • XML Parser Limitations?

    I'm having problems using the XML Parser from
    Oracle. I've encountered this both in the
    transviewer beans as well as my own implemenatation of the parser.
    The problem occurs when I use an XSL document with a for-each declarative in it. Internet Explorer successfully parses an XML document using this XLS file, but when I use the Oracle Transviewer, the data from the XML document is not parsed into the output.
    Is this an error of mine or a limitation of XML Parser?
    Here are my XML and XLS docs:
    <?xml version = '1.0'?><?xml-stylesheet type="text/xsl" href="cd.xsl"?>
    <PatientSummary>
    <PATIENT>
    <PatName>JONES
    </PatName>
    <PatFirstName>FRED Z
    </PatFirstName>
    <PatGenderCode>M
    </PatGenderCode>
    <PatBirthDtm>06Jul1976
    </PatBirthDtm>
    <PatPrimAddressStreet>123 Main Street
    </PatPrimAddressStreet>
    <PatPrimAddressPost>498555
    </PatPrimAddressPost>
    <PatPrimAddressCity>Edmonton
    </PatPrimAddressCity>
    <PatPrimPhoneNum>6045374321
    </PatPrimPhoneNum>
    </PATIENT>
    <PATIENT>
    <PatName>JONES
    </PatName>
    <PatFirstName>FRED Z
    </PatFirstName>
    <PatGenderCode>M
    </PatGenderCode>
    <PatBirthDtm>06Jul1976
    </PatBirthDtm>
    <PatPrimAddressStreet>123 Main Street
    </PatPrimAddressStreet>
    <PatPrimAddressPost>498555
    </PatPrimAddressPost>
    <PatPrimAddressCity>Edmonton
    </PatPrimAddressCity>
    <PatPrimPhoneNum>6045374321
    </PatPrimPhoneNum>
    </PATIENT>
    </PatientSummary>
    <?xml version = '1.0'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
    <xsl:template match="/">
    <html>
    <body>
    <xsl:for-each select="PatientSummary/PATIENT">
    <table border="2" bgcolor="yellow">
    <tr>
    <td>
    <xsl:value-of select="PatName"/>
    </td>
    </tr>
    <tr>
    <td>
    <xsl:value-of select="PatFirstName"/>
    </td>
    </tr>
    <tr>
    <td>
    <xsl:value-of select="PatGenderCode"/>
    </td>
    </tr>
    <tr>
    <td>
    <xsl:value-of select="PatBirthDtm"/>
    </td>
    </tr>
    <tr>
    <td>
    <xsl:value-of select="PatPrimAddressStreet"/>
    </td>
    </tr>
    <tr>
    <td>
    <xsl:value-of select="PatPrimAddressPost"/>
    </td>
    </tr>
    </table>
    </xsl:for-each>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>
    null

    Hi,
    For the XSL file, you need to use
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0" version="1.0">
    instead of
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
    We were able to parse the file with this modification. If this does not solve your problem, please provide us with some description of the error that you are getting.
    Thank you,
    Oracle XML Team

  • XML parsing problem

    Hi, my problem is :
    In my Application i want to parse an XML file with DOM parser. The problem is that in my Project "MyProject -> Project Properties -> Libraries and Classpath"
    I have included some 15 libraries which are useful for my Application: ADF Faces Runtime 11, ADF Web Runtime and etc.
    Problems are causing the libraries: BC4J Runtime,ADF Model Runtime, MDS Runtime Dependencies
    because when added my source which is parsing an XML file stops working.The source code is:
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    File file =
    new File("C:\\Documents and Settings\\ilia\\Desktop\\begin.xml");
    Document doc = db.parse(file);
    Element root = doc.getDocumentElement();
    NodeList dots = root.getElementsByTagName("w:t");
    Element firstDot = (Element)dots.item(0);
    String textValue = firstDot.getFirstChild().getNodeValue();
    I use DOM because i need to change some values in the XML file, but its not working neither for reading nor for writing.When debugging I see that it gets the root of the xml but " firstDot.getFirstChild().getNodeValue() " returns null and it breaks with NullPointerException. And that's only when the libraries mentioned above are added to the project. Without them it works just fine !
    I don't know, it's like when added the parser validates my xml against some schema and returns null.
    The xml file is very simple MS Word Document saved as .xml .But I don't think that's the problem.
    Thanks in advance !
    iliya

    Hi all,
    I found the solution to my problem.The right way to parse and change an XML file with DOM parser using the Oracle XML Parser v2 should look like this:
    JXDocumentBuilderFactory factory =
    (JXDocumentBuilderFactory)JXDocumentBuilderFactory.newInstance();
    JXDocumentBuilder documentBuilder =
    (JXDocumentBuilder)factory.newDocumentBuilder();
    File file = new File("c:/Documents and Settings/ilia/Desktop/begin.xml");
    InputStream input =
    new FileInputStream(file);
    XMLDocument xmlDocument = (XMLDocument)(documentBuilder.parse(input));
    System.out.println("Encoding: " + xmlDocument.getEncoding());
    System.out.println("Version: " + xmlDocument.getVersion());
    NodeList namespaceNodeList =
    xmlDocument.getElementsByTagNameNS("http://schemas.microsoft.com/office/word/2003/wordml","t");
    XMLElement namespaceElement17 = (XMLElement)namespaceNodeList.item(17);
    namespaceElement17.getFirstChild().setNodeValue("someString");

  • WIJ 20002 xml Parser Problem - Rich Client

    Hi,
    I have a problem with the rich client on a new installation:
    Business Objects Enterprise XI 3.1 SP3 on Windows 2008 Standard.
    If I connect with the rich client "import document"is disabled.
    if I try to create a new document from the rich client it returns the error below (I used the rich client on two workstations):
    WIJ 20002
    Version: null
    Analisi dello stack:
    java.lang.RuntimeException: java.lang.RuntimeException: XML parser problem:
    XMLJaxpParser.parse(): Element type "ABOUT_Patentnumbers" must be followed by either attribute specification, ">" or "/>".
    at com.businessobjects.wp.xml.jaxp.XMLJaxpParser.parse (Unknown Source)
    at.com.businessobjects.webi.richclient.XMLviaOccaRC.getServerConfiguration (Unknown Source)
    Have you any solution?

    The fixpack 3.5 client resolves the problem.

  • XML Parser Problem

    am using XML parser for PL/SQL in Oracle9i Enterprise Edition Release 9.0.1.1.1
    When i run the sample xml program, i get error which is as follows. While compiling no errors. But while executing it reports error as given below.
    SQL> execute domsample('c:\xml', 'family.xml', 'errors.txt');
    begin domsample('c:\xml', 'family.xml', 'errors.txt'); end;
    ORA-20100: Error occurred while parsing: No such file or directory
    ORA-06512: at "COMMODITYBACKCONNECT.XMLPARSER", line 22
    ORA-06512: at "COMMODITYBACKCONNECT.XMLPARSER", line 79
    ORA-06512: at "COMMODITYBACKCONNECT.DOMSAMPLE", line 80
    ORA-06512: at line 1
    What need to be done to rectify the above problem.
    when i do the following validation check
    SQL>
    SQL> select substr(dbms_java.longname(object_name),1,30) as class, status
    2 from all_objects
    3 where object_type = 'JAVA CLASS'
    4 and object_name = dbms_java.shortname('oracle/xml/parser/v2/DOMParser')
    5 ;
    CLASS STATUS
    oracle/xml/parser/v2/DOMParser VALID
    oracle/xml/parser/v2/DOMParser VALID
    Please advice to how remove the following error:
    ORA-20100: Error occurred while parsing: No such file or directory

    Found the solution on metalink. There is a file under /$ORACLE_HOME/javavm/install/init_security.sql
    which needs to be run under username where you are installing xml parser.
    This step is not in readme.txt file provided as a part of download from the OTN website.

  • XMl parser version problem for running struts project in jdeveloper 10.1.3

    Dear All.
    I am trying to run a struts (v 1.2.9) based project in Jdeveloper 10.1.3.1.0.The struts version in Jdeveloper is 1.1.
    when i am trying to run the index.jsp i get an error:
    org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/validation/dynamic
    I think the XML parser version is a problem.Jdeveloper has OracleXMLParser v2 and i think the XML Parser apis used in building the project is different.I have placedcustiom xml parser apis and the xerces.jar in the jdevbin/jdev/lib folder and included these jar in the bootclasspath as follows:
    AddVMOption -Xbootclasspath/p:../lib/xml-apis.jar
    AddVMOption -Xbootclasspath/p:../lib/xerces-2.6.2.jar
    But even then the Exception persists.Is the syntax for Xbootclasspath wrong or i need to place these custom api's in some other location of jdev.
    I am not being able to figure out the XMl parser problem.
    Any help wud be great.
    Is it that i cant run the project in jdeveloper.Just to mention the application is deployed in OC4J on the server and runs fine..But its only that i kant run it locally through jdeveloper

    I am also facing the same issue on my laptop. I searched for forum but no luck.
    appreciate if anybody can throw some light on this.

  • Problem in XML Parsing via oracle procedure...

    Hi,
    I wrote one oracle procedure for xml parsing.
    I have one valid xml file which has "encode UTF-8". The XML file contains some comments also. While we are parsing the xml file at that time it is not parse successfully and also it is not giving any error. After the following line it is skip rest of the codes(lines).
    dbms_xmlparser.parseclob(l_parser, l_clob);
    At the end of the xml file there are some comments which is like "<!-- abc --> ".
    When I am changing the "encode UTF-8 to ISO-88596-1" & removing the comments which wrote on bottom of the file then its working fine, but the files which we are getting from the system is contains the encode UTF-8 and we don't want to preprocess on that xml files. Even if we will do that via shell script or perl script then it will be overhead to the system and in a single stroke our system will parse more than 5k xml files, so if we will do some preprocess on it, it will take some more time approx 1-2 minutes extra.
    So, If someone knows any solution of this problem, then please guide & help me on this.
    My xml file structure is as follows:-
    <?xml version="1.0" encoding="UTF-8"?>
    <mcd xmlns:HTML="http://www.w3.org/TR/REC-xml">
         <child>
              <child1>32.401 V5.5</child1>
              <child2>ZoneGate</child2>
         </child>
         <mc>
              <newid>
                   <id>12</id>
              </newid>
              <mindex>
                   <date>20111102180000</date>
                   <mt>abc1</mt>
                   <mt>abc2</mt>
                   <mvalue>
                        <r>val_1</r>
                        <r>val_2</r>
                   </mvalue>
              </mindex>
         </mc>
    </mcd>
    <!--
    ALARM STATUS
    morning 10
    afternoon 14
    evening 18
    night 22
    -->
    <!--
    PARAM:EID = 1
    PARAM:GId = 3
    PARAM:GSId = 0
    --!>
    And my oracle procedure is as follows:-
    create or replace procedure loadXMLtotable(dir_name IN varchar2, xmlfile IN varchar2) AS
    -- Defining the variables
    ecode               NUMBER;
    emesg           VARCHAR2(200);
    l_bfile      BFILE;
    l_clob      CLOB;
    l_dest_offset      INTEGER:=1;
    l_src_offset      INTEGER:=1;
    l_Char_set_id      NUMBER := NLS_CHARSET_ID('UTF8');
    l_lang_context      INTEGER := dbms_lob.default_lang_ctx;
    l_warning           INTEGER;
    l_parser dbms_xmlparser.Parser;
    l_doc dbms_xmldom.DOMDocument;
    l_nl1 dbms_xmldom.DOMNodeList;
    l_nl2 dbms_xmldom.DOMNodeList;
    l_n dbms_xmldom.DOMNode;
    node1 dbms_xmldom.DOMNode;
    colid integer ; -- column id used for identifying which column it belongs.
    l_xmltype XMLTYPE;
    sub_xmltype XMLTYPE;
    num_nodes number;
    l_index PLS_INTEGER;
    l_subIndex           PLS_INTEGER;
    starttime Date;
         temp_datatime VARCHAR(25);
    columnname varchar2(300);
    columnvalue varchar2(300);
    -- creating a Type which is a type of "test_hem" table RowType, which I created in SVN server
    TYPE tab_type IS TABLE OF test_hem%ROWTYPE;
    t_tab tab_type := tab_type();
    BEGIN
    -- Passing the xmlfile and virtual directory name which we gave at the time of directory creation
    l_bfile := BFileName('MY_FILES', xmlfile);
    dbms_lob.createtemporary(l_clob, cache=>FALSE);
    dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
    --dbms_lob.loadFromFile(dest_lob => l_clob,
    -- src_lob => l_bfile,
    -- amount => dbms_lob.getLength(l_bfile));
    dbms_lob.loadclobfromfile(l_clob, l_bfile, dbms_lob.getlength(l_bfile),
    l_dest_offset, l_src_offset, l_Char_set_id, l_lang_context, l_warning);
    dbms_lob.close(l_bfile);
    -- make sure implicit date conversions are performed correctly
    dbms_session.set_nls('NLS_DATE_FORMAT','''YYYY-MON-DD HH24:MI:SS''');
    dbms_output.put_line('Date format set');
    -- Create a parser.
    l_parser := dbms_xmlparser.newParser;
    dbms_output.put_line('output 1');
    -- Parse the document and create a new DOM document.
    dbms_xmlparser.parseclob(l_parser, l_clob);
    dbms_output.put_line(' passed parsing');
    l_doc := dbms_xmlparser.getDocument(l_parser);
    dbms_output.put_line(' passed getdocument');
    -- Free resources associated with the CLOB and Parser now they are no longer needed.
    dbms_lob.freetemporary(l_clob);
    dbms_xmlparser.freeParser(l_parser);
    -- Get a list of all the EMP nodes in the document using the XPATH syntax.
    l_nl1 := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'//mcd/child');
    -- Loop through the list and create a new record in a tble collection
    FOR cur_sel IN 0 .. dbms_xmldom.getLength(l_nl1) - 1 LOOP
    l_n := dbms_xmldom.item(l_nl1, cur_sel);
    t_tab.extend;
    -- Use XPATH syntax to assign values to he elements of the collection.
    dbms_xslprocessor.valueOf(l_n,'child1/text()',t_tab(t_tab.last).country);
    -- putting the state and vendorname into the table rowtype
    dbms_xslprocessor.valueOf(l_n,'child2/text()',t_tab(t_tab.last).state);
    END LOOP;
    -- getting the version and putting into the table rowtype
    l_n := dbms_xslprocessor.selectSingleNode(dbms_xmldom.makeNode(l_doc),'//mcd/mc/newid/id');
    dbms_xslprocessor.valueOf(l_n,'id/text()',t_tab(t_tab.last).id);
    -- selecting the nodes whose starting tag is "mindex"
    l_nl1 := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'//mcd/mc/mindex');
    -- checking the total number of nodes whose starting through "mi"
    num_nodes := dbms_xmldom.getLength(l_nl1);
    l_index := 1;
    -- For loop to iterate the nodes.
    FOR cur_sel IN 0 .. dbms_xmldom.getLength(l_nl1) - 1 LOOP
    -- whole current node is selected and storing into the node1 variable
    node1 := dbms_xmldom.item(l_nl1, cur_sel);
    -- setting the xmltype as AL32UTF8
    l_xmltype := xmltype(l_bfile, nls_charset_id('AL32UTF8'));
    -- if selecting parent node containing the mt child node then only proceed else skip that parent node.
    IF (l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mt') > 0 and l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mvalue/r') > 0) Then
    -- fetch the datatime, convert it into to_date format and store it into table rowtype
    temp_datatime := dbms_xslprocessor.valueOf(node1, 'date/text()');
    t_tab(t_tab.last).data_time := to_char(to_date(temp_datatime, 'YYYYMmcDHH24MISS'));
    l_subIndex := 1;
                                  while (l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mt[' || l_subIndex || ']') > 0 and l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mvalue/r['|| l_subIndex || ']') > 0 ) LOOP
                                  -- getting mt and corresponging mvalue/r values
    dbms_xslprocessor.valueOf(node1,'mt[' || l_subIndex || ']/text()',columnname);
    dbms_xslprocessor.valueOf(node1,'mvalue/r[' || l_subIndex || ']/text()',columnvalue);
    l_subIndex := l_subIndex + 1;
    -- getting the column to which this mapping belongs.
    select columnid into colid from abc_table where columnname=name;
    CASE colid
    WHEN 1 THEN t_tab(t_tab.last).col1 := columnvalue;
                             WHEN 2 THEN t_tab(t_tab.last).col2 := columnvalue;
                             WHEN 3 THEN t_tab(t_tab.last).col3 := columnvalue;
    ELSE dbms_output.put_line('No column mapping for counter ' || columnname) ;
    END CASE; -- end of case statement.
    END LOOP;
    -- Insert data into the real table from the table collection.
    FORALL i IN t_tab.first .. t_tab.last
    INSERT INTO test_hem VALUES t_tab(i);
    END IF;
    l_index := l_index + 1;
    COMMIT;
    END LOOP;
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    ecode := SQLCODE;
    emesg := SQLERRM;
    dbms_output.put_line(TO_CHAR(ecode) || '-' || emesg);
         dbms_lob.freetemporary(l_clob);
         dbms_xmlparser.freeParser(l_parser);
         dbms_xmldom.freeDocument(l_doc);
    END;

    Sorry Odie,
    I am new to this site as well as PL/SQL. I am giving additional details which you had mentioned in your last comments.
    our Oracle Database version is "10.2.0.4.0"
    The structure of target table Instrument_Details is as follows:
    Create table Instrument_Details (
    instrument_id          Integer  Primary Key,
    provider_name          Varchar2(32),
    version_number          Varchar2(32),
    location_id                  Integer,
    installation_date             Date,
    granularity                  Integer,
    time_out                  Integer );
    Note:- Here test_hem is alias of Instrument_details.
    Here instrument_id is a primary key.
    provider_name contains the child2 xml tag value.
    version_number contains the child1 xml tag value.
    location_id contains the newid/id value which is map to other table which fetching the location name corresponding to the location_id.
    installation_date contains the date xml tag value.
    Now we have created one mapping tables where we mapped the xml tag values "mt" with table column name means "abc1 = granularity", "abc2 = time_out" in that table.
    these table column value are written under mvalue xml tag.
    _Our Database Character set is_:-
    NLS_CHARACTERSET WE8ISO8859P1
    Now as you suggest me to format your code. I am writing the xml code and procedure code again.
    My xml file structure is as follows:-
    <?xml version="1.0" encoding="UTF-8"?>
    <mcd xmlns:HTML="http://www.w3.org/TR/REC-xml">
      <child>
          <child1>32.401 V5.5</child1>
          <child2>ZoneGate</child2>
      </child>
      <mc>
          <newid>
               <id>12</id>
          </newid>
      <mindex>
           <date>20111102180000</date>
           <mt>abc1</mt>
           <mt>abc2</mt>
           <mvalue>
                 <r>val_1</r>   -- here val_1 and val_2 are numeric values
                 <r>val_2</r>
            </mvalue>
      </mindex>
      </mc>
    </mcd>
    <!--
    ALARM STATUS
    morning 10
    afternoon 14
    evening 18
    night 22
    -->
    <!--
    PARAM:EID = 1
    PARAM:GId = 3
    PARAM:GSId = 0
    --!> And my oracle procedure is as follows:-
    create or replace procedure loadXMLtotable(dir_name IN varchar2, xmlfile IN varchar2) AS
    -- Defining the variables
    ecode NUMBER;
    emesg VARCHAR2(200);
    l_bfile BFILE;
    l_clob CLOB;
    l_dest_offset INTEGER:=1;
    l_src_offset INTEGER:=1;
    l_Char_set_id NUMBER := NLS_CHARSET_ID('UTF8');
    l_lang_context INTEGER := dbms_lob.default_lang_ctx;
    l_warning INTEGER;
    l_parser dbms_xmlparser.Parser;
    l_doc dbms_xmldom.DOMDocument;
    l_nl1 dbms_xmldom.DOMNodeList;
    l_nl2 dbms_xmldom.DOMNodeList;
    l_n dbms_xmldom.DOMNode;
    node1 dbms_xmldom.DOMNode;
    colid integer ; -- column id used for identifying which column it belongs.
    l_xmltype XMLTYPE;
    sub_xmltype XMLTYPE;
    num_nodes number;
    l_index PLS_INTEGER;
    l_subIndex PLS_INTEGER;
    starttime Date;
    temp_datatime VARCHAR(25);
    columnname varchar2(300);
    columnvalue varchar2(300);
    -- creating a Type which is a type of "Instrument_Details" table RowType, which I created in SVN server
    TYPE tab_type IS TABLE OF Instrument_Details%ROWTYPE;
    t_tab tab_type := tab_type();
    BEGIN
    -- Passing the xmlfile and virtual directory name which we gave at the time of directory creation
    l_bfile := BFileName('MY_FILES', xmlfile);
    dbms_lob.createtemporary(l_clob, cache=>FALSE);
    dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
    --dbms_lob.loadFromFile(dest_lob => l_clob,
    -- src_lob => l_bfile,
    -- amount => dbms_lob.getLength(l_bfile));
    dbms_lob.loadclobfromfile(l_clob, l_bfile, dbms_lob.getlength(l_bfile),
    l_dest_offset, l_src_offset, l_Char_set_id, l_lang_context, l_warning);
    dbms_lob.close(l_bfile);
    -- make sure implicit date conversions are performed correctly
    dbms_session.set_nls('NLS_DATE_FORMAT','''YYYY-MON-DD HH24:MI:SS''');
    dbms_output.put_line('Date format set');
    -- Create a parser.
    l_parser := dbms_xmlparser.newParser;
    dbms_output.put_line('output 1');
    -- Parse the document and create a new DOM document.
    dbms_xmlparser.parseclob(l_parser, l_clob);
    *-- Below lines are skipping....*
    dbms_output.put_line(' passed parsing');
    l_doc := dbms_xmlparser.getDocument(l_parser);
    dbms_output.put_line(' passed getdocument');
    -- Free resources associated with the CLOB and Parser now they are no longer needed.
    dbms_lob.freetemporary(l_clob);
    dbms_xmlparser.freeParser(l_parser);
    -- Get a list of all the EMP nodes in the document using the XPATH syntax.
    l_nl1 := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'//mcd/child');
    -- Loop through the list and create a new record in a tble collection
    FOR cur_sel IN 0 .. dbms_xmldom.getLength(l_nl1) - 1 LOOP
    l_n := dbms_xmldom.item(l_nl1, cur_sel);
    t_tab.extend;
    -- Use XPATH syntax to assign values to he elements of the collection.
    dbms_xslprocessor.valueOf(l_n,'child1/text()',t_tab(t_tab.last).country);
    -- putting the state and vendorname into the table rowtype
       dbms_xslprocessor.valueOf(l_n,'child2/text()',t_tab(t_tab.last).state);
    END LOOP;
    -- getting the version and putting into the table rowtype
       l_n := dbms_xslprocessor.selectSingleNode(dbms_xmldom.makeNode(l_doc),'//mcd/mc/newid/id');
      dbms_xslprocessor.valueOf(l_n,'id/text()',t_tab(t_tab.last).id);
    -- selecting the nodes whose starting tag is "mindex"
      l_nl1 := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'//mcd/mc/mindex');
    -- checking the total number of nodes whose starting through "mi"
      num_nodes := dbms_xmldom.getLength(l_nl1);
    l_index := 1;
      -- For loop to iterate the nodes.
      FOR cur_sel IN 0 .. dbms_xmldom.getLength(l_nl1) - 1 LOOP
      -- whole current node is selected and storing into the node1 variable
      node1 := dbms_xmldom.item(l_nl1, cur_sel);
      -- setting the xmltype as AL32UTF8
       l_xmltype := xmltype(l_bfile, nls_charset_id('AL32UTF8'));
      -- if selecting parent node containing the mt child node then only proceed else skip that parent node.
        IF (l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mt') > 0 and l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mvalue/r') > 0) Then
      -- fetch the datatime, convert it into to_date format and store it into table rowtype
        temp_datatime := dbms_xslprocessor.valueOf(node1, 'date/text()');
        t_tab(t_tab.last).data_time := to_char(to_date(temp_datatime, 'YYYYMmcDHH24MISS'));
        l_subIndex := 1;
       while (l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mt[' || l_subIndex || ']') > 0 and l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mvalue/r['|| l_subIndex || ']') > 0 ) LOOP
    -- getting mt and corresponging mvalue/r values
       dbms_xslprocessor.valueOf(node1,'mt[' || l_subIndex || ']/text()',columnname);
      dbms_xslprocessor.valueOf(node1,'mvalue/r[' || l_subIndex || ']/text()',columnvalue);
      l_subIndex := l_subIndex + 1;
      -- getting the column to which this mapping belongs.
      select columnid into colid from abc_table where columnname=name;
      CASE colid
      WHEN 1 THEN t_tab(t_tab.last).col1 := columnvalue;
      WHEN 2 THEN t_tab(t_tab.last).col2 := columnvalue;
      WHEN 3 THEN t_tab(t_tab.last).col3 := columnvalue;
          ELSE dbms_output.put_line('No column mapping for counter ' || columnname) ;
      END CASE; -- end of case statement.
      END LOOP;
    -- Insert data into the real table from the table collection.
      FORALL i IN t_tab.first .. t_tab.last
        INSERT INTO test_hem VALUES t_tab(i);
      END IF;
      l_index := l_index + 1;
    COMMIT;
    END LOOP;
    commit;
    EXCEPTION
      WHEN OTHERS THEN
      ecode := SQLCODE;
      emesg := SQLERRM;
      dbms_output.put_line(TO_CHAR(ecode) || '-' || emesg);
      dbms_lob.freetemporary(l_clob);
      dbms_xmlparser.freeParser(l_parser);
      dbms_xmldom.freeDocument(l_doc);
    END;Thanks in advance for your help...

  • Exception in XML Parser (format problem?)

    Hi Experts,
    I am working on IDOC -> AS2 Configuration and the AS2 Configuration has the below structure
    <RecordSet>
         <Row1>
                       <row1 - field1>
                       <row1 - field2>
                       <row1 - field3>
         </Row1>
         <Row2>
                       <row2 - field1>
                       <row2 - field2>
                       <row2 - field3>
         </Row2>
         <Records>
              <Record1>
                        <Record1-Field1>
                        <Record1-Field1>
                        <Record1-Field1> 
              </Record1>
              <Record2>
                        <Record2-Field1>
                        <Record2-Field1>
                        <Record2-Field1> 
              </Record2>
         </Records>
    </RecordSet>
    We are getting the expected Structure when we AS2 Receiver has the xml format. But while doing module development with the strctxml2Plain, we are getting the below error  in RWB CC Monitoring.
    Message processing failed. Cause: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.NullPointerException''; nested exception caused by: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.NullPointerException'
    Any ideas, why this error we are getting.....
    Thanks in advance,
    Regards,
    Vasu

    Hi Vasu,
    Not in the Mapping of IR.
    In BIC Mapping Designer you have to test with the standard Mappings by providing the sample file whether the Conversion is happening correctly or not.
    You have to take the same input file that what ever you are having now.
    So that it will say clearly what is the problem in converting the XMLto the required EDI Format...
    Check whether you have any Date Format Values are comming from the input file.
    Regards
    Seshagiri

  • Attempt to process file failed with Exception in XML Parser-format problem

    Hi all,
    Iam getting an unusual error in the J2EE stack in XI.
    And the message is:
    006-11-30 17:31:07 Error Attempt to process file failed with Exception in XML Parser (format problem?):'com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)(:main:, row=1, col=1044002) -> com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)' 2006-11-30 17:31:07 Error Exception caught by adapter framework: null 2006-11-30 17:31:07 Error Delivery of the message to the application using connection AFW failed, due to: RecoverableException.
    My scenerio iam posting IDOC to a flat file with content conversion in the receiver side,the mapping got executed successfully and in the audit log i found that the error was after the 'Start converting XML document content to plain text'.
    This means that error occured during content conversion of XML to the prescribed file format.
    Can anyone suggest any better approach using which we may trace the junk data in IDoc. Manual adhoc approach could take time and is error prone.
    Thanks in advance...
    karun

    Hi Bhavesh,
    Thanks for the early reply. I checked the mapping and everything is fine and the output is also in valid XML format.
    The audit log shows that the mapping got executed successfully and the error is after the step 'Start converting XML document content to plain text '. Is there any constraint in the file adapter regarding the message size for parsing.
    2006-11-30 17:30:50 Success Transfer: "BIN" mode, size 2912595 bytes, character encoding -
    2006-11-30 17:30:50 Success Start converting XML document content to plain text
    2006-11-30 17:31:07 Error Attempt to process file failed with Exception in XML Parser (format problem?):'com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)(:main:, row=1, col=1044002) -> com.sap.engine.lib.xml.parser.ParserException: Invalid char #0xf(:main:, row:1, col:1044002)'
    2006-11-30 17:31:07 Error Exception caught by adapter framework: null
    2006-11-30 17:31:07 Error Delivery of the message to the application using connection AFW failed, due to: RecoverableException.
    2006-11-30 17:31:07 Success The asynchronous message was successfully scheduled to be delivered at Thu Nov 30 17:36:07 GMT 2006.
    2006-11-30 17:31:07 Success The message status set to WAIT.
    2006-11-30 17:31:08 Success Acknowledgement creation triggered for type: SystemErrorAck
    2006-11-30 17:31:08 Success Acknowledgement sent successfully for type: SystemErrorAck
    2006-11-30 17:36:08 Success Retrying to deliver message to the application. Retry: 1

  • Faces-config.xml XML parser problem ???

    I'm taking below error message when I was opening faces-config.xml file with diagram view, what's the exact solution of this problem???
    Message
    BME-99100: An error has been reported from the XML parser
    Cause
    The parse has reported the following error:
    <Line 24, Column 2>: XML-20201: (Fatal Error) Expected name instead of <.
    Action
    Thanks for all...
    Message was edited by:
    user559176

    I looked very well, there was'nt any error on line 24 about "<", I think if the size of faces-confic.xml file increased JDeveloper XML Parser cannot parse with high file size, what're other solutions?

Maybe you are looking for

  • HELP ASAP!! Lettered password tried first time, caused my ipod to be unrecognized by iTunes and only solution is restore, which I don't want to do!

         I put in a lettered passcode recently and now it won't work anymore and iTunes could not let me type in the password and only solution is to restore it. I really do NOT want to restore it at all because I highly value the info, saved pics and li

  • How to create Work Books in BI 7.0

    Hi Experts, Good Morning. I am working BI 7.0, My requirements is create Work Book and include below follwoing 1. The end of report footer message should come 2. Company LOGO Should come in the header of every report. Please provide me solutions step

  • Image Gallery - Paginate detail image

    I've been looking all over (including the interakt forums) and can't find an answer. I've built an image gallery. Everything works just fine. However, after clicking a thumbnail to view the larger image, I would like to be able to navigate through th

  • Installation of Adobe Premiere Elements 12 always fails

    During the installation of my Adobe Premiere Elements 12, I always receive an error message (during the processing of linked components) which says:" During the installation an error has occured." I have purchased Adobe Premiere Elements online and u

  • Can't Re-install System Software

    I need to re-install System OSX Tiger on a G4 Powerbook which has lost most of its desktop and user info -- including the Hard Drive icon, and it won't show the icon for the installer disk when I insert it. Obviously, I can't do the install like this