Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error Message ORA-31043: Element 'person' not globally defined in schema

Hari_639Jul 4 2011 — edited Jul 5 2011
Hello All,

We have registered 2 xsd documents as follows..
DECLARE
   lc_test_xsd   CLOB;
BEGIN

   lc_test_xsd   := '<?xml version="1.0" encoding="UTF-8"?>

<schema 
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:tns="http://www.xyz.com/cicat/types/basictypes/2/0" 
    targetNamespace="http://www.xyz.com/cicat/types/basictypes/2/0" 
    version="2.0">
    
    <simpleType name="LastNamePrefix">
        <annotation>
            <documentation>
                Additional word to last name (name prefix) corresponding to SAP HR Core 
                Table T535N; V.
            </documentation>
        </annotation>
        <restriction base="tns:String255" />
    </simpleType>
    <simpleType name="CountryID">
        <annotation>
            <documentation>
                Codes for the representation of country names according to ISO 3166.
            </documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="2" />
        </restriction>
    </simpleType>
    <simpleType name="LocationCode">
        <annotation>
            <documentation>
                Code of a location, e.g. Fe, Wa2 or Kor.
            </documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="4" />
        </restriction>
    </simpleType>
    <simpleType name="GenderCode">
        <annotation>
            <documentation>
                Code of the gender: male, female, unknown. Unknown is used if the value is 
                unknown or must not be stored due to legal restrictions.
            </documentation>
        </annotation>
        <restriction base="string">
            <enumeration value="male" />
            <enumeration value="female" />
            <enumeration value="unknown" />
        </restriction>
    </simpleType>
    <simpleType name="String255">
        <annotation>
            <documentation>
                String with 255 characters max
            </documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="255" />
            <minLength value="1" />
        </restriction>
    </simpleType>
    <simpleType name="RB-CostCenter">
        <annotation>
            <documentation>
                Cost Center
            </documentation>
        </annotation>
        <restriction base="string">
            <minLength value="3" />
            <maxLength value="6" />
        </restriction>
    </simpleType>
    <simpleType name="OrgUnitName">
        <annotation>
            <documentation>
                Name of the Organizational Unit
            </documentation>
        </annotation>
        <restriction base="string">
            <minLength value="1" />
            <maxLength value="18" />
        </restriction>
    </simpleType>
    <complexType name="StringMCA">
        <annotation>
            <documentation>
                Multi Country String. Strings, which must be stored in ASCII code and 
                country specific. The subelement ASCIIString contains the string encoded
                with ASCII. The subelement countrySpecificString allows country specific
                encoding.
            </documentation>
        </annotation>
        <sequence>
            <element name="asciiString" type="tns:String255" minOccurs="0" />
            <element name="countrySpecificString" type="tns:String255" />
        </sequence>
    </complexType>
    <simpleType name="OrgUnitID">
        <annotation>
            <documentation>
                ID of the Organizational Unit
            </documentation>
        </annotation>
        <restriction base="unsignedInt">
            <totalDigits value="8" />
        </restriction>
    </simpleType>
    <simpleType name="GlobalID">
        <annotation>
            <documentation>
                Global unique identifier of persons at xyz
            </documentation>
        </annotation>
        <restriction base="unsignedInt">
            <totalDigits value="8" />
        </restriction>
    </simpleType>
    <simpleType name="CiCatPersonID">
        <annotation>
            <documentation>
                CI-CAT Identifier of Persons (CiCat-PID). Unique identifier of a person
                in CI-CAT
            </documentation>
        </annotation>
        <restriction base="unsignedInt">
            <totalDigits value="20" />
        </restriction>
    </simpleType>
    <simpleType name="CiCatAccountID">
        <annotation>
            <documentation>
                CI-CAT Identifier of AD Accounts (CiCat-Ben-Sid). Unique identifier of 
                AD Accounts in CI-CAT.
            </documentation>
        </annotation>
        <restriction base="unsignedInt">
            <totalDigits value="20" />
        </restriction>
    </simpleType>
    <simpleType name="PersonnelActionTypeCode">
        <annotation>
            <documentation>
                The operation that was performed on the person: entry, data change,
                re-entry (into company), exit (out of company)
            </documentation>
        </annotation>
        <restriction base="string">
            <enumeration value="entry" />
            <enumeration value="data change" />
            <enumeration value="re-entry" />
            <enumeration value="exit" />
        </restriction>
    </simpleType>
    <simpleType name="ContractStatus">
        <annotation>
            <documentation>
                Contract Status: active, inaktive, resigned, retired
            </documentation>
        </annotation>
        <restriction base="string">
            <enumeration value="retired">
                <annotation>
                    <documentation>
                        End of contract relationship because of retirement
                    </documentation>
                </annotation>
            </enumeration>
            <enumeration value="resigned">
                <annotation>
                    <documentation>
                        End of contract because of quitting
                    </documentation>
                </annotation>
            </enumeration>
            <enumeration value="inactive">
                <annotation>
                    <documentation>
                        Incactive contract relationship, e.g. motherhood, suspension
                    </documentation>
                </annotation>
            </enumeration>
            <enumeration value="active">
                <annotation>
                    <documentation>
                        Normal contract status
                    </documentation>
                </annotation>
            </enumeration>
            <enumeration value="deleted">
                <annotation>
                    <documentation>
                        Contract physically deleted in the source system
                    </documentation>
                </annotation>
            </enumeration>
        </restriction>
    </simpleType>
    <simpleType name="KnownAssociateCode">
        <annotation>
            <documentation>
                Describes status of person to xyz: internal/external/fixed-term
            </documentation>
        </annotation>
        <restriction base="string">
            <enumeration value="External" />
            <enumeration value="Internal" />
            <enumeration value="Fixed Term" />
            <enumeration value="unknown" />
        </restriction>
    </simpleType>
    <simpleType name="AssociateCode">
        <annotation>
            <documentation>
                Describes status of person to xyz: union of known values plus free string 
                for not yet known types
            </documentation>
        </annotation>
        <union memberTypes="tns:KnownAssociateCode string" />
    </simpleType>
    <simpleType name="KnownExternalRelationType">
        <annotation>
            <documentation>
                Describes relation (contract relation) of external person to xyz:
                contractor/customer/supplier/subsidiary/selfregistered
            </documentation>
        </annotation>
        <restriction base="string">
            <enumeration value="Contractor" />
            <enumeration value="Customer" />
            <enumeration value="Supplier" />
            <enumeration value="Subsidiary" />
            <enumeration value="Selfregistered" />
            <enumeration value="unknown" />
        </restriction>
    </simpleType>
    <simpleType name="ExternalRelationType">
        <union memberTypes="tns:KnownExternalRelationType string" />
    </simpleType>
    <simpleType name="ValidityState">
        <annotation>
            <documentation>
                If an attribute was taken over by an authoritative source such as HR-MDS or 
                WOM. Set to "Valid" to indicate that the value was taken over from the 
                source and is therefore valid. Set to "Invalid" if the source indicates the
                value is no longer value, e.g. because it got deleted. Otherwise set to 
                "Unknown", e.g. when the value was entered manually.
            </documentation>
        </annotation>
        <restriction base="string">
            <enumeration value="Valid" />
            <enumeration value="Invalid" />
            <enumeration value="Unknown" />
        </restriction>
    </simpleType>
    <complexType name="HrPersonnelId">
        <sequence>
            <element name="hrSourceSystem">
                <annotation>
                    <documentation>
                        Name of HR source system
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <minLength value="1" />
                        <maxLength value="20" />
                    </restriction>
                </simpleType>
            </element>
            <element name="hrPersonnelId">
                <annotation>
                    <documentation>
                        ID of person in HR source system
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <minLength value="1" />
                        <maxLength value="20" />
                    </restriction>
                </simpleType>
            </element>
        </sequence>
    </complexType>
    <complexType name="AccountType">
        <annotation>
            <documentation>
                Types of Accounts: Three main categories are known: Person, resource or 
                service account. A person account represents a single natural person. A 
                resource account represents a resource such as a printer, a computer or a 
                meeting room. Service Accounts represent everything else. The can be used 
                for example for technical users or group accounts. Both resource and service 
                accounts have an owner that is responsible for them. Each account type has 
                subtypes for further categorization.
            </documentation>
        </annotation>
        <choice>
            <element name="personAccount" type="tns:PersonAccountType" />
            <element name="resourceAccount" type="tns:ResourceAccountType" />
            <element name="serviceAccount" type="tns:ServiceAccountType" />
        </choice>
    </complexType>
    <simpleType name="KnownPersonAccountType">
        <annotation>
            <documentation>
                Pre-defined types of Person Accounts
            </documentation>
        </annotation>
        <restriction base="string">
            <enumeration value="Office" />
            <enumeration value="Admin" />
            <enumeration value="Test" />
            <enumeration value="unknown" />
        </restriction>
    </simpleType>
    <simpleType name="PersonAccountType">
        <union memberTypes="tns:KnownPersonAccountType string" />
    </simpleType>
    <simpleType name="KnownResourceAccountType">
        <annotation>
            <documentation>
                Pre-defined types of Resource Accounts
            </documentation>
        </annotation>
        <restriction base="string">
            <enumeration value="Room" />
            <enumeration value="PC" />
            <enumeration value="Printer" />
            <enumeration value="unknown" />
        </restriction>
    </simpleType>
    <simpleType name="ResourceAccountType">
        <union memberTypes="tns:KnownResourceAccountType string" />
    </simpleType>
    <simpleType name="KnownServiceAccountType">
        <annotation>
            <documentation>
                Pre-defined Types of Service Accounts
            </documentation>
        </annotation>
        <restriction base="string">
            <enumeration value="Group" />
            <enumeration value="Machine" />
            <enumeration value="Support" />
            <enumeration value="System" />
            <enumeration value="unknown" />
        </restriction>
    </simpleType>
    <simpleType name="ServiceAccountType">
        <union memberTypes="tns:KnownServiceAccountType string" />
    </simpleType>
    <simpleType name="ActionType">
        <annotation>
            <documentation>
                Defines the action that was performed on the object.
            </documentation>
        </annotation>
        <restriction base="string">
            <enumeration value="Create" />
            <enumeration value="Update" />
            <enumeration value="Delete" />
        </restriction>
    </simpleType>
    <simpleType name="LegalEntityId">
        <annotation>
            <documentation>
                ID of a legal entity
            </documentation>
        </annotation>
        <restriction base="unsignedInt">
            <totalDigits value="8" />
        </restriction>
    </simpleType>
</schema>
';

   DBMS_XMLSCHEMA.REGISTERSCHEMA (schemaurl   => 'BasicTypes.xsd',
                                  schemadoc   => lc_test_xsd);
                                  
  DBMS_OUTPUT.PUT_LINE('BasicTypes.xsd registration successfully completed');
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('BasicTypes.xsd registration failed '||SQLERRM);
END;
/
This post has been answered by User_SAFN8 on Jul 4 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 2 2011
Added on Jul 4 2011
4 comments
1,776 views