Problem in inserting XML document

Give XML DTD :
<!ELEMENT a (b, c)>
<!ELEMENT b (#PCDATA)>
<!ELEMENT c (d, e)>
<!ELEMENT d (#PCDATA)>
<!ELEMENT e (#PCDATA)>
I made schema at Oracle8i as this:
create type c_t
as object (d varchar2(3),
e varchar2(3));
create table a (
b varchar2(3),
c c_t,
constraint b_pk primary key (b));
And the XML document to insert into DB is as this:
<?xml version="1.0"?>
<ROWSET>
<ROW>
<b>"100"</b>
<c><d>"aaa"</d><e>"abc"</e></c>
</ROW>
<ROW>
<b>"200"</b>
<c><d>"bbb"</d><e>"def"</e></c>
</ROW>
</ROWSET>
Using Oracle8i's XML-JAVA library interface,
I tried to insert the XML document into the DB table, but JAVA runtime exception occurred says "java.lang.NoSuchMethodError: oracle.jdbc.oci8.OCIDBAccess: method initObjectFields(Loracle/jdbc/dbaccess/DBColumn;[BI)V not found".
How can I solve this problem?
null                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

try calling dbms_xmlgen.setrowsettag(qryctx,'siteMap') ;
before retrieving the result with DBMS_XMLGEN.getxmltype (qryctx);

Similar Messages

  • ORA-00600: inserting xml document

    I am getting an this error when inserting an xml document into Oracle.
    The schema below and sample xml document reproduce the problem.
    If I move the element named "theID" from the type "BaseObjectType"
    to "NextObjectType" and remove the extension declaration in this type
    all works ok. complete error is:
    ORA-00600: internal error code, arguments: [qmxConvUnkType], [], [], [], [],
    Schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema
    targetNamespace="http://www.x.com/test"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:tes="http://www.x.com/test">
    <xs:complexType name="BaseObjectType" abstract="true">
    <xs:sequence>
    <xs:element name="theID" type="xs:string">
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="NextObjectType" abstract="true">
    <xs:complexContent>
    <xs:extension base="tes:BaseObjectType">
    <xs:sequence>
    <xs:element name="title" type="xs:string">
    </xs:element>
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="RBaseType" abstract="true">
    <xs:complexContent>
    <xs:restriction base="tes:NextObjectType">
    <xs:sequence>
    <xs:element name="theID" type="xs:string"/>
    <xs:element name="title" type="xs:string"/>
    </xs:sequence>
    </xs:restriction>
    </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="RType">
    <xs:complexContent>
    <xs:extension base="tes:RBaseType">
    <xs:sequence>
    <xs:element name="theName" type="xs:string">
    </xs:element>     
    </xs:sequence>
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>
    <xs:element name="RObject" type="tes:RType"/>
    </xs:schema>
    Sample xml document:
    <?xml version="1.0" encoding="UTF-8"?>
    <RObject xmlns="http://www.x.com/test"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://localhost:8080:/test.xsd">
    <theID xmlns="">123</theID>
    <title xmlns="">title</title>
    <theName xmlns="">name</theName>
    </RObject>
    Register Schema call:
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL => 'http://localhost:8080/test.xsd',
    SCHEMADOC => bfilename('TMP3','test.xsd'),
    LOCAL => TRUE,
    GENTYPES => TRUE,
    GENTABLES => TRUE,
    CSID => nls_charset_id('AL32UTF8'));
    END;
    Insert xml document call:
    insert into "RObject566_TAB" values
    (XMLType(bfilename('TMP3','test.xml'),nls_charset_id('AL32UTF8')));
    Changing NextObjectType to this gets insert to work:
    <xs:complexType name="NextObjectType" abstract="true">
    <xs:sequence>
    <xs:element name="theID" type="xs:string"/>
    <xs:element name="title" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>
    Anyone else seen this?
    jcl.

    BTW: This is with Oracle 10.2.0

  • Error in inserting XML document

    I'm trying to insert into a table from an HTML form.
    Here's the table I'm trying to insert into
    TABLE employee
    name VARCHAR2(40),
    ssnum NUMBER NOT NULL
    Note: even though SSNUM is number I take it as a string and I
    have a before insert trigger that converts it to number. Works
    from SQL plus if entry is number.
    Here's the testxsql.html
    <html>
    <body>
    Input your name and ssnumber ..
    <form action="testxsql.xsql" method="post">
    Name<input type="text" name="name_field" size="30">
    SSNUM<input type = "text" name="ssnum_field" size="10">
    <input type="submit">
    </form>
    </body>
    </html>
    it calls testxsql.xsql which is
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="employee.xsl"?>
    <page connection="demo">
    <insert table="employee" transform="testxsql.xsl"/>
    <content>
    <query tag-case="lower" max-rows="5" rowset-element=""
    row-element="emp" >
    select *
    from employee
    order by ssnum desc
    </query>
    </content>
    </page>
    and testxsql.xsl is
    <?xml version = '1.0'?>
    <ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:for-each select="request">
    <ROW>
    <NAME><xsl:value-of select="name_field"/></NAME>
    <SSNUM><xsl:value-of select="ssnum_field"/></SSNUM>
    <SOURCE>User-Submitted</SOURCE>
    </ROW>
    </xsl:for-each>
    </ROWSET>
    I get the following error while trying to insert
    XSQL-015: Error inserting XML Document
    invalid LABEL name in XML doc-
    If I remove the insert tag, the query portion works fine.
    I'm new to XML so I've already pulled all the hair that I can
    muster. Thanks
    null

    Kumar Pandey (guest) wrote:
    : I'm trying to insert into a table from an HTML form.
    : Here's the table I'm trying to insert into
    : TABLE employee
    : name VARCHAR2(40),
    : ssnum NUMBER NOT NULL
    : Note: even though SSNUM is number I take it as a string and I
    : have a before insert trigger that converts it to number. Works
    : from SQL plus if entry is number.
    : Here's the testxsql.html
    : <html>
    : <body>
    : Input your name and ssnumber ..
    : <form action="testxsql.xsql" method="post">
    : Name<input type="text" name="name_field"
    size="30">
    : SSNUM<input type = "text" name="ssnum_field"
    size="10">
    I'm using apache web and JServ and 8i as db
    : <input type="submit">
    : </form>
    : </body>
    : </html>
    : it calls testxsql.xsql which is
    : <?xml version="1.0"?>
    : <?xml-stylesheet type="text/xsl" href="employee.xsl"?>
    : <page connection="demo">
    : <insert table="employee" transform="testxsql.xsl"/>
    : <content>
    : <query tag-case="lower" max-rows="5" rowset-element=""
    : row-element="emp" >
    : select *
    : from employee
    : order by ssnum desc
    : </query>
    : </content>
    : </page>
    : and testxsql.xsl is
    : <?xml version = '1.0'?>
    : <ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    : <xsl:for-each select="request">
    : <ROW>
    : <NAME><xsl:value-of select="name_field"/></NAME>
    : <SSNUM><xsl:value-of select="ssnum_field"/></SSNUM>
    : <SOURCE>User-Submitted</SOURCE>
    : </ROW>
    : </xsl:for-each>
    : </ROWSET>
    : I get the following error while trying to insert
    : XSQL-015: Error inserting XML Document
    : invalid LABEL name in XML doc-
    : If I remove the insert tag, the query portion works fine.
    : I'm new to XML so I've already pulled all the hair that I can
    : muster. Thanks
    null

  • LPX-00004 - Problems while inserting xml files in a xmltype column

    I've faced two problems while trying to insert xml files into my table containing a xmltype column:
    create table xml_test (id number(20),content xmltype)
    I use following java code for writing xml docs into db:
         conn.setAutoCommit(false);
         OraclePreparedStatement stmt = (OraclePreparedStatement)
              conn.prepareStatement("INSERT INTO xml_test (id,content) VALUES(?,?)");
         File file = new File(file1);
         InputStream in1 = new FileInputStream(file1);
         Reader r1 = new BufferedReader(new InputStreamReader(in1, "UTF-8"));
         int len = 0;
         StringBuffer text = new StringBuffer();
         while ((len = r1.read()) != -1) {
              text.append((char) len);
         in1.close();
         r1.close();
         XMLType poXML1 = XMLType.createXML(conn, text.toString());
         for (int i = 1; i <= 1; i++) {
              stmt.setInt(1, i);
              stmt.setObject(2, poXML1);
              stmt.execute();
         conn.commit();
    1. problem: occures only if a xml schema has been assoicated to the specific xmltype column. it seems that the length of a specific xml tag in the document is limited. but why?
    java.sql.SQLException: ORA-22814: attribute or element value is larger than specified in type
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:656)
         at test.insertXML(test.java:84)
         at test.main(test.java:261)
    hier the xml-schema of the xmltype column "content":
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XML Spy v4.4 U (http://www.xmlspy.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
         <xs:element name="AUTOR-ID" type="xs:string"/>
         <xs:element name="BODY" type="xs:string"/>
         <xs:element name="CONTENT">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="METADATEN"/>
                        <xs:element ref="BODY"/>
                   </xs:sequence>
                   <xs:attribute name="content-id" type="xs:string" use="required"/>
              </xs:complexType>
         </xs:element>
         <xs:element name="DATUM" type="xs:string"/>
         <xs:element name="KEYWORD" type="xs:string"/>
         <xs:element name="METADATEN">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="DATUM"/>
                        <xs:element ref="TITEL" maxOccurs="unbounded"/>
                        <xs:element ref="KEYWORD" maxOccurs="unbounded"/>
                        <xs:element ref="AUTOR-ID"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="TITEL" type="xs:string"/>
    </xs:schema>
    2. problem: hier i have no idea what is happening ... please help
    java.sql.SQLException: ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00004: internal error "MultiChar overflow"
    Error at line 61
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:656)
         at test.insertXML(test.java:53)
         at test.main(test.java:259)

    It's hard for me to tell you more without seeing your instance data, but for problem #1, if you look at the underlying SQL types being generated by your schema, you will see that the default SQL mapping for a "string" in your schema is a VARCHAR2(4000) (and I believe this would be only 2000 for a varying width character set like UTF8).
    You can specify that you wish this column to be mapped as a CLOB in your schema if this is the problem. Also note that there is a 64K limit on the size of an individual node in XMLType.

  • Problem in editing xml document

    Hi,
    Can anybody help me out of this problem basically i want to develop sample prog that will take care of editng the existing xml document eg. i want to edit resource file for the application like if user want to change some property through the user interface and i want to reflect that input to the xml files.
    Help me as soon as possible ............. its very urgent .......................
    Regards
    Sanket

    Output document with a transformer.
    TransformerFactory tFactory =TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
                DOMSource source = new DOMSource(document);
                StreamResult result = new StreamResult(new File("c:/output/output.xml"));
                transformer.transform(source, result);

  • Inserting XML document into XDB fails with can't convert to OPAQUE

    Hi,
    When I try to insert a document using oracle 9.2.0.5 client software into a 9.2.0.5 database, with the following code:
    void insertDocument(String document) {
    XMLType xt = XMLType.createXML(connection, document);
    PreparedStatement ps = connection.prepareStatement("insert into xmldocuments values(?)");
    ps.setObject(1, xt);
    ps.executeUpdate();
    The setObject function always throws an exception (after a very long time) with:
    java.sql.SQLException: Fail to convert to internal representation: OPAQUE()
    This also fails when we use the InputStream and org.w3c.xml.Document variants.
    We use the OCI driver, otherwise we get errors retrieving the documents from XMLDB.
    What is going wrong here?

    David,
    If you search through the historical data in this list there are previous post regarding opaque.
    These may be useful. Possibly your reaching the size limit.

  • Small problem reading an XML document

    Hi,
    I have code that can read an XML document like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <something>
    <order orderid="1">
    <customerid>12341</customerid>
    </order>
    </something>
    but when I take out the first tag <something> and last tag </something> , it doesn't work at all and I have no clue why. Here is my code:
    public class SaveOrders extends Object {
          try {
             //Get the root element and all order elements
             Element ordersRoot = ordersDoc.getDocumentElement();
             NodeList orders = ordersRoot.getElementsByTagName("order");
             for (int i = 0; i < orders.getLength(); i++) {
                //For each order, get the order element
                Element thisOrder = (Element)orders.item(i);
          } catch (ClassNotFoundException e) {
             System.out.println("Error creating class: "+e.getMessage());thanks for your help!

    Every XML document must have a Document Root (in your case <something>). So, if you have multiple <order>'s within your XML document, there is no Doc Root! Eeek!
    Get it? If you only have one <order> per XML file, then you should be alright (and might have another problem) because that <order> becomes the root, but the instant you have more than one, you need something to put all of them (your Doc Root).
    Hope that helps!

  • Problem to validate XML document if the type of root element is abstract

    I have the following XML document:
    <?xml version="1.0" encoding="UTF-8"?>
    <ct013/>
    It corresponds to the following XSD Schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
         <xs:element name="ct013" type="foo"/>
         <xs:complexType abstract="true" name="foo"/>
         <xs:complexType name="fixedType">
              <xs:complexContent>
                   <xs:restriction base="foo"/>
              </xs:complexContent>
         </xs:complexType>
    </xs:schema>
    Please take attention to the fact that the type of root element of that BDD is abstract.
    XML Schema provides a mechanism to force substitution for a particular element or type. When an element or type is declared to be "abstract", it cannot be used in an instance document. When an element is declared to be abstract, a member of that element's substitution group must appear in the instance document. When an element's corresponding type definition is declared as abstract, all instances of that element must use xsi:type to indicate a derived type that is not abstract.
    Declaring an element as abstract requires the use of a substitution group. Declaring a type as abstract simply requires the use of a type derived from it (and identified by the xsi:type attribute) in the instance document.
    For more information of using abstract types please see chapter 4.7 Abstract Elements and Types of XML Schema Part 0: Primer Second (http://www.w3.org/TR/xmlschema-0/#abstract).
    In this case there is Oracle bug when I try to validate this XML document using Oracle XDK:
    String validate(String xml, String schema)
    throws XSDException, XMLParseException, SAXException, IOException
    System.setPropert("oracle.xml.parser.debugmode", "true");
    XSDValidator xsdValidator = new XSDValidator();
    XMLError xmlError = new XMLError();
    xmlError.setErrorHandler(new DocErrorHandler());
    XMLDocument xmlDocument = parseXMLDocument(xml);
    XMLDocument schemaXMLDocument = parseXMLDocument(schema);
    XMLSchema xmlSchema = (XMLSchema) new XSDBuilder().build(schemaXMLDocument, null);
    xsdValidator.setError(xmlError);
    xsdValidator.setSchema(xmlSchema);
    xsdValidator.validate(xmlDocument);
    return getValidationError(xsdValidator);
    I get the following error:
    Can't find resource for bundle oracle.xml.mesg.XMLResourceBundle, key XSD-2046.
    I tried to validate this XML document using two other libraries - XSD Schema Validator (http://apps.gotdotnet.com/xmltools/xsdvalidator/Default.aspx) and xsdvalid-29 (http://www.w3.org/XML/Schema#XSDValid). Both libraries pointed me on the error that the type of root element is abstract and it cannot be used for doing validation.
    I think that Oracle should return me explaining message but not to throw exception.
    Am I right? Is there really Oracle bug or I miss something?
    Any help, hits, advices would be gratfully apriciated.

    Define Element1 as follows:
    <xs:element name="Element1">
    <xs:complexType>
    <xs:complexContent>
    <xs:restriction base="xs:string"/>
    </xs:complexContent>
    </xs:complexType>
    </xs:element>
    Does the XML document get validated if the element is specified as
    <Element1></Element1>

  • Problem in displaying XML document from database

    Hi I am getting only record in printing xml file which takes from data base.
    Here is my programme.
    Document doc;
    ����public void processTable(Connection con, String tableName)
    ����{
    ��������try
    ��������{
    ������������this.iColumnCount=0;
    ������������HashMap hm = new HashMap();
    ������������//XML related Interfaces
    ������������DocumentBuilderFactory dbf;
    ������������DocumentBuilder db;
    ������������Element rootElement = null;
    Element colData = null;
    ������������Element relElement = null;
    �����
    ������������//Database relevent Interface
    ������������ResultSet rslt = null;
    ������������DatabaseMetaData dmd = null;
    ������������ResultSetMetaData rsmd= null;
    ������������//Initilize the Factory Classes
    ������������dbf = DocumentBuilderFactory.newInstance();
    ������������db = dbf.newDocumentBuilder();
    ������������doc = db.newDocument();
    ������������//Assign the root elements to document
    ������������rootElement = doc.createElement("entity");
    colData = getColMetaData(tableName);
    ������������rootElement.appendChild(colData);
    ������������doc.appendChild(rootElement);
    ������������TransformerFactory tFactory = TransformerFactory.newInstance();
    ����������������Transformer transformer = tFactory.newTransformer();
    ����������������transformer.transform(new DOMSource(doc),
    ��������������������new StreamResult(new FileOutputStream(tableName+".xml")));
    ��������} catch (Exception sqle)
    ��������{
    ����������������e.printStackTrace();
    ��������}
    ����}
    ����/**
    �����* Method getColMetaData.
    �����* @param tableName
    �����* @return Element
    �����*/
    ����private Element getColMetaData(String tableName)
    ����{
    ��������try{
    ������������ResultSet rslt = null;
    ������������ResultSetMetaData rsmd = null;
    ������������DataTypeMap dtp = new DataTypeMap();
    ������������HashMap hm = new HashMap();
    ������������hm = dtp.DataTypes();
    ������������Connection con = db.createConnection();
    ������������Statement stmt = con.createStatement();
    ������������String sQuery = "select * from " +tableName;
    ������������rslt = stmt.executeQuery(sQuery);
    ������������rsmd = rslt.getMetaData();
    ������������Element rooElement = null;
    ������������//Element currentElement =null;
    ������������iColumnCount = rsmd.getColumnCount();
    ����������������Element currentElement = null;//doc.createElement("field");
    // rootElement = doc.createElement("column");
    ����������������for (int i = 1; i <= iColumnCount; i++)
    ��������������������{
    currentElement = doc.createElement("field");
    ������������������������currentElement.setAttribute("DBFieldName",rsmd.getColumnName(i));
    ������������������������currentElement.setAttribute("FieldName",rsmd.getColumnLabel(i));
    ������������������������
    ��������������������}
    ��������������return currentElement;
    ��������catch(Exception ee){
    ������������logger.info(ee.getMessage());
    ��������}
    ��������return null;
    ����}
    Here 'return currentElement;' return the collection of elements.But when I print
    document it is giving only last element.I am not getting how only one record is printing even it has more records
    please help me in this regards.
    here the out put:
    <?xml version="1.0" encoding="UTF-8"?>
    <entity>
    ��<field DBFieldName="X_TYPE" FieldName="X_TYPE"/>
    </entity>
    -krish
    [email protected]

    Problem in displaying the XML Data from database
    Hi I have requirement of generating the XML from database.I could able to acheive partially.
    I am giving the problem below.
    public void processTable()
    Element rootElement = doc.createElement("entity");
    Element colData= getColMetaData(tableName);
    rootElement.appendChild(colData);
    doc.appendChild(rootElement);
    //print the document
    /*getColData method as follows*/
    private Element getColMetaData(String tableName)
    try{
    ResultSet rslt = null;
    ResultSetMetaData rsmd = null
    Connection con = db.createConnection();
    Statement stmt = con.createStatement();
    String sQuery = "select * from " +tableName;
    rslt = stmt.executeQuery(sQuery);
    rsmd = rslt.getMetaData();
    iColumnCount = rsmd.getColumnCount();
    Element currentElement = doc.createElement("field");
    for (int i = 1; i <= iColumnCount; i++)
    currentElement.setAttribute("FieldName",rsmd.getColumnName(i));
    currentElement.setAttribute("Position", parseString(i));
    rootElement.appendChild(currentElement);
    return currentElement;
    catch(Exception ee){
    logger.info(ee.getMessage());
    return null;
    /* End of Method*/
    Here when I printing the document it is giving out put like :
    <entity >
    <field FieldName="X_ID" Position="1"/>
    </entity>
    The is displaying only one field information even though table contains more then one column.If we maintain all the aboue code in single method it is working fine.I want to decouple the like above.Bcz I may have more then one set of elements like this.
    Please help in this regards,
    -Krish
    [email protected]

  • Problem with inserting XML data server in ODI

    Hi,
    I was trying to insert an XML data server in ODI. I want to use it for my target database.i.e i want my target to be an xml file. So while specifying the url in the data server, what should i mention as the file name,dtd file , root etc? what i have done is dat i hav created the dtd file as per my requirement.i have created an empty xml file. while testing the connection an error comes : java.sql.SQLException: A parsing exception occurred saying Whitespace required..
    Next i tried putting jz d root tags in the xml file without any content. this returned the same error. next i tried inserting all d tags as per my dtd file. same error came...
    Please help.
    Regards,
    Divya
    Message was edited by:
    Divya Padmanabhan

    For empty xml try to use:
    <?xml version="1.0" encoding="UTF-8"?>
    <ROOT_SOME></ROOT_SOME>
    as jdbc connect string:
    jdbc:snps:xml?f=../demo/xml/1/file.xml&ro=false&ldoc=true&case_sens=true&s=LEO_FIZ&dod=true
    and try again...

  • Need help in inserting XML Documents as XMLType

    I am using an XMLType column in one of my tables to store XML messages that come from a B2B application. My insert takes the form of:
    insert into mytable values(
    '100',
    'unvalidated',
    'final',
    XMLTYPE(
    'The XML Message
    This has been working fine for the last several weeks. Over the weekend I was working with a new message type and getting ready to enter some test messages for some new validation functions. When I try to insert the row, I get a
    ERROR at line 6:
    ORA-01704: string literal too long
    error message.
    In looking it up, the book says that the string literal is over 4000 characters long, which the message is.
    I can't find anything in the docs on how to insert an XML doc with over 4000 characters into an XMLType column. I'm OK on record size which is supposed to be 2 GB - my string is just too long.
    Please help - I need to be testing this today.
    Rick Price

    Hi Rick,
    For a very large string , i am using following proc.
    See if it can be of any help.
    declare
    str clob ;
    begin
    str := '<?xml version="1.0" ?>
    BIG LARGE STRING ';
    insert into stylesheet values (1, 'style_name' ,XMLTYPE(str)) ;
    commit;
    Cheers
    Pashabhai
    end;

  • Problem validating an XML document with a schema containing xs:include

    I have a problem using an include statement in xsd. I try to include another
    schema by using the include statement:
    <xsd:include schemaLocation="../../XXX.xsd"/>
    and get the xjc error:
    s4s-att-invalid-value: Invalid attribute value for 'schemaLocation' in element 'include': cvc-datatype-valid.1.2.1.
    Can anybody give me a hint what goes wrong here? THANKS!!!!
    ayache

    Your schemaLocation value is not a URI? To me, it looks like the value should conform to this:
    http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#anyURI
    I will let you read all those specs to see whether that is your problem.

  • Problem when inserting xml flow into jspx page

    When I drag and drop the xml into the jspx I should get a pop up menu where I would choose region (Im following a tutorial) but I get nothing. I drag and drop and It just opens it in the design editor.
    I would appreciate any help you guys could give

    OK, let cover the basics first:
    JDev version?
    I assume you are on 11.1.1.2.0 or 11.1.1.3.0:
    You created a new task flow (right click on the 'Web content'->new->'ADF Task FLow'
    the check box 'Createas Bounden Task flow was set and the check box for 'Create with Page Fragments' was set
    The filename was something like 'search-email-flow.xml'
    This should create a new bounden task flow with the name of search-email-flow (which creates a xml file with the same name).
    Then you put one view to the flow. After creating the page fragment (the file created should have the jsff file type) you saved all work.
    The you open up an existing jspx file and drag the new flow from the 'Page Flows' folder under 'Web content' onto the design view of the jspx file.
    after dropping the flow you should then see the 'Create' dialog. e careful, you can't drop the flow everywhere on the page. You should drop in into a panel group or some other container. If you drop it i.e. onto a table you see the effect you described: it's opening the flow!
    Timo

  • How to set the root path of XML document when calling Inserting procedure

    Hi,
    I was create a procedure to insert XML Document in to DBMS Tables, but i am not able to set the Start root element in calling procedure.
    My calling procedure is
    exec insXmldoc('pmc_sample.xml', 'pmc')
    When i am calling this procedure i got this error
    11:23:54 Error: ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException: Start of root element expected.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
    ORA-06512: at "SCOTT.INSPROC", line 8
    ORA-06512: at line 2
    I am checking my XML file using XML Validator. My XML file was parsed with out errors.
    Please give the solution,and tell me where i did wrong in my calling procedure.
    suppose i have this XML file in local E drive ,how to set the path for that XML file in my calling procedure.

    Hi, I am doing the code likthis,please give the solution.
    SQL> create or replace procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
    2 insCtx DBMS_XMLSave.ctxType;
    3 l_ctx dbms_xmlsave.ctxtype;
    4 rows number;
    5 begin
    6 insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
    7 rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
    8 DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
    9 end;
    10 /
    Procedure created.
    SQL> begin
    2 insProc('/usr/tmp/ROWSET.xml', 'emp');
    3 end;
    4 /
    begin
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException:
    Start of root element expected.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
    ORA-06512: at "SCOTT.INSPROC", line 7
    ORA-06512: at line 2
    Kishore B

  • Problem validating XMl document

    Hi everyone,
    I'm facing a problem validating a XML document with Apache toolkit under windows XP and eclipse 3.0
    I generate a pair of public/private keys using the RSA algorithm. The keys are of arbitrary length, but satisfying RSA conditions, ie we can encrypt and decrypt.
    I can sign my XML document, but no way to validate it. Validation is only ok when I generate random keys using the KeyPairGenerator.
    Do you think that arbitrary length keys don't allow to validate XML document. And do you have any idea how to solve the problem ( I'm not allowed to generate fixed length keys) ?
    Thansk a lot for your precious help.

    solved!
    urghh...forgot to load th eschema..duh. (must be friday)
    here's the fixed code:
        // parse the xml document (validate the xml string using a schema  file)
        // the xml document does not specified the System ID or location of
        // schema..and use no namespace
        public void parse(HandlerType type, String xmldoc) throws SAXException, IOException {
            File           schema      = schemaMap.get(type);
            DefaultHandler handler     = handlerMap.get(yype);
            XMLReader   reader = XMLReaderFactory.createXMLReader(VENDOR);
            InputSource source = new InputSource(new StringReader(xmldoc));
            reader.setContentHandler(handler);
            reader.setFeature("http://xml.org/sax/features/validation", true);
            reader.setFeature("http://apache.org/xml/features/validation/schema", true);
            reader.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
            reader.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
            "file:///" + schema.getAbsolutePath());
            reader.parse(source);          
        }

Maybe you are looking for