XML Import via XML Schema -
08-17-2010
, 05:57 AM
Hi,
in my company we are providing web services for information extraction
returning XML files validated by a given XML Schema.
One of our customers requires to import the resulting XML files directly
into his Oracle database (10g 10.2.0.4.0) and runs into problems which
sound uncommon to me.
Parts of the XML Schema definition are 1:n occurences in complex types
together with 0:1 occurences. An example:
<xs:complexType name="projects">
<xs:sequence>
<xs:element name="phase" type="workPhase" maxOccurs="unbounded"
minOccurs="0"></xs:element>
<xs:element name="additionalText" type="xs:string" maxOccurs="1"
minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>
This results in XML files having zero or more elements with the name
"phase" and zero or one element with the name "additionalText" in it.
..e.g.:
<projects>
<phase>
....
</phase>
<phase>
....
</phase>
<additionalText>Blabla</additionalText>
</projects>
The problem now is that the customer says that he is unable to import
all XML elements into the database because all elements (in that case:
all "phase" elements) except the first one are ignored.
The reason seems to be that the XML schema is "bad style" because 0..n
and 0..1 occurences are mixed up within one sequence/complexType. I've
never heard of this and can't imagine that Oracle is unable to parse
that (very usual to me) XML schema structure, but I may be wrong.
As I have hardly any experience with the tools and filters Oracle
databases provide I hope to find some help here.
Thanks a lot
Bastian |