How to Update an XML schema..

Hi All,
I am new to XML concept. I have a requirement to create a xml schema which will be updated on a weekly basis and a table which associated to the created xml schema.. when ever the Schema is updated the table should not get affected.. Is there a way to solve my problem.. Kindly help me.
I am using the following client:
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 31 11:44:59 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
////////////////////////////////// XML Schema ///////////////////////
begin
dbms_xmlschema.registerSchema(
'http://www.oradev.com/chipsxml1.xsd',
'<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.oradev.com/chipsxml1.xsd"
xmlns:samp="http://www.oradev.com/chipsxml1.xsd"
version="1.0">
<element name="HICC">
<complexType>
<sequence>
     <element name="UTI">
          <complexType>
          <sequence>
          <element name = "U01" type = "string"/>
          <element name = "U02" type = "string"/>
          <element name = "U03" type = "string"/>
          <element name = "U03a" type = "string"/>
          <element name = "U03b" type = "string"/>
          <element name = "U03c" type = "string"/>          
          <element name = "U04" type = "string"/>                    
          <element name = "U05" type = "string"/>                    
          </sequence>
          </complexType>
     </element>
     <element name="SSI">
          <complexType>
          <sequence>
          <element name = "S01" type = "string"/>
          <element name = "S02" type = "string"/>
          <element name = "S02A" type = "string"/>
          <element name = "S02B" type = "string"/>
          <element name = "S02C" type = "string"/>          
          </sequence>
          </complexType>
     </element>
</sequence>
</complexType>
</element>
</schema>',
TRUE, TRUE, FALSE, FALSE);
end;
////////////////////////// Table which has multiple Column //////////////////////////
CREATE TABLE chipsxmltable2 (
id number, HICCXMLDATA XmlType)
XMLTYPE HICCXMLDATA STORE AS OBJECT RELATIONAL
XMLSCHEMA "http://www.oradev.com/chipsxml1.xsd"
ELEMENT "HICC";
///////////////////////////////// Insert Query in chipsxmltable //////////////////////////
INSERT INTO chipsxmltable2 VALUES(1,
xmltype.createxml('<?xml version="1.0"?>
<samp:HICC xmlns:samp="http://www.oradev.com/chipsxml1.xsd" >
<UTI>
<U01>No</U01>
<U02>Y</U02>
<U03>Y</U03>
<U03a>Y</U03a>
<U03b>Y</U03b>
<U03c>Y</U03c>     
<U04>Y</U04>
<U05>Y</U05>          
</UTI>
<SSI>
<S01>No</S01>
<S02>Y</S02>
<S02A>Y</S02A>
<S02B>Y</S02B>
<S02C>Y</S02C>
</SSI>
</samp:HICC>'));
//////// This is my Revised XML Schema ///////////////////////
begin
dbms_xmlschema.registerSchema(
'http://www.oradev.com/Rchipsxml1.xsd',
'<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.oradev.com/Rchipsxml1.xsd"
xmlns:samp="http://www.oradev.com/Rchipsxml1.xsd"
version="1.0">
<element name="HICC">
<complexType>
<sequence>
     <element name="UTI">
          <complexType>
          <sequence>
          <element name = "U01" type = "string"/>
          <element name = "U02" type = "string"/>
          <element name = "U03" type = "string"/>
          <element name = "U03a" type = "string"/>
          <element name = "U03b" type = "string"/>
          <element name = "U03c" type = "string"/>          
          <element name = "U04" type = "string"/>                    
          <element name = "U05" type = "string"/>                    
          </sequence>
          </complexType>
     </element>
</sequence>
</complexType>
</element>
</schema>',
TRUE, TRUE, FALSE, FALSE);
end;
My question is:
How to update schema without affecting my table and the data which has already in the table?
Apologies if the description is not clear. Kindly let me know if further details are needed. Many thanks for your help.
Very best regards,
Godwin Jebakumar C.V.
Thanks in advance,
Godwin Jebakumar

Duplicate thread : {thread:id=2171878}
Please mark this one as "answered".

Similar Messages

  • How to updating plugin.xml when it changed in 12C?

    After Importing the Plug-in Archive and Deploying it on Management Service with 12C, I need to make a change with plugin.xml in Plug-in Archive. Here it's the change,
    --- Old one:
    <PluginAttributes Type="MP" ReleaseStatus="Test"/>
    --- Change to:
    <PluginAttributes Type="MP" DisplayName="MySQL Database" Category="Databases"/>
    So I un-deployed Plug-in from Management Serbice, and used command "emcli import_update" to update the brand new OPAR file successfully, and the deployed again. But it seems the new plugin.xml didn't work at all, neither from UI nor the plugin.xml located under Management Server folder. I am sure it should work cause after I changed the Target Type and etc. in all related files to made a new plug-in, it works well.
    So how to updating plugin.xml when it changed in 12C? (It seems there is no option with MRS.)
    Thanks in advance!
    Best wishes,
    Satine

    Hey Caroy,
    Thank you for your help.
    It seems there is no entrance within page "Setup->Extensibility->Self Update" to delete a plugin. Would you please tell me more specific position?
    I will upgrade the version of plugin and try again to see if it works.
    Thanks,
    Satine

  • How to compare two xml schemas

    Hello guys,
    How to compare two xml schemas? is there any tool for that?
    Thanksinadvance
    kavita//

    XML Files may be compared with the oracle.xml.differ.XMLDiff class.
    A file consisting of the differences in the xml files gets generated. An XSLT to convert one file to the other also gets generated.

  • Updating registered XML Schema

    We're going to use Oracle XML DB (Oracle 9.2.0.5). We will register our XML Schema files to Oracle. In case we later want to update one of the registered schemas I tested updating some example schemas.
    I found a thread here in the forum with some steps to update a registered schema we:
    forum
    >
    For each table or column based on the schema
    1. Create a table with a column of XMLType which is not based on the
    XMLSchema. EG XMLType stored as CLOB
    2. Copy the content of the existing table into the CLOB based table.
    3. Delete the existing schema
    4. REgister the New Schema.
    5. Recreate teh tables and columns
    6. COpy the data into the new tables using supplied XSL transformation where
    necessary
    7. Delete tempoarary tables....
    I followed the steps and it works.
    But there is one thing I want to know:
    I have a schema A and a schema B and I want to use definitions of schema B in schema A, using the <import> element. Now I want to update schema B. When i follow the steps above i have to backup all tables/coloumns which contain elements defined in schema B. Then i delete the schema and reregister it. When trying to query data in schema A i get an error message: ORA-04045: errors during recompilation/revalidation. This is even if i reregister the previous schema with annotations.
    For now i have to delete schema A too and reregister schema A and B. Is there a way to only update a single schema without affecting the schemas using definitions of this schema?
    Imagine i use a library schema with a lot of type definitions and other schemas import this schema because they need to use some of these types, then i have to update/reregister all the schemas. So any suggestions are welcomed.

    Please check if this helps:
    http://www.oracle.com/technology/oramag/oracle/03-jul/o43xml.html

  • How to handle multiple xmls(schemas) using java

    Can anyone give me solution for the below issue.
    We are handling five types of xmls(five different xsds) in our application.We have the XML and its XSD in database. Currently we are using JAXB to create and update the xmls.
    In future there is a chance to add new schema. In that case our current code will not work (because the JAXB is tightly coupled with the xsds) for new schema. Is there any technology or method to handle this situvation?
    I am looking for early respons.
    Thanks
    Dhans

    You have no idea? Then look in your JavaMail download and you will find several sample programs that you can use to get started. It would also help to read the JavaMail FAQ (Google will find it easily for you).

  • How to update session.xml file

    any body have an idea about how to update the session.xml file using Toplink workbench Editor.
    I have an Jar file which contains the session.xml file , so i am trying to update the session.xml file with me database details.

    any body have an idea about how to update the
    session.xml file using Toplink workbench Editor.
    For 10.1.3, see "Sessions Configurations and the sessions.xml File" in the TopLink Developer's Guide: http://www.oracle.com/technology/products/ias/toplink/doc/10131/main/_html/sesun002.htm#CACIGEBC
    For 10.1.2, see "OracleAS TopLink Sessions Editor" in the TopLink Mapping Workbench Guide: http://download.oracle.com/docs/cd/B14099_16/web.1012/b15900/tscedit.htm

  • How to load an XML schema with Data Integrator ?

    Post Author: Kris Van Belle
    CA Forum: Data Integration
    Is someone having experience with loading data from a regular table into an XML schema ?
    What are exactly the steps to undertake ? The DI user manual does not provide that much information...

    Post Author: bhofmans
    CA Forum: Data Integration
    Hi Kris,
    In the Designer.pdf there is a chapter called 'nested data' with more information, but you can also check this website with some detailed instructions and examples on how to build a nested relational data model (NRDM).
    http://www.consulting-accounting.com/time/servlet/ShowPage?COMPANYID=43&ELEMENTID=161
    (Thanks to Werner Daehn for putting this together).

  • How to load a XML-Schema (XSD) from Classpath

    Hi
    I want to perform XML Schema Validation using a XML-Schema stored in a File "MySchema.xsd" in the classpath.
    Unfortunately I have no clue, how I can load this file without using an absolute path. I already tried:
    Thread.currentThead().getContextClassLoader().getRessourceAsStream()but this method rejects to load Files with the extension XSD.It does however load the file, if I rename it to MySchema.xml or MySchema.properties, but then I cannot use the Visual Editors of JDeveloper to edit the File.
    Has anyone an idea, how I can load a XSD-File stored in the classpath?
    Thanks in advance
    Frank Brandstetter

    My Problem is, that I cannot load the Schema-File during runtime. I try to use code like this:
      String Schema = "sam/model/dataaccess/message/NavMessageXSD.xml";  // <== works with .xml, fails with .xsd
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      InputStream is = loader.getResourceAsStream(Schema);
      if (is==null)
        throw new Exception("Ressource not found");   // <== Exception thrown with .xsd
      XSDBuilder builder = new XSDBuilder();
      schemadoc = builder.build(new InputSource(is));
      DOMParser parser = new DOMParser();
      parser.setValidationMode(XMLParser.SCHEMA_VALIDATION);
      parser.setXMLSchema(schemadoc);This code works if "Schema" points to a file with extension .xml ("NavMessageXSD.xml"). It fails if "Schema" points to a file with extension .xsd ("NavMessageXSD.xsd").
    This file is already part of my project. If it is named "NavMessageXSD.xsd" I can edit it using the visual editor. If it is named "NavMessageXSD.xml" it is just an ordenary XML-File.
    Thanks for your help
    Frank Brandstetter

  • How to print a xml schema diagram in JDev 10g

    Hi,
    When I print an XML schema file (.xsd), it is printing the script, where as I want to print it as an image.
    For other class diagrams, I notice that we can publish them as JPEG or PNG and print it from Windows. But I could not find the same for an XML schema diagram?
    Can you help?
    Thanks, Raju

    Well, the Schema Editor a Visual Editor, it does not intend to produce images to be printed... You can collapse and expand all nodes, how would you expect the printer to behave in such a situation?!
    If you wish to print a diagram, you have to capture it for yourself with the appropriate tool - that will change depending on the OS you're working on, and include it in your document.
    That is the way it works for now.
    - Olivier

  • How Does FrameMaker Support XML Schemas?

    Hi All,
    I'm wondering how FM supports XML Schemas. I need to validate the uniqnuess of the value of an element in my XML. Let's say I have an XML like this one:
    <Param>
         <name>Parameter 1 name</name>
         <description>Parameter 1 description</description>
         <code>12345</code>
    </Param>
    <Param>
         <name>Parameter 2 name</name>
         <description>Parameter 2 description</description>
         <code>6789</code>
    </Param>
    The value of <code> must be unique throughout the XML file. As far as I know, I can add a validation of the uniqnuess of <code> into my XML schema. The question is whether this uniqnuess check will be supported by FM.
    Any advice is appreciated.
    Thank you very much!

    It should (though I have not tested it myself). Framemaker 11 uses XercesC 2.7 for parsing the incoming/outgoing XML and it supports unique constrains. EDD cannot check the possible violation, however.
    BR, Martti

  • How to update record xml data?

    Hi,
    How can update existing record using an existing xml packet?
    Thanks.

    Hi,
    The above Exception seems to be because of mapping error.
    Check your mapping for all the mandatory 1-1 mapping, also the 1-unbounded parent node mapping.
    Once when you import the XSD and activate your External Definition if it does without any error then there is no problem with your External Definition.
    If this error occurs only when you test your mapping then this is mapping error and not because of XSD.
    Please check the parent node mapping like 1-unbounded.
    Reward Points if useful
    Regards
    Ashmi.

  • How to Update and XML file

    Hi,
    I'm reading an XML file using SAX api, now based on some calculations, i want to add a new Element inside the same XML file.
    <?xml version="1.0" encoding="UTF-8"?>
    <types>
    <type super = "City">
    <t>Faro</t>
    <t>Porto</t>
    <t>Helsinki</t>
    </type> 
    </types>Now in the above XML snippet, i want to add an new sub element <t> Islamabad </t>, inside types.
    Following is the point in the code where i'm stuck:
    for (int typeID = 0; typeID < typeList.size(); typeID++) {
                        Element type = (Element) typeList.get(typeID);
                        String superTypeStr = type.getAttributeValue("super").toString();
                        if (superTypeStr.equalsIgnoreCase(comboValue)) {
                             Element t = new Element("t");
                             t.addContent(typeValue);
                             //NOW HOW TO ADD THIS <t>, inside a matched type element (in this case "city"), and write it into the xml file
                             break;
    typeList is a List object, which i get using : typeList = types.getChildren("type");Hope i have explained the problem clearly, writing an XML fime from scratch is easy. but in my case i want to update an existing xml file with a new element entry.
    The XML file should need to be updated like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <types>
    <type super = "City">
    <t>Faro</t>
    <t>Porto</t>
    <t>Helsinki</t>
    <t>Islamabad</t>
    </type> 
    </types>--
    Regards Suleman

    hey mate, i remember when i had a similar issue before. I ended up using parsing the document using DOM instead of SAX. The reason being that i wanted to update the XML file and if i parsed the document using DOM i had a handle on the document object so i could subsequently update it. But the drawback is that the entire xml structure is parsed into memory, as opposed to SAX which im sure you know is event driven and memory friendly. I would use SAX for the simple process of parsing the xml file to either examine, or print out the content or both.Perhaps consider DOM?

  • 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

  • How to import multiple XML schemas in Toplink.

    Hi All,
    I try to import multiple Schema(defined by EPCGlobal) in toplink This schema imports few other schemas and all are available in the same location.
    For this I tried to create a project by selecting XML radio button, and specified an XSD. The classes are getting generated for this file. After this, I try to import all other schema's using the Import schema option. I'm able to import it. but, I'm not able to generate classes for the schemas imported recently. Can you please let me know whether this is the expected behaviour..?
    Alternatively, I try to import a Schema(defined by EPCGlobal) in toplink through a TopLink-Jaxb Project. But I get the following exception..
    oracle.xml.parser.schema.XSDException
    at oracle.xml.parser.schema.XSDBuilder.buildSchema(XSDBuilder.java:754)
    at oracle.xml.parser.schema.XSDBuilder.build(XSDBuilder.java:407)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at oracle.toplink.workbench.utility.ClassTools.invokeMethodWithException(ClassTools.java:572
    at oracle.toplink.workbench.utility.ClassTools.attemptToInvokeMethodWithException(ClassTools
    .java:198)
    at oracle.toplink.workbench.utility.ClassTools.invokeMethodWithException(ClassTools.java:541
    at oracle.toplink.workbench.utility.ClassTools.invokeMethodWithException(ClassTools.java:526
    at oracle.toplink.workbench.mappingsmodel.schema.MWXmlSchema.reload(MWXmlSchema.java:481)
    at oracle.toplink.workbench.mappingsmodel.schema.MWXmlSchemaRepository.addSchema(MWXmlSchema
    Repository.java:107)
    at oracle.toplink.workbench.mappingsmodel.schema.MWXmlSchemaRepository.createSchemaFromFile(
    MWXmlSchemaRepository.java:89)
    at oracle.toplink.ox.jaxb.compiler.tljaxb.generate(tljaxb.java:70)
    at oracle.toplink.ox.jaxb.compiler.tljaxb.main(tljaxb.java:44)
    I tried to use the "tljaxb.cmd" but there too the same problem occurs.Where the problem could be..? please let me know.
    As I'm struck with this problem, please throw some light in this regard.
    Thanks
    Rajasekaran

    Rajasekaran,
    I have examined your XML schemas and do not believe that the problem is due to the import. Instead it is because the XML schema being imported is itself invalid. I have emailed you the specific correction to your XML schema. It was an error related to the namespace qualification of the type in one of your element declarations.
    -Blaise

  • How to Build a XML Schema myself ?

    I have a large xml document to be parsed
    DTD just can tell me whether the file is well-construct .
    I want to build a xml schema...but I have no resourse about this .
    can sb tell me the way ? better give me a sample .
    null

    I'd recommend getting started with a tool like XML Spy 3.5 from Altova (www.altova.com) or XML Authority from Extensibility (www.extensibility.com). I've used both and both are very capable.

Maybe you are looking for