3 Replies Latest reply: Dec 4, 2012 5:01 PM by 275191 RSS

    Optional Validation of some complex type elements

    275191
      Hello,

      There is XMLType table with structural storage. Is there a way to make schema validation disabled on some elements of complex type?

      It is unpractical to maintain a schema for the element due to high volatility. Ideally it will be stored in CLOB and extracted as is a whole branch without validation, none of the elements under this complex type will be extracted separately.

      Any ideas?
        • 1. Re: Optional Validation of some complex type elements
          odie_63
          Hi,

          See these paragraphs in the documentation :

          Mapping XML Fragments to Large Objects : http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb06stt.htm#autoId9

          Mapping complexType: any and anyAttribute : http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb06stt.htm#autoId13

          The first one explains how to use annotations to define the storage of a fragment.

          But, as far as I know, you can't disable validation for specific elements.
          You'll have to use the <xsd:any> element with processContents="skip" (second link) instead.
          • 2. Re: Optional Validation of some complex type elements
            Marco Gralike
            Completely not but registering specific parts with xdb:maintainDOM with value false might help

            http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb05sto.htm#g1048403
            http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb05sto.htm#CHDCHIHD

            Good example of "How does XML DB handle XML Schema Validation ? " can be found in the XMLDB FAQ Thread on the mainpage of this forum (here is a direct link: How does XML DB handle XML Schema Validation ?
            • 3. Re: Optional Validation of some complex type elements
              275191
              Odie, Marco, thank you very much for the advice, it can be done with an element:

                   <xsd:element name="CLOBElement" xdb:SQLType="CLOB">
                        <xsd:complexType>
                             <xsd:sequence>
                                  <xsd:any processContents="skip" minOccurs="0"/>
                             </xsd:sequence>
                        </xsd:complexType>
                   </xsd:element>

              Edited by: victor_shostak on Dec 4, 2012 5:59 PM