call to createxml with a schema url does not create schema based xml

From: <justin.c.mays_at_gmail.com>
Date: 1 Jul 2005 08:51:41 -0700
Message-ID: <1120233101.653273.253590_at_g14g2000cwa.googlegroups.com>



Unfortunately I am unable to post the exact creates that I have done, but I am having a problem and none of my DBA's were able to help me.

Basically what I have done is, I had existing tables in our database that have legacy data in them. Our ultimate goal is to export information in xml format from the database.

The first thing I did was to create objects in oracle that wrapped the logic of these tables and filled the objects in based on on ID parameter. There are 3 separate levels of objects. One object that has tables of two other objects each of which has tables of objects themselves.

After the objects were created, I used a call to dbms_xmlschema.generateschema to generate the schema for these objects.  After that I changed the schema so that the names of the elements in the schema were names that i wanted to be. I THOUGHT that this would map my oracle object names to new element names.

After the schema was generated and changed, I used a call to dbms_xmlschema.registerSchema with the following options:

local=>true, genTypes=>false, force=>false, GENTABLES=>false, genbean=>false

I tried it with gentables = true, but unfortunately i don't have access to create these tables and the dba's were not allowing me to because they aren't familiar with the xml capabilities and I couldn't explain why it was necessary. I'm not sure that it is.

Once the schema was registered, i made a call to xmltype.createxml with a call to my object contstructor method as the first parameter, and the schema url that was registered in the database as the second parameter.

Now, here is my problem. The xmltype result that comes back from the query to createxml does not return the element tag names that i had written in the schema. The tag names are the same as the object names which are the same as it is if i didn't use the schema url at all. Does anyone know what I could possibly be doing wrong? Maybe I am misunderstanding the functionality of creating xml with an oracle xml annotated schema. Please help! Received on Fri Jul 01 2005 - 17:51:41 CEST

Original text of this message