The thing is that our schema will be generated when I connect to the oracle.
I believe the class has to be generated at the development time, right?
Shinya
> The thing is that our schema will be generated when I connect to the oracle.
> I believe the class has to be generated at the development time, right?
>
> Shinya
Only way I know how to map xml to java objects is to know ahead of time
the schema or at least have an instance of the xml document in order to
create a schema. While you may not have the schema you should at least
know the structure of the xml you are going to parse. From an example
you can generate a schema and from that schema you can generate the
required java objects. You do this at development time so that in your
program XMLBeans (or Castor or JAXB) has some objects to marshal the
xml data into.
John
sk - 02 Jun 2006 08:33 GMT
Our xml saved in the Oracle's xml type field is going to be like the
following:
the structure will be saved at the different table.
<meta12345>
<meta789456>Scientific XML Data</meta789456>
<meta789457>
<meta789458>Scientific XML Data<meta789458>
<meta789458>Scientific XML Data<meta789458>
<meta789457/>
<meta789459>Scientific XML Data<meta789459>
</meta12345>
The schema (xsd ) generated when connecting the database for the firstime
will be like this
<xs:element name="meta123456">
<xs:complextype>
<xs:sequence>
<xs:element name="meta789457" />
<xs:complextype>
<xs:element ref="meta789458" minOccurs="1"
minOccurs="5">
</xs:complextype>
<xs:restriction base="xs:string"/>
</xs:element>
<xs:element ref="meta789459" />
</xs:sequence>
</xs:complextype>
</xs:element>
<xs:element name="meta789458">
<xs:simpletype>
<xs:restriction base="xs:integer" >
</xs:simpletype>
</xs:element>