Oracle Xml Schema Registration problem.

Hi Gurus,
I tried to register a schema using an xsd named 'EntityBase.xsd', using the following block. It got registered successfully.
BEGIN
DBMS_XMLSCHEMA.registerSchema(
SCHEMAURL => 'http://xmlns.oracle.com/xdb/EntityBase.xsd',
SCHEMADOC => bfilename('XMLDIR','EntityBase.xsd'),
LOCAL => FALSE,
CSID => nls_charset_id('AL32UTF8'));
END;
select local,schema_url,int_objname,qual_schema_url from dba_xml_schemas where schema_url like
'%http://xmlns.oracle.com/xdb/EntityBase.xsd%';
This gives me a record.
Now I have another xsd, VersionedEntity.xsd with which I would like to register another schema. In the xsd definition for VersionedEntity.xsd, it has Entity.xsd being used and which is already registered and the .xsd exists in the same directory 'XMLDIR'. But when I register using the following block,
BEGIN
DBMS_XMLSCHEMA.registerSchema(
SCHEMAURL => 'http://xmlns.oracle.com/xdb/VersionedEntity.xsd',
SCHEMADOC => bfilename('XMLDIR','VersionedEntity.xsd'),
CSID => nls_charset_id('AL32UTF8'));
END;
I get
ORA-31000: Resource 'EntityBase.xsd' is not an XDB schema document
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 37
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 61
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 126
ORA-06512: at line 2
Please help me with your expert advice. Am I doing something wrong?
Thanks and Regards,

There is a forum dedicated to XML...
XML DB

Similar Messages

  • Xml schema validation problem

    Hi All
    How to tackle this xml schema validation problem
    i am using the sample code provided by ORacle technet for xml
    schema validation in the Oracle database(817).
    The sample code works perfectly fine.
    Sample as provided by http://otn.oracle.com/tech/xml/xdk_sample/archive/xdksample_093001.zip.
    It works fine for normal xml files validated against
    xml schema (xsd)
    but in this case my validation is failing . Can you let me know why
    I have this main schema
    Comany.xsd
    ===========
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.company.org"
    xmlns="http://www.company.org"
    elementFormDefault="qualified">
    <xsd:include schemaLocation="Person.xsd"/>
    <xsd:include schemaLocation="Product.xsd"/>
    <xsd:element name="Company">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="Person" type="PersonType" maxOccurs="unbounded"/>
    <xsd:element name="Product" type="ProductType" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    ================
    which includes the following 2 schemas
    Product.xsd
    ============
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
    <xsd:complexType name="ProductType">
    <xsd:sequence>
    <xsd:element name="Type" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    ==============
    Person.xsd
    ===========
    <?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified">
    <xsd:complexType name="PersonType">
    <xsd:sequence>
    <xsd:element name="Name" type="xsd:string"/>
    <xsd:element name="SSN" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    =================
    now when i try to validate a xml file against Company.xsd
    it throws an error saying unable to find Person.xsd.
    no protocol error
    Now where do i place these 2 schemas(.xsd files) Person & product
    so that the java schemavalidation program running inside Oracle
    database can locate these files
    Rgrds
    Sushant

    Hi Jinyu
    This is the java code loaded in the database using loadjava called by a wrapper oracle stored procedure
    import oracle.xml.parser.schema.*;
    import oracle.xml.parser.v2.*;
    import java.net.*;
    import java.io.*;
    import org.w3c.dom.*;
    import java.util.*;
    import oracle.sql.CHAR;
    import java.sql.SQLException;
    public class SchemaUtil
    public static String validation(CHAR xml, CHAR xsd)
    throws Exception
    //Build Schema Object
    XSDBuilder builder = new XSDBuilder();
    byte [] docbytes = xsd.getBytes();
    ByteArrayInputStream in = new ByteArrayInputStream(docbytes);
    XMLSchema schemadoc = (XMLSchema)builder.build(in,null);
    //Parse the input XML document with Schema Validation
    docbytes = xml.getBytes();
    in = new ByteArrayInputStream(docbytes);
    DOMParser dp = new DOMParser();
    // Set Schema Object for Validation
    dp.setXMLSchema(schemadoc);
    dp.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    dp.setPreserveWhitespace (true);
    StringWriter sw = new StringWriter();
    dp.setErrorStream (new PrintWriter(sw));
    try
    dp.parse (in);
    sw.write("The input XML parsed without errors.\n");
    catch (XMLParseException pe)
    sw.write("Parser Exception: " + pe.getMessage());
    catch (Exception e)
    sw.write("NonParserException: " + e.getMessage());
    return sw.toString();
    This is the code i used initially for validating a xml file against single xml schema (.xsd) file
    In the above code could u tell how to specify the second schema validation code for the incoming xml.
    say i create another Schemadoc for the 2nd xml schema.
    something like this with another parameter(CHAR xsd1) passing to the method
    byte [] docbytes1 = xsd1.getBytes();
    ByteArrayInputStream in1 = new ByteArrayInputStream(docbytes1);
    XMLSchema schemadoc1 = (XMLSchema)builder.build(in1,null);
    DOMParser dp = new DOMParser();
    How to set for the 2nd xml schema validation in the above code or can i combine 2 xml schemas.
    How to go about it
    Rgrds
    Sushant

  • XML SCHEMA registration for XML TYPE (storing XML files in Oracle 10g)

    I have created the XML Schema for the XML file stored in Oracle 10g and also added this Schema into the database. I have related that schema with the column in the table which contains the XML file. When i execute the query to fetch the data from the stored file i am getting a blank resultset. Is registering the XML Schema is necessary, if yes then please let me know the process of doing it. I have tried following steps to register Schema, but it is not working
    Step1:
    DECLARE
    v_return BOOLEAN;
    BEGIN
    v_return := dbms_xdb.createFolder('/home/');
    v_return := dbms_xdb.createFolder('/home/DEV/');
    v_return := dbms_xdb.createFolder('/home/DEV/xsd/');
    v_return := dbms_xdb.createFolder('/home/DEV/messages/');
    v_return := dbms_xdb.createFolder('/home/DEV/employees/');
    COMMIT;
    END;
    STEP 2:
    Connecting To XML DB
    Step3:
    Register XML schema
    I am failing to execute step number 2 and hence not able to register the schema also.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by sudeepk:
    If a java exception is thrown probably during ur install u might have forgotten
    grant javauserpriv to scott;
    grant javasyspriv to scott;
    Thanks
    [email protected]
    <HR></BLOCKQUOTE>
    Thank you!!!

  • XML Schema registration error

    We installed XMLDB on Oracle Server Enterprise Edition 9.2.0.3 (AIX 4.3 version).
    The status from DBA_REGISTRY for Oracle XML DB is VALID.
    When trying to register schema, we get following error:
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 0
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 12
    ORA-06512: at line 35
    Here are the steps:
    1. Connect as SYS
    2. grant xdbadmin to wb_interface;
    3. connect as wb_interface;
    4. Try to register schema as follows
    declare
    doc varchar2(1000) := '&lt;schema
    targetNamespace="http://www.oracle.com/PO.xsd"
    xmlns:po="http://www.oracle.com/PO.xsd"
    xmlns="http://www.w3.org/2001/XMLSchema"&gt;
    &lt;complexType name="PurchaseOrderType"&gt;
    &lt;sequence&gt;
    &lt;element name="PONum" type="decimal"/&gt;
    &lt;element name="Company"&gt;
    &lt;simpleType&gt;
    &lt;restriction base="string"&gt;
    &lt;maxLength value="100"/&gt;
    &lt;/restriction&gt;
    &lt;/simpleType&gt;
    &lt;/element&gt;
    &lt;element name="Item" maxOccurs="1000"&gt;
    &lt;complexType&gt;
    &lt;sequence&gt;
    &lt;element name="Part"&gt;
    &lt;simpleType&gt;
    &lt;restriction base="string"&gt;
    &lt;maxLength value="1000"/&gt;
    &lt;/restriction&gt;
    &lt;/simpleType&gt;
    &lt;/element&gt;
    &lt;element name="Price" type="float"/&gt;
    &lt;/sequence&gt;
    &lt;/complexType&gt;
    &lt;/element&gt;
    &lt;/sequence&gt;
    &lt;/complexType&gt;
    &lt;element name="PurchaseOrder" type="po:PurchaseOrderType"/&gt;
    &lt;/schema&gt;';
    begin
    dbms_xmlschema.registerSchema('http://www.oracle.com/PO.xsd', doc);
    end;
    Please Help!!!

    check if the user already has the following privileges.
    CREATE SESSION
    CREATE TABLE
    CREATE TRIGGER
    CREATE TYPE
    ALTER SESSION
    Else grant them.
    The problem only comes when use do this in pl/sql.
    here is a work around example.
    create or replace function get_xml_data return varchar2 is
    doc varchar2(1000) := '<schema
    targetNamespace="http://www.oracle.com/PO.xsd"
    xmlns:po="http://www.oracle.com/PO.xsd"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <complexType name="PurchaseOrderType">
    <sequence>
    <element name="PONum" type="decimal"/>
    <element name="Company">
    <simpleType>
    <restriction base="string">
    <maxLength value="100"/>
    </restriction>
    </simpleType>
    </element>
    <element name="Item" maxOccurs="1000">
    <complexType>
    <sequence>
    <element name="Part">
    <simpleType>
    <restriction base="string">
    <maxLength value="1000"/>
    </restriction>
    </simpleType>
    </element>
    <element name="Price" type="float"/>
    </sequence>
    </complexType>
    </element>
    </sequence>
    </complexType>
    <element name="PurchaseOrder" type="po:PurchaseOrderType"/>
    </schema>';
    begin
    return doc;
    end;
    exec dbms_xmlschema.registerSchema('http://www.oracle.com/PO.xsd', get_xml_data);
    good luck.

  • Oracle XML Schema (Java) on Macintosh

    Hi Everybody,
    I tried your XML Schema parser on my Mac and I had no single platform specific Java or configuration problem. Congratulation. (I used the Windows download since I never had problems to unzip files)
    One minor problem is left: the file names in the doc folder are cut to 31 characters and this means that some links between some html files are broken.
    Have a look how how Sun uses JavaDoc: they would create a com folder that contains an oracle folder ... that contains the unqualified classname.html files.
    It would be nice if you could use JavaDoc the way Sun does it.
    Cheers,
    Gerd

    This is because of a known problem for JIT under AIX. Please turn of the JIT and run the program by:
    1/ set enviroment variable
    JAVA_COMPILER NONE
    2/ run java with -D option, like:
    java -Djava.compiler=NONE <your program>

  • Oracle XML Schema documentation

    Does anyone know if there are any good books, websites, etc ... with various examples on creating an xml schema that includes other schemas with different elements and how all schema objects are affected and linked when loading an xml instance file in the master schema? Most of the documentation I have found only discusses a schema with no includes and only one element. Thanks.

    I believe that the desired default date format only applies for two functions:
    "27.1 XML Date Formatting
    Dates and timestamps in generated XML are now in the formats specified by XML Schema. See Oracle XML DB Developer's Guide, Chapter "Generating XML Data from the Database", *section "XMLELEMENT and XMLATTRIBUTES SQL Functions"*, subsection "Formatting of XML Dates and Timestamps"."
    http://docs.oracle.com/cd/B19306_01/readmes.102/b14233/toc.htm#sthref85
    Your quote from the docs ( http://docs.oracle.com/cd/B19306_01/appdev.102/b14259/xdb13gen.htm#sthref1506 ) applies to the SQL/XML standard functions, and apparently not to DBMS_XMLGEN (one of the Oracle Database-provided functions).
    "It explains the SQL/XML standard functions and Oracle Database-provided functions and packages for generating XML data from relational content."
    http://docs.oracle.com/cd/B19306_01/appdev.102/b14259/xdb13gen.htm#ADXDB1600
    "If you otherwise need to produce a non-standard XML date or timestamp, use SQL function to_char"
    http://docs.oracle.com/cd/B19306_01/appdev.102/b14259/xdb13gen.htm#sthref1506

  • Xmldb schema registration problems

    Hi,
    I'm trying to register an xsd schema file which starts:
    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified" xdb:storeVarrayAsTable="true">
    <xs:import namespace="http://www.w3.org/1998/Math/MathML" schemaLocation="http://www.w3.org/Math/XMLSchema/mathml2/mathml2.xsd
    "/>
    <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="http://www.w3.org/TR/xml-i18n-bp/xmlspec/xlink.xsd"/>
    <!-- XSD import of namespace suppressed, whee -->
    <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
    Because of the xsd imports I have to register all of the dependent xsd files, but eventually end up at the start of the chain having to register datatypes.dtd (and XMLSchema.dtd)
    but I get this error for datatypes.dtd:
    Error starting at line 1 in command:
    begin
    DBMS_XMLSCHEMA.REGISTERURI(
    schemaurl => 'http://www.w3.org/2001/datatypes.dtd',
    schemadocuri => '/public/pmc/datatypes.dtd'
    end;
    Error report:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00247: invalid Document Type Declaration (DTD)
    Error at line 16
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 20
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 195
    ORA-06512: at line 2
    31011. 00000 - "XML parsing failed"
    *Cause:    XML parser returned an error while trying to parse the document.
    *Action:   Check if the document to be parsed is valid.
    The offending line is the first one after the comments:
    <!ENTITY % simpleType "%p;simpleType">
    Am I right in trying to register DTDs at all, or I have I got the wrong approach regarding imported XSDs in the first place ?
    (it's only W3C XSDs that are imported)
    Alan.

    Which database version are you using. In 11g all importent W3C schema's have already been registered including the xlink schema's. In 10g (although I never did a diff between the versions) the same are registered xlink stuff excluded.
    I wouldn't mix DTD and XML Schema's, but that's more a gut feeling then that I have a reason for it. It will make maintenance more difficult because you need an understanding for both notation methods

  • XML schema Registration ??

    Hello,
    Our environment is
    SQL*Plus: Release 9.2.0.4.0
    Oracle9i Enterprise Edition Release 9.2.0.4.0
    OS Windows 2000
    We registered XML schema in XML DB.
    oraxdb:schemaURL="PORR_MT030001Fatalities"
    <xsd:element name="BiologicsSafetyCase" type="PORR_MT030001.BiologicsSafetyCase" oraxdb:propNumber="271050" oraxdb:global="true" oraxdb:SQLName="BiologicsSafetyCase" oraxdb:SQLType="PORR_MT030001.Biologics1829_T" oraxdb:SQLSchema="HL7_KSMITH" oraxdb:memType="258" oraxdb:defaultTable="BiologicsSafetyCase1840_TAB" oraxdb:defaultTableSchema="HL7_KSMITH"/>
    When we query user_xml_tables. It shows following.
    SELECT "SYS"."USER_XML_TABLES"."TABLE_NAME" as "TABLE_NAME",
    "SYS"."USER_XML_TABLES"."XMLSCHEMA" as "XMLSCHEMA",
    "SYS"."USER_XML_TABLES"."ELEMENT_NAME" as "ELEMENT_NAME"
    FROM "SYS"."USER_XML_TABLES"
    WHERE ( "XMLSCHEMA" LIKE '%Fata%')
    TABLE_NAME XMLSCHEMA ELEMENT_NAME
    support1807_TAB PORR_MT030001Fatalities support
    BiologicsSafetyCase1840_TAB PORR_MT030001Fatalities BiologicsSafetyCase
    XXIfTRALI681800_TAB PORR_MT030001Fatalities XXIfTRALI68
    location1587_TAB PORR_MT030001Fatalities location
    XXEventDescription81799_TAB PORR_MT030001Fatalities XXEventDescription8
    manufacturingProcess1793_TAB PORR_MT030001Fatalities manufacturingProcess
    partOrganization1611_TAB PORR_MT030001Fatalities partOrganization
    organization1616_TAB PORR_MT030001Fatalities organization
    locatedPlace1583_TAB PORR_MT030001Fatalities locatedPlace
    causedRecipientReacti1798_TAB PORR_MT030001Fatalities causedRecipientReaction
    It shows additional O-R tables against different elements.
    Is it normal?
    How does these tables links with main table oraxdb:defaultTable="BiologicsSafetyCase1840_TAB" shows in registered schema header?
    Do we able to segment this schema ?
    Let me know your thought.
    Thanks in advance.
    Ram

    Hello,
    Our environment is
    SQL*Plus: Release 9.2.0.4.0
    Oracle9i Enterprise Edition Release 9.2.0.4.0
    OS Windows 2000
    We registered XML schema in XML DB.
    oraxdb:schemaURL="PORR_MT030001Fatalities"
    <xsd:element name="BiologicsSafetyCase" type="PORR_MT030001.BiologicsSafetyCase" oraxdb:propNumber="271050" oraxdb:global="true" oraxdb:SQLName="BiologicsSafetyCase" oraxdb:SQLType="PORR_MT030001.Biologics1829_T" oraxdb:SQLSchema="HL7_KSMITH" oraxdb:memType="258" oraxdb:defaultTable="BiologicsSafetyCase1840_TAB" oraxdb:defaultTableSchema="HL7_KSMITH"/>
    When we query user_xml_tables. It shows following.
    SELECT "SYS"."USER_XML_TABLES"."TABLE_NAME" as "TABLE_NAME",
    "SYS"."USER_XML_TABLES"."XMLSCHEMA" as "XMLSCHEMA",
    "SYS"."USER_XML_TABLES"."ELEMENT_NAME" as "ELEMENT_NAME"
    FROM "SYS"."USER_XML_TABLES"
    WHERE ( "XMLSCHEMA" LIKE '%Fata%')
    TABLE_NAME XMLSCHEMA ELEMENT_NAME
    support1807_TAB PORR_MT030001Fatalities support
    BiologicsSafetyCase1840_TAB PORR_MT030001Fatalities BiologicsSafetyCase
    XXIfTRALI681800_TAB PORR_MT030001Fatalities XXIfTRALI68
    location1587_TAB PORR_MT030001Fatalities location
    XXEventDescription81799_TAB PORR_MT030001Fatalities XXEventDescription8
    manufacturingProcess1793_TAB PORR_MT030001Fatalities manufacturingProcess
    partOrganization1611_TAB PORR_MT030001Fatalities partOrganization
    organization1616_TAB PORR_MT030001Fatalities organization
    locatedPlace1583_TAB PORR_MT030001Fatalities locatedPlace
    causedRecipientReacti1798_TAB PORR_MT030001Fatalities causedRecipientReaction
    It shows additional O-R tables against different elements.
    Is it normal?
    How does these tables links with main table oraxdb:defaultTable="BiologicsSafetyCase1840_TAB" shows in registered schema header?
    Do we able to segment this schema ?
    Let me know your thought.
    Thanks in advance.
    Ram

  • Oracle XML classgenerator /Servlet problem

    Hi,
    I'm developing a servlet that accepts an HTTP request, contacts a database, processes the request and return an XML document back to the browser. The XML document returned is dependent on which selection a user makes.
    The problem is that on first request, say user selects "choice one", the correct XML document is returned. However, when the browser's back button is used to go back and make the same choice as previous(ie "choice one"), Explorer 4.5 displays an empty page while netscape 4.5 return a document contains no data error.
    I used oracle xmlclassgenerator to generate the classes that create the XML document to be returned. The problem certainly lies in the method of my servlet that uses these classes to generate the XML document because when I replace the whole method with println statement every thing works fine(but of course without the XML document).
    The content of the method is as follows.
    ACCOUNT acc = new ACCOUNT(id);
    //Create a child and add child to root node
    NUM_OF_RESIDENTS nr = new NUM_OF_RESIDENTS(num);
    acc.addNode(nr);
    //Create another child and add to root node
    FIXED_COST fc = new FIXED_COST();
    ELECTRICITY el = new ELECTRICITY(elec);
    GAS g = new GAS(gas);
    WASH_MACHINE wm = new WASH_MACHINE(wash);
    WATER wat = new WATER(water);
    OTHER oth = new OTHER(other);
    fc.addNode(el);
    fc.addNode(g);
    fc.addNode(wm);
    fc.addNode(wat);
    fc.addNode(oth);
    //finally add to root node
    acc.addNode(fc);
    //Create another child
    TELEPHONE tl = new TELEPHONE();
    SUBSCRIPTION sub = new SUBSCRIPTION(tel);
    COST_PER_TICK cpt = new COST_PER_TICK(tick);
    tl.addNode(sub);
    tl.addNode(cpt);
    acc.addNode(tl);
    //Create another child
    // PREVIOUS_ACCOUNT pacc = new PREVIOUS_ACCOUNT();
    for(int i=0; i<previous_details.size(); i++){
    //Create another child
    PREVIOUS_ACCOUNT pacc = new PREVIOUS_ACCOUNT();
    PreviousDetails pd = (PreviousDetails)previous_details.elementAt(i);
    String name = pd.getName();
    String credit = pd.getCredit();
    String debit = pd.getDebit();
    NAME n = new NAME(name);
    LAST_CREDIT lc = new LAST_CREDIT(credit);
    LAST_DEBIT ld = new LAST_DEBIT(debit);
    pacc.addNode(n);
    pacc.addNode(lc);
    pacc.addNode(ld);
    acc.addNode(pacc);
    for(int i=0; i<acc_dates.size(); i++){
    String str = (String)acc_dates.elementAt(i);
    ACCOUNT_DATE ad = new ACCOUNT_DATE(str);
    acc.addNode(ad);
    acc.validateContent();
    ByteArrayOutputStream out1 = new ByteArrayOutputStream(1024);
    acc.print(out1);
    res.setContentType("text/plain");
    ServletOutputStream os = res.getOutputStream();
    PrintWriter out = new PrintWriter(os);
    out.println(out1.toString());
    out.close();
    catch(Exception e){}
    Am I doing somthing wrong here?
    Thanks.
    null

    Hi,
    I had a very similar problem, which turned out to be the way that I was referencing one schema from another. Originally I had something like the following in my main XSD:
    <xs:import namespace="http://www.govtalk.gov.uk/people/bs7666" schemaLocation="bs7666-v2-0.xsd"/>When I tried to register the schema using the schemaURL of 'http://www.govtalk.gov.uk/people/bs7666/bs7666-v2-0.xsd' I got ORA-31000: Resource 'bs7666-v2-0.xsd' is not an XDB schema document. I then tried to registering the schema using just it's name ie schemaURL => 'bs7666-v2-0.xsd' and this worked!
    With further investigation I found that if I change the schemaLocation in the import to a full URL I could then register the schema using that same URL:
    Reference from my main schema
    <xs:import namespace="http://www.govtalk.gov.uk/people/bs7666"
          schemaLocation="http://www.govtalk.gov.uk/people/bs7666/bs7666-v2-0.xsd"/>
    BEGIN
       DBMS_XMLSCHEMA.registerSchema
         ( SCHEMAURL => 'http://www.govtalk.gov.uk/people/bs7666/bs7666-v2-0.xsd'
         , SCHEMADOC => bfilename('XMLDIR','bs7666-v2-0.xsd')
         , LOCAL => FALSE
    END;Maybe someone could shed some light on the best practice for registering schemas? I understand that schemaURL is really just a reference for the schema and not actually used to locate the schema but is it better to use full URLs?
    Regards,
    Tom

  • Oracle Designer, schema registration

    Hi all,
    I have registered a DB schema in Oracle Designer (via jr_registration.register / jr_registration.generate). I understand how to use registered tables, but what about registered pl/sql packages? Where can I see them and how can I put them under version control?
    Thanks.

    Yes, you are right, I need to find registered PL/SQL in the Designer. But I can't see it neither in RON nor in DE. I try to find it under repository owner, where I have registered the schema. May be I must to do some extra steps along with registration/generation?
    Here is my code I'm using for registration "repository_user" user:
    begin
    jr_registration.register('repository_user');
    commit;
    jr_registration.generate('repository_user');
    commit;
    end;

  • XML Schema include problem

    Hello,
    Designer 7.1 crashes while loading xsd schema with xsd:include
    I've tried with absolute path:
    and relative path:
    and results are the same: no message, the only thing to do is to kill Designer
    I am working with 7.1 french version
    Can somebody help me
    Maciek Dambski

    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.

  • Not simple xml schema registration

    How can i register schema from xsd file that contain includes of other xsd files, like "<xs:include schemaLocation="common/dataTypes.xsd"/>".

    How can i register schema from xsd file that contain includes of other xsd files, like "<xs:include schemaLocation="common/dataTypes.xsd"/>".

  • Help needed with XML Schema Processor sample

    I'm trying to run the sample that came with the Oracle XML Schema Processor (XSDSample.java) and get the following error:
    -- process file: catalogue.xml
    file:/D:/java/xml/ORACLE/XSD/catalogue.xml<Line 8, Column 32>: XSD-2001: (Error) Can not create instance of: 'oracle.xml.parser.schema.XSDBuilder'
    What am I doing wrong. I am running the sample unchanged.
    thx,
    e
    null

    Looks like unzipping the jar and making sure its in your classpath fixed the problem. not sure why explicitly having the xschema.jar in the classpath didn't work.
    e

  • Exp XML Schema (.xsd) to another schema on same instance

    Hello,
    I hope someone on this forum can help me or point me in the correct direction. I want to export a schema which contains a table (EQUIPMENT) which has a XMLType column defined against a registered .xsd. I would then like to restored this schema to another schema on the same instance (development instance) and also onto another db instance.
    I have been trying to do this with the help of "Chapter 30 Importing and Exporting XMLType Tables" from the Oracle® XML DB Developer's Guide
    10g Release 2 (10.2). Unfortunately without success. At the end of this message I have encluded sample error messages that I am receiving for creation of TYPES which is causing my import to fail.
    I cannot find any examples on the web on how to achieve an exp from one schema and imp in another either on the same instance or another one.
    DDL for my table is :
    create table EQUIPMENT
    ID number(7) not null,
    STATUSID number(7) not null,
    ATTRIBUTEDATA xmltype
    xmltype column ATTRIBUTEDATA xmlschema "EQUIPMENT.xsd" element EQUIPMENT_XML
    tablespace TBS_DATA1;
    Three test runs as follows:
    1. Using an empty u2 schema and I register the .xsd file. Then I try to import (FROMUSER - TOUSER imp mode) my dump file which leads to the following error:
    IMP-00017: following statement failed with ORACLE error 2304:
    "CREATE TYPE "MTA1440_T" TIMESTAMP '2007-11-14:14:42:16' OID '3EE57B10307317"
    "74E044080020C94102' AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T",""
    "ATTRIBUTE_01" NUMBER(38),"ATTRIBUTE_02" VARCHAR2(4000 CHAR),"ATTRIBUTE_03" "
    "VARCHAR2(4000 CHAR),"ATTRIBUTE_04" NUMBER(38),"ATTRIBUTE_05" VARCHAR2(4000 "
    "CHAR))FINAL INSTANTIABLE "
    IMP-00003: ORACLE error 2304 encountered
    NOTE: Even though import failed, I now see a new TYPE created called "MTA1526_T".
    2. If I try to create the TYPE as is from the error above I get the following error:
    SQL> CREATE TYPE MTA1440_T
    2 OID '3EE57B1030731774E044080020C94102'
    3 AS OBJECT (SYS_XDBPD$ XDB.XDB$RAW_LIST_T,
    4 ATTRIBUTE_01 NUMBER(38),
    5 ATTRIBUTE_02 VARCHAR2(4000 CHAR),
    6 ATTRIBUTE_03 VARCHAR2(4000 CHAR),
    7 ATTRIBUTE_04 NUMBER(38),
    8 ATTRIBUTE_05 VARCHAR2(4000 CHAR)) FINAL INSTANTIABLE;
    9 /
    CREATE TYPE MTA1440_T
    ERROR at line 1:
    ORA-02304: invalid object identifier literal
    3. So now I create the "MTA1440_T" type without the OID value and retry the import.
    IMP-00061: Warning: Object type "U2"."MTA1440_T" already exists with a different identifier
    "CREATE TYPE "MTA1440_T" TIMESTAMP '2007-11-14:14:42:16' OID '3EE57B10307317"
    "74E044080020C94102' AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T",""
    "ATTRIBUTE_01" NUMBER(38),"ATTRIBUTE_02" VARCHAR2(4000 CHAR),"ATTRIBUTE_03" "
    "VARCHAR2(4000 CHAR),"ATTRIBUTE_04" NUMBER(38),"ATTRIBUTE_05" VARCHAR2(4000 "
    "CHAR))FINAL INSTANTIABLE "
    Questions from me:
    A. Can I export TYPES only as suggested by the online documentation ?
    B. If importing onto same instance in another schema surely the OID for the TYPE will always fail - so then why can the import not create the required TYPE name itself during the import ?
    C. Should I use global TYPES and Register the .XSD globally for all schema's in an instance to validate against .. would this prevent me from having errors on an import ?
    I would appreciate any insight any one could provide me. Many thanks in advance.
    Dom

    Hi Guys,
    Thank you all for the replies. I am dissappointed to hear that in 10g does not support exp/imp of schema's structured XML. However I am a little confused or should I say mislead by the "" documentation I
    Here is an extract from chapter "30 - Importing and Exporting XMLType Tables" from the Oracle XML DB 10g Developers Guide documentation:
    "..... Oracle Database supports the import and export of XML schema-based XMLType tables. An XMLType table depends on the XML schema used to define it. Similarly the XML schema has dependencies on the SQL object types created or specified for it. Thus, exporting a user with XML schema-based XMLType tables, consists of the following steps:
    1. Exporting SQL Types During XML Schema Registration. As a part of the XML
    schema registration process .....
    2. Exporting XML Schemas. After all the types are exported, XML schemas are
    exported as XML text .....
    3. Exporting XML Tables. The next step is to export the tables. Export of each table consists of two steps:
    A. The table definition is exported as a part of the CREATE TABLE statement....
    B. The data in the table is exported as XML text. Note that data for out-of-line
    tables is.....
    From this documentation I was under the impression that the exp/imp of XML Schema-Based XMLType Tables was supported.
    Regarding the backup mechanism/strategy for database schema's containing tables with Schema-Based XMLTypes what would you recommend the best online backup method to use - tablespace backups ?
    What I need to be able to do in day-to-day work is to have the ability to be able to take a copy of a customers UAT or production database schema and apply it to a dev or test db instance here for bug testing etc. Do you have any advice on best to achieve this without the use of an exp/imp when the schema will contain Schema-Based XMLType tables.
    Thank you all for your assistance so far.

  • Xml schema egistration

    i am new to xml . i using oracle 11g.while reading xml i came to know that xml schema registration.
    is it compulsary to work with xml data.what is the advantages of xml schema registration. with out registration also i am able to create xmltype tables and i am able to fetch data from tables. then what is the purpose of schema registration
    schema registration means what happening exactly.

    Schema Registration typically leads to better performance. With Binary XML / XML Index the differences are not critical for most applications. It also allows for better datatyping and compression, since if we tags and datatypes in advance we do do a more efficient encoding. For certain classes of applicaiton, where the object relational storage model is appropraite schema registration can lead to significantly better performance. See the XML DB basic demo for more info and the Hands on Lab for info related to Binary XML and XML Index

Maybe you are looking for