XML Schema with self-referencing complexType
333305Aug 6 2004 — edited Aug 6 2004Hi
I am working with a simple example schema (pastedbelow) that has a self-referencing complexType. The schema has been succesfully registered, and the types and tables autmoatically created as expected: PERSON_TABLE to store person documents and DESCENDANT_TABLE to store the 'nested' person fragments for the descendant element.
I can insert an xml document conforming to the schema (using the webdav interface), and this is correctly shredded. The example document (pastedbelow) has a single descendant, so as expected, a single row is created in PERSON_TABLE along with a corresponding row in DESCENDANT_TABLE. If the document is deleted, both rows are removed.
However, if the document is updated (by overwriting the file using webdav) an additional duplicate row is created in the DESCENDANT_TABLE. In fact, each time the document is updated, an additional row is created and left in DESCENDANT_TABLE. If the person.xml document is then deleted, the row is removed from PERSON_TABLE and one row is removed from DESCENDANT_TABLE, leaving one or more orphaned rows in this table.
Has anybody else experienced this problem? Is there a known workaround?
Environment is 9.2.0.5 running on W2k.
Any help would be appreciated,
Panikos
Schema
======
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="person" type="personType" xdb:defaultTable="PERSON_TABLE"/>
<xs:complexType name="personType" xdb:SQLType="PERSON_T">
<xs:sequence>
<xs:element name="decendant" type="personType" minOccurs="0"
maxOccurs="unbounded" xdb:SQLName="DESCENDANT"
xdb:defaultTable="DESCENDANT_TABLE"/>
</xs:sequence>
<xs:attribute name="personName" use="required" xdb:SQLName="PERSON_NAME">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="20"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:schema>
Document
========
<?xml version="1.0" encoding="WINDOWS-1252"?>
<person
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="example/person.xsd"
personName="Father">
<decendant personName="Son"/>
</person>