Storing XML schema in database

Hi everybody..I have question here related to the storing of the XML schema in the database. When an XML Schema is created like this.
dbms_xdb.createResource('home/DEV/xml_schema_test.xsd'),
then is the XSD created and stored in one of the database tables or is it stored physcially as an xsd file in the database repository or both?
If it is stored in one of database tables, then which table is it?
If it is stored as an XSD file in the database repository, then how can I access the xsd file if I created it like in the example above.
To access the xsd file over http, do I need to start the xsdhttp server or is it already started if I loaded XDK in my database.
Would the url for accessing the same over http be
http://db_machine:8080/home/DEV/xml_schema_test.xsd.
I think I have got information in bits and pieces but not able to put everything together.
Thanks in advance for the replies.

The questionssss you are asking are dealt with in the FAQ link at the top of the first page on this forum, the rest is described in detail in the XML DB Developers Guide. A little bit of reading wouldn't harm, would it.
Message was edited by:
mgralike

Similar Messages

  • Creating xml schema from database attributes

    Hi,
    I am trying to generate dynamic xml schemas from a java program.
    Please suggest me some solutions.
    The scenario is like this.
    The input to the java program is a table[oracle] name
    and based on that table's column headers, i need to define and
    create the xml schema dynamically.
    The purpose is that at a later point of time, i may
    need to copy the content of the database to xml files.
    Please reply with your suggestions.
    Thanks in advance,
    Dilip

    XML Schema itself is a well formed XML document. You can write a small utility class which can do this for you by using any XML API available in Java.
    Thanks,
    Tejas

  • Is JAXB the best solution to store XML schema in databse

    Hi, i have a doubt regarding which is better way to store XML schema to database.
    I have looked on JAXB, DOM, SAX.
    I should be able to modify the database and store back the changes in XML schema..
    i am really consfused about this.
    plz suggest me
    thanx

    Thank you for your reply
    As per as I know JAXB take XML schema as basis to
    create tables in database and store the XML data
    according to that . I want to store the XML Data in
    the database structured according to XML schema
    defined by me.I'm not sure how a schema would impact this. Schema is a data definition that constraints a given XML data document. The XML itself is stored as a string. Databases like Oracle now have XML column types and allow you to use XML querying languages and x-Path in normal SQL queries.
    There are 2 types of mapping from XML to datbase
    Table space and object relational
    A tablespace is conceptually similar to a namespace. Object relational mappers go from objects to relational databases and back. I do not see how either of these two concepts are mutually exclusive. And the latter makes no sense if you talking about an object database. There is no O/R mapping because there is no relational database, it's an object database.
    I want to do object-relational mapping from XML to
    o object oriented database . and the modifications
    done on the datbase want to store again in XML. As
    per as I know JAXB give us classes as per the XML
    schema and we can write DDL to store the data in
    databse
    JAXB is for marshalling and unmarshalling Java objects to and from XML. The XML itself can be stored in any LOB database column.
    Is it the right approach or do you have any better
    idea?I still do not really understand what you are trying to do. It seems like you have a bit too much technology soup to consume. What are the actual requirements?
    - Saish

  • Registration Of XML Schema

    Hi All,
    Created below block for registration of the XML Schema in database.
    Which is working fine.
    But strange thing is happing, actually when i am creating below code as stored procedure and executing sql prompt getting insufficent privilage.
    When running below code in form of unnamed block(Aynomanus Block) is working fine.
    Can you please help me understand why strange thing is happing.
    DECLARE
    PROCEDURE register_xml(p_schema_url VARCHAR2,p_xmlfile_url VARCHAR2,p_dir_name VARCHAR2)
    IS
    l_folders VARCHAR2(32767);
    PROCEDURE check_folders(p_folders VARCHAR2)
    IS
    v_return BOOLEAN;
    folder_exists EXCEPTION;
    PRAGMA EXCEPTION_INIT(folder_exists, -31003);
    l_pass NUMBER;
    BEGIN
    FOR i IN 1..(LENGTH(p_folders)-LENGTH(REPLACE(p_folders,'/'))) LOOP
    BEGIN
    IF SUBSTR(p_folders,1,INSTR(p_folders,'/',1,i+1)) IS NOT NULL THEN
    v_return := DBMS_XDB.CREATEFOLDER(SUBSTR(p_folders,1,INSTR(p_folders,'/',1,i+1)));
    END IF;
    EXCEPTION
    WHEN folder_exists THEN
    NULL;
    END;
    END LOOP;
    Dbms_Output.put_line('Commit Executed');
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20001,'Error while creating folders',TRUE);
    END check_folders;
    PROCEDURE register_xml_schema(p_xsd_url VARCHAR2,p_dir VARCHAR2)
    IS
    l_ret BOOLEAN;
    BEGIN
    l_ret := DBMS_XDB.CREATERESOURCE(
    abspath => SUBSTR(p_xsd_url,INSTR(p_xsd_url,'/',1,3)),
    data => BFILENAME (p_dir,SUBSTR(p_xsd_url,INSTR(p_xsd_url,'/',-1)+1))
    IF l_ret THEN
    DBMS_XMLSCHEMA.REGISTERSCHEMA(
    schemaurl => p_xsd_url,
    schemadoc => sys.UriFactory.getUri(SUBSTR(p_xsd_url,INSTR(p_xsd_url,'/',1,3)))
    COMMIT;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20002,'Error while registring schema xsd file',TRUE);
    END register_xml_schema;
    PROCEDURE register_xml_file(p_xml_url VARCHAR2,p_dir VARCHAR2)
    IS
    v_return BOOLEAN;
    l_folders VARCHAR2(32767);
    BEGIN
    l_folders := SUBSTR(p_xml_url,
    INSTR(p_xml_url,'/',1,3),
    (INSTR(p_xml_url,'/',1,(LENGTH(p_xml_url)-LENGTH(REPLACE(p_xml_url,'/'))))-INSTR(p_xml_url,'/',1,3))+1
    DBMS_OUTPUT.PUT_LINE('Folders -->'||l_folders);
    check_folders(l_folders);
    v_return := DBMS_XDB.CREATERESOURCE(
    abspath => SUBSTR(p_xml_url,INSTR(p_xml_url,'/',1,3)),
    data => BFILENAME (p_dir,SUBSTR(p_xml_url,INSTR(p_xml_url,'/',-1)+1))
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20003,'Error while registring xml file',TRUE);
    END register_xml_file;
    PROCEDURE delete_schema(p_schema_url VARCHAR2,p_xml_url VARCHAR2)
    IS
    BEGIN
    DBMS_XDB.DELETERESOURCE(
    abspath => SUBSTR(p_xml_url,INSTR(p_xml_url,'/',1,3))
    DBMS_XDB.DELETERESOURCE(
    abspath => SUBSTR(p_schema_url,INSTR(p_schema_url,'/',1,3))
    DBMS_XMLSCHEMA.DELETESCHEMA(
    schemaurl => p_schema_url,
    delete_option => 4
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END delete_schema;
    BEGIN
    l_folders := SUBSTR(p_schema_url,
    INSTR(p_schema_url,'/',1,3),
    (INSTR(p_schema_url,'/',1,(LENGTH(p_schema_url)-LENGTH(REPLACE(p_schema_url,'/'))))-INSTR(p_schema_url,'/',1,3))+1
    check_folders(l_folders);
    delete_schema(p_schema_url,p_xmlfile_url);
    register_xml_schema(p_schema_url,p_dir_name);
    register_xml_file(p_xmlfile_url,p_dir_name);
    EXCEPTION
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20004,'Error while working with XML Schema Structure',TRUE);
    END register_xml;
    BEGIN
    register_xml('http://localhost:8080/public/demo/xsd/db_objects.xsd','http://localhost:8080/public/demo/xsd/db_objects.xml','XML_DIR');
    END;
    Thanks
    Sandeep

    I cannot help you, but i can say that I have the same your problem, everything works fine if i run in an anonymous block, while gettin insufficient privileges when run it in a store procedure.

  • Java Stored Procedure SAXParser XML Schema Validation

    Using Oracle XML Developers Kit 10.2.0.2.0 - Production.
    Attempting to validate using XML Schema in a Java stored procedure with the code:
                   if ( schemaDoc == null )
                        // Obtain default connection
                        Connection conn = new OracleDriver().defaultConnection();
                        OraclePreparedStatement stmt = (OraclePreparedStatement) conn.prepareStatement("SELECT XmlDocObj FROM XmlDoc WHERE XmlDocNbr = 2");
                        OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
                        if ( rset.next() )
                             // get the XMLType
                             XMLType schemaXml = (XMLType)rset.getObject(1);
                             XSDBuilder builder = new XSDBuilder();
                             XMLSchema schemaDoc = (XMLSchema)builder.build(new InputSource(schemaXml.getInputStream()));
                   if ( inst == null )
                        inst = new ValidateCoreRequest();
                   ErrorHandlerImpl handler = inst.getNewErrorHandler();
    SAXParser saxParser = new SAXParser();
    saxParser.setXMLSchema(schemaDoc);
    saxParser.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    saxParser.setErrorHandler(handler);
    saxParser.parse(new InputSource(new StringReader(docStr)));
    if( handler.validationError )
                        errorMsg[0] = handler.saxParseException.getMessage().substring(0, Math.min(199, handler.saxParseException.getMessage().length()));
    Never reports validation errors in the XML. Although the XDK Programmers Guide states "...you can use
    the oracle.xml.parser.schema.XSDBuilder class to build an XML schema and
    then configure the parser to use it by invoking the XMLParser.setXMLSchema()
    method. In this case, the XML parser automatically sets the validation mode to
    SCHEMA_STRICT_VALIDATION and ignores the schemaLocation and
    noNamespaceSchemaLocation attributes." No validation seems to occur. I have tried to set an xsi:noNamespaceSchemaLocation attribute on the root XML node, but this results in URL errors if the URL is not valid or schema build errors if the URL is valid, but does not point to a real location.
    It appears that without a schema location attribute, no schema validation occurs. Using setXMLSchema() with a database source does not seem to cause the schema location attributes to be ignored. At least for Java stored procedures.
    Does XML Schema validation work in the database for externally referenced schemas?
    Thank You,
    Art

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jan Vissers ([email protected]):
    I have two schemas A and B. A contains a java stored procedure which calls a java stored procedure stored in B. Upon resolving the "A" Java Stored Procedures I get the following error:
    ORA-29545: badly formed class: at offset 3093 of Adapter.TFADPBeschikbaarheid.sendAanvraag expecting a class-oracle.xml.parser.v2.XMLDocument but encountered a class-oracle.xml.parser.v2.XMLDocument.
    ... Question:
    it is expecting something which it has in fact encountered... SO!!!! What is the error.
    Thx,
    Jan<HR></BLOCKQUOTE>
    Try this:
    Edit your XSU installation script located on lib directory of Oracle XSU's distribution:
    Find the line:
    loadjava -r -v -u $USER_PASSWORD xmlparserv2.jar
    Replace by:
    loadjava -r -v -g public -u $USER_PASSWORD xmlparserv2.jar
    And installs your Oracle XSU again.
    Best regards, Marcelo.

  • 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!!!

  • XDK 9.2.0.2.0  XML Schema Validation within Oracle 8i database

    I am little confused on this forum regarding my problem to find out the possibility of XML Schema Validation using SAX Parser within Oracle 8.1.7 database java stored procedures.
    Right know I am trying to find out if it is possible to make XML Schema Validation using SAX parser within Oracle 8.1.7 java stored procedures using (loading) new Oracle 9i Rel 2 XDK jar files into database.
    Thanks

    I am little confused on this forum regarding my problem to find out the possibility of XML Schema Validation using SAX Parser within Oracle 8.1.7 database java stored procedures.
    Right know I am trying to find out if it is possible to make XML Schema Validation using SAX parser within Oracle 8.1.7 java stored procedures using (loading) new Oracle 9i Rel 2 XDK jar files into database.
    Thanks

  • XML Schema Collection (SQL Server 2012): How to create an XML Schema Collection that can be used to Validate a field name (column title) of an existing dbo Table of a Database in SSMS2012?

    Hi all,
    I used the following code to create a new Database (ScottChangDB) and a new Table (marvel) in my SQL Server 2012 Management Studio (SSMS2012) successfully:
    -- ScottChangDB.sql saved in C://Documents/SQL Server XQuery_MacLochlainns Weblog_code
    -- 14 April 2015 09:15 AM
    USE master
    IF EXISTS
    (SELECT 1
    FROM sys.databases
    WHERE name = 'ScottChangDB')
    DROP DATABASE ScottChangDB
    GO
    CREATE DATABASE ScottChangDB
    GO
    USE ScottChangDB
    CREATE TABLE [dbo].[marvel] (
    [avenger_name] [char] (30) NULL, [ID] INT NULL)
    INSERT INTO marvel
    (avenger_name,ID)
    VALUES
    ('Hulk', 1),
    ('Iron Man', 2),
    ('Black Widow', 3),
    ('Thor', 4),
    ('Captain America', 5),
    ('Hawkeye', 6),
    ('Winter Soldier', 7),
    ('Iron Patriot', 8);
    SELECT avenger_name FROM marvel ORDER BY ID For XML PATH('')
    DECLARE @x XML
    SELECT @x=(SELECT avenger_name FROM marvel ORDER BY ID FOR XML PATH('Marvel'))--,ROOT('root'))
    SELECT
    person.value('Marvel[4]', 'varchar(100)') AS NAME
    FROM @x.nodes('.') AS Tbl(person)
    ORDER BY NAME DESC
    --Or if you want the completed element
    SELECT @x.query('/Marvel[4]/avenger_name')
    DROP TABLE [marvel]
    Now I am trying to create my first XML Schema Collection to do the Validation on the Field Name (Column Title) of the "marvel" Table. I have studied Chapter 4 XML SCHEMA COLLECTIONS of the book "Pro SQL Server 2008 XML" written by
    Michael Coles (published by Apress) and some beginning pages of XQuery Language Reference, SQL Server 2012 Books ONline (published by Microsoft). I mimicked  Coles' Listing 04-05 and I wanted to execute the following first-drafted sql in
    my SSMS2012:
    -- Reference [Scott Chang modified Listing04-05.sql of Pro SQL Server 2008 XML by Michael Coles (Apress)]
    -- [shcColes04-05.sql saved in C:\\Documents\XML_SQL_Server2008_code_Coles_Apress]
    -- [executed: 2 April 2015 15:04 PM]
    -- shcXMLschemaTableValidate1.sql in ScottChangDB of SQL Server 2012 Management Studio (SSMS2012)
    -- saved in C:\Documents\XQuery-SQLServer2012
    tried to run: 15 April 2015 ??? AM
    USE ScottChangDB;
    GO
    CREATE XML SCHEMA COLLECTION dbo. ComplexTestSchemaCollection_all
    AS
    N'<?xml version="1.0"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="marvel">
    <xsd:complexType>
    <xsd:all>
    <xsd:element name="avenger_name" />
    <xsd:element name="ID" />
    </xsd:all>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>';
    GO
    DECLARE @x XML (dbo. ComplexTestSchemaCollection_all);
    SET @x = N'<?xml version="1.0"?>
    <marvel>
    <avenger_name>Thor</name>
    <ID>4</ID>
    </marvel>';
    SELECT @x;
    GO
    DROP XML SCHEMA COLLECTION dbo.ComplexTestSchemaCollection_all;
    GO
    I feel that drafted sql is very shaky and it needs the SQL Server XML experts to modify to make it work for me. Please kindly help, exam the coding of my shcXMLTableValidate1.sql and modify it to work.
    Thanks in advance,
    Scott Chang

    Hi Scott,
    2) Yes, FOR XML PATH clause converts relational data to XML format with a specific structure for the "marvel" Table. Regarding validate all the avenger_names, please see below
    sample.
    DECLARE @x XML
    SELECT @x=(SELECT ID ,avenger_name FROM marvel FOR XML PATH('Marvel'))
    SELECT @x
    SELECT
    n.value('avenger_name[1]','VARCHAR(99)') avenger_name,
    n.value('ID[1]','INT') ID
    FROM @x.nodes('//Marvel') Tab(n)
    WHERE n.value('ID[1]','INT') = 1 -- specify the ID here
    --FOR XML PATH('Marvel')  --uncommented this line if you want the result as element type
    3)i.check the xml schema content
    --find xml schema collection
    SELECT ss.name,xsc.name collection_name FROM sys.xml_schema_collections xsc JOIN sys.schemas ss ON xsc.schema_id= ss.schema_id
    select * from sys.schemas
    --check the schema content,use the name,collection_name from the above query
    SELECT xml_schema_namespace(N'name',N'collection_name')
    3)ii. View can be viewed as virtual table. Use a view to list the XML schema content.
    CREATE VIEW XSDContentView
    AS
    SELECT ss.name,xsc.name collection_name,cat.content
    FROM sys.xml_schema_collections xsc JOIN sys.schemas ss ON xsc.schema_id= ss.schema_id
    CROSS APPLY(
    SELECT xml_schema_namespace(ss.name,xsc.name) AS content
    ) AS cat
    WHERE xsc.name<>'sys'
    GO
    SELECT * FROM XSDContentView
    By the way, it would be appreciated if you can spread your questions into posts. For any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • SQL Server 2012 Management Studio:In the Database, how to print out or export the old 3 dbo Tables that were created manually and they have a relationship for 1 Parent table and 2 Child tables?How to handle this relationship in creating a new XML Schema?

    Hi all,
    Long time ago, I manually created a Database (APGriMMRP) and 3 Tables (dbo.Table_1_XYcoordinates, dbo.Table_2_Soil, and dbo.Table_3_Water) in my SQL Server 2012 Management Studio (SSMS2012). The dbo.Table_1_XYcoordinates has the following columns: file_id,
    Pt_ID, X, Y, Z, sample_id, Boring. The dbo.Table_2_Soil has the following columns: Boring, sample_date, sample_id, Unit, Arsenic, Chromium, Lead. The dbo.Table_3_Water has the following columns: Boring, sample_date, sample_id, Unit, Benzene, Ethylbenzene,
    Pyrene. The dbo.Table_1_XYcoordinates is a Parent Table. The dbo.Table_2_Soil and the dbo.Table_3_Water are 2 Child Tables. The sample_id is key link for the relationship between the Parent Table and the Child Tables.
    Problem #1) How can I print out or export these 3 dbo Tables?
    Problem #2) If I right-click on the dbo Table, I see "Start PowerShell" and click on it. I get the following error messages: Warning: Failed to load the 'SQLAS' extension: An exception occurred in SMO while trying to manage a service. 
    --> Failed to retrieve data for this request. --> Invalid class.  Warning: Could not obtain SQL Server Service information. An attemp to connect to WMI on 'NAB-WK-02657306' failed with the following error: An exception occurred in SMO while trying
    to manage a service. --> Failed to retrieve data for this request. --> Invalid class.  .... PS SQLSERVER:\SQL\NAB-WK-02657306\SQLEXPRESS\Databases\APGriMMRP\Table_1_XYcoordinates>   What causes this set of error messages? How can
    I get this problem fixed in my PC that is an end user of the Windows 7 LAN System? Note: I don't have the regular version of Microsoft Visual Studio 2012 in my PC. I just have the Microsoft 2012 Shell (Integrated) program in my PC.
    Problem #3: I plan to create an XML Schema Collection in the "APGriMMRP" database for the Parent Table and the Child Tables. How can I handle the relationship between the Parent Table and the Child Table in the XML Schema Collection?
    Problem #4: I plan to extract some results/data from the Parent Table and the Child Table by using XQuery. What kind of JOIN (Left or Right JOIN) should I use in the XQuerying?
    Please kindly help, answer my questions, and advise me how to resolve these 4 problems.
    Thanks in advance,
    Scott Chang    

    In the future, I would recommend you to post your questions one by one, and to the appropriate forum. Of your questions it is really only #3 that fits into this forum. (And that is the one I will not answer, because I have worked very little with XSD.)
    1) Not sure what you mean with "print" or "export", but when you right-click a database, you can select Tasks from the context menu and in this submenu you find "Export data".
    2) I don't know why you get that error, but any particular reason you want to run PowerShell?
    4) If you have tables, you query them with SQL, not XQuery. XQuery is when you query XML documents, but left and right joins are SQL things. There are no joins in XQuery.
    As for left/right join, notice that these two are equivalent:
    SELECT ...
    FROM   a LEFT JOIN b ON a.col = b.col
    SELECT ...
    FROM   b RIGHT JOIN a ON a.col = b.col
    But please never use RIGHT JOIN - it gives me a headache!
    There is nothing that says that you should use any of the other. In fact, if you are returning rows from parent and child, I would expect an inner join, unless you want to cater for parents without children.
    Here is an example where you can study the different join types and how they behave:
    CREATE TABLE apple (a int         NOT NULL PRIMARY KEY,
                        b varchar(23) NOT NULL)
    INSERT apple(a, b)
       VALUES(1, 'Granny Smith'),
             (2, 'Gloster'),
             (4, 'Ingrid-Marie'),
             (5, 'Milenga')
    CREATE TABLE orange(c int        NOT NULL PRIMARY KEY,
                        d varchar(23) NOT NULL)
    INSERT orange(c, d)
       VALUES(1, 'Agent'),
             (3, 'Netherlands'),
             (4, 'Revolution')
    SELECT a, b, c, d
    FROM   apple
    CROSS  JOIN orange
    SELECT a, b, c, d
    FROM   apple
    INNER  JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    LEFT   OUTER JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    RIGHT  OUTER JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    FULL OUTER JOIN orange ON apple.a = orange.c
    go
    DROP TABLE apple, orange
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Database schema generation from an XML schema

    From XDK FAQ:
    Question:
    Given a DTD, will XML SQL Utility generate the database schema?
    Answer:
    No. Due to a number of shortcomings of the DTD, this >functionality is not available. Once the W3C XML Schema >recommendation is finalized this functionality will become >feasible.Has this capability been implemented yet? I want to go from an XML schema to a database schema. If not is it still in the plan to do so? Are there other tools someone can recommend that can do this?
    Thanks,
    John

    The XML Schema support will be part of XDB in 9i Release 2.

  • Generate XML Schema from Oracle Database

    Is there a utility that would allow our team to generate XML Schemas directly from existing Oracle databases? Or do you have a suggestion on how to achieve this?
    Thank you.

    Hey, The Schema Processor is available in the Technologies section on this site. Just download it and see the samples. You will get the way for doing it. If you are having problems then just call me.
    Bye.
    null

  • Storing DTD or xml schema in DB

    Is there a recommended best practice for using db tables to store constraints represented by a DTD or xml schema? I'm not looking to store a normal xml doc in the db, but rather something like the DTD that can be read and used to validate incoming documents. I'd also rather have this in a table somehow to handle changes to the DTD structure. Any advice much appreciated -
    Rob

    You are correct that there is no XML Schema for our configuration files.
    One of the reasons is that custom adapters can configure any settings they need in their destinations.  The other reason is that the server will not start if there is anything in the config XML that isn't read by the server on startup.  This ensures that mis-spellings and invalid tags do not get ignored.
    You are right however, we should create an xsd for them.  I filed an enhancement request - #2726353.
    Tom

  • Database to XML with XSD (XML schema)

    I have an Oracle 9 DB.
    I need to convert data from a table (Java ResultSet) to XML (I have an XML schema file).
    How can I do?
    Is there a tool?
    Thanks, Ludo.

    Refer to
    Oracle Xml Sql Utility.
    http://www.xml.com/pub/r/846

  • How to store data from xml in oracle database

    Hello All
    Could anyone tell me ways of storing XML in Oracle and whats the best one in terms of performance issues.
    any URL to this q/s would be great.
    thanks
    kedar

    Ben,
    The following link as some information regarding DOM API and XSQL.
    http://asktom.oracle.com/pls/ask/f?p=4950:8:2923508047773696280::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:17309127931717
    For XML DB, you may want to create an XMLSchema and build a table off the schema definition. Then use WEBDAV to load the xml into a folder (ie object table) Once the xml is in the database you could build a view for a relational look at the data.
    Example from XMLDB Techical White Paper doc.
    create or replace view PURCHASEORDER_MASTER_VIEW
    (reference, requestor, userid, costcenter,...)
    as select extractValue(Value(p),'/PurchaseOrder/Reference'),
    extractValue(value(p),'/PurchaseOrder/Requestor'),
    extractValue(value(p),'/PurchaseOrder/User'),
    extractValue(value(p),'/PurchaseOrder/CostCenter'),...
    from PURCHASEORDER p

  • 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

Maybe you are looking for

  • Elements are not displaying in webdynpro view's layout area

    Hi All Webdynpro Experts, Im new to abap.  Im working in webdynpro. Im facing a issue now. By Default, I need to disable a button (u201CCreate Responseu201D) in FPM_OIF_COMPONENT WebDynpro component in CNR_VIEW. But the thing is I cannot see the any

  • Using Photoshop Elements7 / How to enter text on Photo

    I have a photo with around 75 people in it. I am attempting to identify each one with a number, by placing a number on each one, then at the bottom of the photo entering the number and name by the number. End result being able to tell who each indivi

  • Reading mails from outlook express

    hi.. i m doin a project on Bayesian Filters to detect spam mails.I need to extract mails from microsoft outlook express that are in the .dbx format as text files.Can someone jus help me out with this.. Its urgent!!! it should b usin java.I have heard

  • Error occuers in smartform

    Hello Guys,,,, When i am trying to see the previw of the quotation it opens in a new wondow and says "Error occuers in smartform". Rest of the screen is blank.  i checked this from standard SAP Bsuiness roles. it does the same. I checked from GUI and

  • SAP Archiving FI_DOCUMNT

    I'm trying to change the structure from SARI SAP_FI_DOC_002 and got the following error. Error in info structure SAP_FI_DOC_002 analysis program in line 412 Message no. Q6227 Diagnosis There is a syntax error in line 412 of the generated reporting pr