I am creating an application that takes data and generates a
schema-based XML document. I am trying to figure out how to automate
that process for creating XML on the fly. I know that I can do this
using Java's JAXB. I want to know if I can do it using Oracle's XML
functionality.
Basically, I want to use Oracle functionality to automatically
generate a table or tables based on my schema so that, when receiving
the non-XML data, I have a place to insert it (on a field by field
basis) for the purpose of retrieving it and, again using Oracle XML
functionality, automatically generating an XML document conforming to my
schema. By "automatically" I mean something like a simple select
statement that does not require me to write any actual XML tags. I
should not have to know anything about the XML itself.
I need to know if this is possible and would like to see a
clear example of how to do it, or I need to know definitively that it
is not possible with Oracle. |
Clarification of Question by
kellybluesky-ga
on
29 Mar 2004 14:15 PST
I should specify Oracle 9.2. Thanks.
|
Request for Question Clarification by
mathtalk-ga
on
29 Mar 2004 17:43 PST
Hi, kellybluesky-ga:
Perhaps your Question has two sides. First, can you receive "non-XML
data" and insert it into some Oracle tables? Second, can you then
extract that data out into an "automatically generated" XML document?
I mention these two aspects because although your subject line and
other remarks focus on XML document generation without knowing
"anything about the XML itself," the usefulness of such an exercise is
apt to depend largely on the underlying data "schema" which you
mention briefly.
If you can provide additional details about what you're trying to do,
it would greatly increase the chances of finding some ideas that will
work for you.
On the other hand, perhaps you simply want some links that describe
what facilities there are in Oracle 9.2 to create XML extracts... I'm
not trying to make your Question more complicated than it needs to be!
regards, mathtalk-ga
|
Clarification of Question by
kellybluesky-ga
on
30 Mar 2004 06:54 PST
When I say "schema" I'm not referring to a schema in the Oracle
database sense, but rather an XML schema. This is essentially a
specification of an XML document, which defines it's elements,
attributes, hierarchy, etc. I have some reason to believe (from my
research so far on Oracle's rather confusing XML documentation) that
Oracle has some facility to take an XML schema as input and generate a
table or tables that corresponds to that schema so that there is a
place to store data that is received in an XML document that conforms
to that XML schema.
I imagine it works like this (and this is what I need confirmation on
and greater detail/examples of):
Developer has an XML schema (.xsd file)
XML schema is used as input to some unknown Oracle facility which
generates a set of tables which correspond to the XML schema in both
field mapping and hierarchical structure.
Once the tables exist an application can be created which receives
non-XML data and inserts it into these tables.
The application can then call some unknown Oracle facility (probably
some supplied packages, i.e. DBMS_XXXX) which extracts the data from
these tables and creates an XML document from it which conforms to the
XML schema.
So, in answer to one of your questions, no, I'm not really asking if
non-XML data can be inserted into Oracle tables, because I know that
of course it can. But I'm looking for automatic creation of those
tables based on the XML schema and automatic XML document creation
based on those tables, the data, and the XML schema. The fact that I
have the XML schema is what should allow me to otherwise not have to
know anything about the XML (because the schema itself contains all
the necessary information that Oracle can use, in theory, to do what
I'm expecting). I hope this clarifies the question sufficiently.
Please let me know if you need anything further.
|