Flex Diff Algorithm

A guy named Paul Butler made a diff algorithm for PHP.  It compares two strings, and shows you the differences between the strings.  The original PHP code is here:
http://github.com/paulgb/simplediff/blob/5bfe1d2a8f967c7901ace50f04ac2d9308ed3169/simpledi ff.php
I have translated it into Flex, and given it an Air wrapper  (the two primary functions, diff and HTMLdiff should work fine in any flex app, but the wrapper requires AIR since it uses an HTML container).  Just putting this out there, as it is kind of cool and may be useful to some folks.  The code is pretty ugly, so if anyone wants to clean it up, please do so and repost (the comments were meant to help me translate from PHP to actionscript):
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" height="300" width="400" viewSourceURL="srcview/index.html">
    <mx:Label x="10" y="10" text="Old:"/>
    <mx:TextArea x="10" y="36" width="194" height="110" id="oldbox" text="This is the original text before any changes have been made."/>
    <mx:Label x="212" y="10" text="New:"/>
    <mx:TextArea x="212" y="36" width="176" height="110" id="newbox" text="This is the new text after all the changes were made."/>
    <mx:HTML right="10" left="10" top="180" bottom="10" id="result"/>
    <mx:Button x="347" y="8" label="Go" click="go()"/>
    <mx:Script>
        <![CDATA[
            public function diff($old:Array, $new:Array):Array{
                var $matrix:Array = new Array();
                var $maxlen:uint;
                var $omax:uint;
                var $nmax:uint;
                var $return:Array = new Array();
                var $subreturn:Array = new Array();
                //The next two lines imitate foreach($old as $oindex => $ovalue){
                for (var $oindexstring:String in $old){
                    var $oindex:uint = uint($oindexstring);
                    var $ovalue:String = $old[$oindex];
                //The next lines imitate $nkeys = array_keys($new, $ovalue);   
                    var $nkeys:Array = new Array();
                    for (var $nkey:String in $new){
                        if ($new[$nkey] == $ovalue){
                            $nkeys.push($nkey);
                //The next line imitates foreach($nkeys as $nindex){
                    for each (var $nindex:uint in $nkeys){
                        //The next line imitates $matrix[$oindex][$nindex] = isset($matrix[$oindex - 1][$nindex -1]) ? $matrix[$oindex - 1][$nindex - 1] + 1 : 1;
                        if ($matrix.hasOwnProperty(String($oindex-1))){
                            if ($matrix[$oindex-1].hasOwnProperty(String($nindex-1))){
                                if ($matrix.hasOwnProperty(String($oindex))){
                                    $matrix[$oindex][$nindex] = $matrix[$oindex - 1][$nindex - 1] + 1;
                                } else {
                                    $matrix[$oindex] = new Array();
                                    $matrix[$oindex][$nindex] = $matrix[$oindex - 1][$nindex - 1] + 1;
                            } else {
                                if ($matrix.hasOwnProperty(String($oindex))){
                                    $matrix[$oindex][$nindex] = 1;
                                } else {
                                    $matrix[$oindex] = new Array();
                                    $matrix[$oindex][$nindex] = 1;
                        } else {
                            if ($matrix.hasOwnProperty(String($oindex))){
                                $matrix[$oindex][$nindex] = 1;
                            } else {
                                $matrix[$oindex] = new Array();
                                $matrix[$oindex][$nindex] = 1;
                        if ($matrix[$oindex][$nindex] > $maxlen){
                            $maxlen = $matrix[$oindex][$nindex];
                            $omax = $oindex + 1 - $maxlen;
                            $nmax = $nindex + 1 - $maxlen;
                if($maxlen == 0){
                    $subreturn["d"] = $old;
                    $subreturn["i"] = $new;
                    $return.push($subreturn);
                    return $return;
                } else {
                    //Next line is diff(array_slice($old, 0, $omax), array_slice($new, 0, $nmax));
                    $subreturn = diff($old.slice(0, $omax), $new.slice(0, $nmax));
                    $return = $return.concat($subreturn);
                    //Next line imitates array_slice($new, $nmax, $maxlen)
                    $subreturn = $new.slice($nmax, $nmax + $maxlen);
                    $return = $return.concat($subreturn);
                    //Next line is diff(array_slice($old, $omax + $maxlen), array_slice($new, $nmax + $maxlen))
                    $subreturn = diff($old.slice($omax + $maxlen), $new.slice($nmax + $maxlen));
                    $return = $return.concat($subreturn);
                    return $return;
            public function go():void{
                result.htmlText = htmlDiff(oldbox.text, newbox.text);
            public function htmlDiff($old:String, $new:String):String{
                var $ret:String = "";
                var $diff:Array = diff($old.split(" "), $new.split(" "));
                for each(var $k:Object in $diff){
                    if($k.constructor == Array){
                        //$ret += (!empty($k['d'])?"<del>".implode(' ',$k['d'])."</del> ":'').
                        if ($k['d'] == undefined || $k['d'].length == 0){
                            $ret += "";
                        } else {
                            $ret += "<del style=\"color: red ; text-decoration: line-through\" >"+$k["d"].join(" ")+"</del> ";
                        //(!empty($k['i'])?"<ins>".implode(' ',$k['i'])."</ins> ":'');
                        if ($k['i'] == undefined || $k['i'].length == 0){
                            $ret += "";
                        } else {
                            $ret += "<ins style=\"color: blue ; text-decoration: underline\" >"+$k["i"].join(" ")+"</ins> "
                    } else {
                        $ret += $k + ' ';
                return "<html><body>"+$ret+"</body></html>";
        ]]>
    </mx:Script>
    <mx:Label x="10" y="154" text="Diff Result:"/>
</mx:WindowedApplication>

Spend a good time with all the Java building blocks, especially OOP, data structures, collections etc. Ask more specific questions if you encounter problem.
Also have a look at open source java diff library such as: http://code.google.com/p/java-diff-utils, go through their source code, see if you can find something useful

Similar Messages

  • Flex time options?

    Hi,
    In the user manual it mentions several options for each of the flex time algorithms (fill gaps, decay, complex etc). How do I access these? I can't find them anywhere. I would have thought they would be in the inspector for the region but they aren't..
    Thanks

    Finally found it, I was looking in the region tab of the inspector and the options are in the track tab. Don't know how I managed to miss it!

  • Errors when using inplace schema evolution

    Hi, i have been having some issues when attempting to use inplace schema evolution to add a new element into an existing xsd file currently registered on the database and was looking for some help with this if possible.
    Firstly, Oracle details are as follows :
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE     11.2.0.2.0     Production"
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - ProductionThe xsd registered on the database is called truncheadtest2.xsd :
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XMLSpy v2009 sp1 (http://www.altova.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
         <xs:element name="title">
              <xs:simpleType>
                   <xs:restriction base="xs:string"/>
              </xs:simpleType>
         </xs:element>
         <xs:element name="clientRiskEventHeader" xdb:defaultTable="EVLN_CLIENTRISKEVENTHEADER">
              <xs:complexType xdb:SQLType="EVLN_CLIENTRISKEVENTHEADER_T">
                   <xs:sequence>
                        <xs:element ref="title" xdb:SQLName="TITLE"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>registered via :
    BEGIN
      DBMS_XMLSCHEMA.registerSchema(
       SCHEMAURL => 'http://xmlns.kfis.co.uk/testevheader/xsdin/truncheadertest.xsd',
      SCHEMADOC => XDBURIType('/public/web_quotes/header/xsd/test/SchemaTest/truncheadtest2.xsd').getCLOB());
    END;i have then created a new xsd, to add the new element to the xsd (using minoccurs to allow backwards compatibility between xml files conforming to the 1st xsd and this new xsd), called truncheadtestfn3.xsd :
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XMLSpy v2009 sp1 (http://www.altova.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
         <xs:element name="title">
              <xs:simpleType>
                   <xs:restriction base="xs:string"/>
              </xs:simpleType>
         </xs:element>
         <xs:element name="forename">
              <xs:simpleType>
                   <xs:restriction base="xs:string"/>
              </xs:simpleType>
         </xs:element>
         <xs:element name="clientRiskEventHeader" xdb:defaultTable="EVLN_CLIENTRISKEVENTHEADER">
              <xs:complexType xdb:SQLType="EVLN_CLIENTRISKEVENTHEADER_T">
                   <xs:sequence>
                        <xs:element ref="title" xdb:SQLName="TITLE"/>
                        <xs:element ref="forename" minOccurs="0" xdb:SQLName="FORENAME"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>I can run the following code to create the difference doc between the 2 versions of the schema document, without errors:
    DECLARE
       schemaDiff XMLType;
       res boolean;
    BEGIN
       SELECT xmlDiff
            xdburitype('/public/web_quotes/header/xsd/test/SchemaTest/truncheadtest2.xsd').getXML(),
            xdburitype('/public/web_quotes/header/xsd/test/SchemaTest/truncheadtestfn3.xsd').getXML()
       INTO schemaDiff
       FROM dual;
       IF (dbms_xdb.existsResource('/public/web_quotes/header/xsd/test/SchemaTest/header.xml')) THEN
           dbms_xdb.deleteResource('/public/web_quotes/header/xsd/test/SchemaTest/header.xml');
       END IF;
       res :=
         dbms_xdb.createResource('/public/web_quotes/header/xsd/test/SchemaTest/header.xml',schemaDiff);
         dbms_xmlschema.inPlaceEvolve('http://xmlns.kfis.co.uk/testevheader/xsdin/truncheadertest.xsd',schemaDiff,2);
    END;
    / which creates the following xml file:
    - <xd:xdiff xsi:schemaLocation="http://xmlns.oracle.com/xdb/xdiff.xsd http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <?oracle-xmldiff operations-in-docorder="true" output-model="snapshot" diff-algorithm="global"?>
    - <xd:insert-node-before xd:node-type="element" xd:xpath="/xs:schema[1]/xs:element[2]">
    - <xd:content>
    - <xs:element name="forename">
    - <xs:simpleType>
      <xs:restriction base="xs:string" />
      </xs:simpleType>
      </xs:element>
      </xd:content>
      </xd:insert-node-before>
    - <xd:append-node xd:node-type="element" xd:parent-xpath="/xs:schema[1]/xs:element[2]/xs:complexType[1]/xs:sequence[1]">
    - <xd:content>
      <xs:element ref="forename" minOccurs="0" xdb:SQLName="FORENAME" />
      </xd:content>
      </xd:append-node>
      </xd:xdiff>However, when i then run the inplace schema evolution code for option 1, i get the following error:
    Error report:
    ORA-22324: altered type has compilation errors
    ORA-22328: object "WEB_STAGING"."EVLN_CLIENTRISKEVENTHEADER_T" has errors.
    PLS-00215: String length constraints must be in range (1 .. 32767)
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 173
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 231
    ORA-06512: at line 17
    22324. 00000 -  "altered type has compilation errors"
    *Cause:    The use of the ALTER TYPE statement caused a compilation error.
    *Action:   Correct the error reported and resubmit the statement.I am getting this issue when attempting to add any string value to the existing xsd and i was wondering if you had any idea what the issue was here and how i could resolve this.
    Thanks.

    Hi,
    When you use INPLACE_TRACE flag, it traces the operations that would be performed with option 1.
    If you look at the trace file produced in this case, you'll see where the error is coming from :
    ------------ QMTS Executing SQL ------------
    ALTER TYPE "TEST"."EVLN_CLIENTRISKEVENTHEADER_T" ADD ATTRIBUTE "FORENAME" VARCHAR2 CASCADE NOT INCLUDING TABLE DATA
    /The mandatory length specification is absent.
    I thought adding an explicit xs:maxLength restriction would solve the problem, but it happens the generated DDL still lacks the length specification.
    After some tries, I found that the issue seems related to the usage of ref elements in the schema.
    On a side note, it's not the first time we see problems associated with ref (Cf. how do i get xml db to work right with imported or included schemas?).
    The workaround is to use a named type.
    I've also added an xdb:defaultTable annotation to the top-level element ("title") so that the registration process doesn't generate a table for it :
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
         <xs:element name="title" xdb:defaultTable="">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                     <xs:maxLength value="200"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <xs:simpleType name="forenameType">
              <xs:restriction base="xs:string">
                   <xs:maxLength value="30"/>
              </xs:restriction>
         </xs:simpleType>
         <xs:element name="clientRiskEventHeader" xdb:defaultTable="EVLN_CLIENTRISKEVENTHEADER">
              <xs:complexType xdb:SQLType="EVLN_CLIENTRISKEVENTHEADER_T">
                   <xs:sequence>
                        <xs:element ref="title" xdb:SQLName="TITLE"/>
                        <xs:element name="forename" type="forenameType" minOccurs="0" xdb:SQLName="FORENAME"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>

  • The usefulness (?) of XMLDIFF in database change management

    I post my example here as well, because maybe it is useful to some, for instance, regarding the use of the syntax. The example is explained more deeply here (at least the reasons why I did what I did).: http://www.liberidu.com/blog/?p=394
    Some help is still appreciated from you ("you" as in you the "XMLTable and/or XQuery wizards") regarding the "LINE" problem at the end of the post/example given here.
    Have a look here (and enjoy the examples).
    M.
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    SQL> set long 10000000
    SQL> set pages 5000
    SQL> set lines 200
    SQL> create table A
      2  (id number(10));
    Table created.
    SQL>  create table B
      2  (id number(15));
    Table created.
    SQL> create table C
      2  (id number(10),
      3  extra varchar2(50));
    Table created.
    SQL> select dbms_metadata.get_ddl('TABLE','A') from dual;
    DBMS_METADATA.GET_DDL('TABLE','A')
      CREATE TABLE "SYSTEM"."A"
       (    "ID" NUMBER(10,0)
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "SYSTEM"
    SQL> select dbms_metadata.get_ddl('TABLE','B') from dual;
    DBMS_METADATA.GET_DDL('TABLE','B')
      CREATE TABLE "SYSTEM"."B"
       (    "ID" NUMBER(15,0)
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "SYSTEM"
    SQL> select dbms_metadata.get_ddl('TABLE','C') from dual;
    DBMS_METADATA.GET_DDL('TABLE','C')
      CREATE TABLE "SYSTEM"."C"
       (    "ID" NUMBER(10,0),
            "EXTRA" VARCHAR2(50)
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "SYSTEM"
      TABLESPACE "SYSTEM"
    SQL> SELECT dbms_metadata.compare_alter('TABLE','A','B',USER,USER) from dual;
    DBMS_METADATA.COMPARE_ALTER('TABLE','A','B',USER,USER)
    ALTER TABLE "SYSTEM"."A" MODIFY ("ID" NUMBER(15,0))
      ALTER TABLE "SYSTEM"."A" RENAME TO "B"
    SQL> SELECT dbms_metadata.compare_alter('TABLE','A','C',USER,USER) from dual;
    DBMS_METADATA.COMPARE_ALTER('TABLE','A','C',USER,USER)
    ALTER TABLE "SYSTEM"."A" ADD ("EXTRA" VARCHAR2(50))
      ALTER TABLE "SYSTEM"."A" RENAME TO "C"
    SQL> SELECT dbms_metadata.compare_alter('TABLE','B','C',USER,USER) from dual;
    DBMS_METADATA.COMPARE_ALTER('TABLE','B','C',USER,USER)
    ALTER TABLE "SYSTEM"."B" ADD ("EXTRA" VARCHAR2(50))
      ALTER TABLE "SYSTEM"."B" MODIFY ("ID" NUMBER(10,0))
      ALTER TABLE "SYSTEM"."B" RENAME TO "C"
    SQL> SELECT dbms_metadata.compare_alter_xml('TABLE','A','B',USER,USER) from dual;
    DBMS_METADATA.COMPARE_ALTER_XML('TABLE','A','B',USER,USER)
    <ALTER_XML xmlns="http://xmlns.oracle.com/ku" version="1.0">
       <OBJECT_TYPE>TABLE</OBJECT_TYPE>
       <OBJECT1>
          <SCHEMA>SYSTEM</SCHEMA>
          <NAME>A</NAME>
       </OBJECT1>
       <OBJECT2>
          <SCHEMA>SYSTEM</SCHEMA>
          <NAME>B</NAME>
       </OBJECT2>
       <ALTER_LIST>
          <ALTER_LIST_ITEM>
             <SQL_LIST>
                <SQL_LIST_ITEM>ALTER TABLE "SYSTEM"."A" MODIFY ("ID" NUMBER(15,0))</SQL_LIST_ITEM>
             </SQL_LIST>
          </ALTER_LIST_ITEM>
          <ALTER_LIST_ITEM>
             <SQL_LIST>
                <SQL_LIST_ITEM>ALTER TABLE "SYSTEM"."A" RENAME TO "B"</SQL_LIST_ITEM>
             </SQL_LIST>
          </ALTER_LIST_ITEM>
       </ALTER_LIST>
    </ALTER_XML>
    SQL> SELECT dbms_metadata.compare_sxml('TABLE','A','B',USER,USER) from dual;
    DBMS_METADATA.COMPARE_SXML('TABLE','A','B',USER,USER)
    <TABLE xmlns="http://xmlns.oracle.com/ku" version="1.0">
      <SCHEMA>SYSTEM</SCHEMA>
      <NAME value1="A">B</NAME>
      <RELATIONAL_TABLE>
        <COL_LIST>
          <COL_LIST_ITEM>
            <NAME>ID</NAME>
            <DATATYPE>NUMBER</DATATYPE>
            <PRECISION value1="10">15</PRECISION>
            <SCALE>0</SCALE>
          </COL_LIST_ITEM>
        </COL_LIST>
        <PHYSICAL_PROPERTIES>
          <HEAP_TABLE>
            <SEGMENT_ATTRIBUTES>
              <PCTFREE>10</PCTFREE>
              <PCTUSED>40</PCTUSED>
              <INITRANS>1</INITRANS>
              <STORAGE>
                <INITIAL>65536</INITIAL>
                <NEXT>1048576</NEXT>
                <MINEXTENTS>1</MINEXTENTS>
                <MAXEXTENTS>2147483645</MAXEXTENTS>
                <PCTINCREASE>0</PCTINCREASE>
                <FREELISTS>1</FREELISTS>
                <FREELIST_GROUPS>1</FREELIST_GROUPS>
                <BUFFER_POOL>DEFAULT</BUFFER_POOL>
              </STORAGE>
              <TABLESPACE>SYSTEM</TABLESPACE>
              <LOGGING>Y</LOGGING>
            </SEGMENT_ATTRIBUTES>
            <COMPRESS>N</COMPRESS>
          </HEAP_TABLE>
        </PHYSICAL_PROPERTIES>
      </RELATIONAL_TABLE>
    </TABLE>
    SQL> SELECT dbms_metadata.get_sxml('TABLE', 'A', USER) from dual;
    DBMS_METADATA.GET_SXML('TABLE','A',USER)
      <TABLE xmlns="http://xmlns.oracle.com/ku" version="1.0">
       <SCHEMA>SYSTEM</SCHEMA>
       <NAME>A</NAME>
       <RELATIONAL_TABLE>
          <COL_LIST>
             <COL_LIST_ITEM>
                <NAME>ID</NAME>
                <DATATYPE>NUMBER</DATATYPE>
                <PRECISION>10</PRECISION>
                <SCALE>0</SCALE>
             </COL_LIST_ITEM>
          </COL_LIST>
          <PHYSICAL_PROPERTIES>
             <HEAP_TABLE>
                <SEGMENT_ATTRIBUTES>
                   <PCTFREE>10</PCTFREE>
                   <PCTUSED>40</PCTUSED>
                   <INITRANS>1</INITRANS>
                   <STORAGE>
                      <INITIAL>65536</INITIAL>
                      <NEXT>1048576</NEXT>
                      <MINEXTENTS>1</MINEXTENTS>
                      <MAXEXTENTS>2147483645</MAXEXTENTS>
                      <PCTINCREASE>0</PCTINCREASE>
                      <FREELISTS>1</FREELISTS>
                      <FREELIST_GROUPS>1</FREELIST_GROUPS>
                      <BUFFER_POOL>DEFAULT</BUFFER_POOL>
                   </STORAGE>
                   <TABLESPACE>SYSTEM</TABLESPACE>
                   <LOGGING>Y</LOGGING>
                </SEGMENT_ATTRIBUTES>
                <COMPRESS>N</COMPRESS>
             </HEAP_TABLE>
          </PHYSICAL_PROPERTIES>
       </RELATIONAL_TABLE>
    </TABLE>
    -- dbms_metadata.set_transform_param
    -- http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_metada.htm#i1000135
    SQL> exec dbms_metadata.set_transform_param( dbms_metadata.session_transform, 'STORAGE', FALSE);
    PL/SQL procedure successfully completed.
    SQL> select dbms_metadata.get_ddl('TABLE','A') from dual;
    DBMS_METADATA.GET_DDL('TABLE','A')
      CREATE TABLE "SYSTEM"."A"
       (    "ID" NUMBER(10,0)
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      TABLESPACE "SYSTEM"
    SQL> exec dbms_metadata.set_transform_param( dbms_metadata.session_transform, 'DEFAULT');
    PL/SQL procedure successfully completed.
    SQL> select dbms_metadata.get_ddl('TABLE','A') from dual;
    DBMS_METADATA.GET_DDL('TABLE','A')
      CREATE TABLE "SYSTEM"."A"
       (    "ID" NUMBER(10,0)
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "SYSTEM"
    SQL> exec dbms_metadata.set_transform_param( dbms_metadata.session_transform, 'SEGMENT_ATTRIBUTES', FALSE);
    PL/SQL procedure successfully completed.
    SQL> select dbms_metadata.get_ddl('TABLE','A') from dual;
    DBMS_METADATA.GET_DDL('TABLE','A')
      CREATE TABLE "SYSTEM"."A"
       (    "ID" NUMBER(10,0)
    -- dbms_metadata.set_transform_param ONLY for DDL statements...
    -- http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_metada.htm#i1019414
    SQL> select dbms_metadata.get_xml('TABLE','A') from dual;
    DBMS_METADATA.GET_XML('TABLE','A')
    <?xml version="1.0"?><ROWSET><ROW>
      <TABLE_T>
    <VERS_MAJOR>1</VERS_MAJOR>
    <VERS_MINOR>2 </VERS_MINOR>
    <OBJ_NUM>58932</OBJ_NUM>
    <SCHEMA_OBJ>
      <OBJ_NUM>58932</OBJ_NUM>
      <DATAOBJ_NUM>58932</DATAOBJ_NUM>
      <OWNER_NUM>5</OWNER_NUM>
      <OWNER_NAME>SYSTEM</OWNER_NAME>
      <NAME>A</NAME>
      <NAMESPACE>1</NAMESPACE>
      <TYPE_NUM>2</TYPE_NUM>
      <TYPE_NAME>TABLE</TYPE_NAME>
      <CTIME>2008-03-19 11:16:45</CTIME>
      <MTIME>2008-03-19 11:16:45</MTIME>
      <STIME>2008-03-19 11:16:45</STIME>
      <STATUS>1</STATUS>
      <FLAGS>0</FLAGS>
      <SPARE1>6</SPARE1>
      <SPARE2>1</SPARE2>
      <SPARE3>5</SPARE3>
    </SCHEMA_OBJ>
    <STORAGE>
      <FILE_NUM>1</FILE_NUM>
      <BLOCK_NUM>65369</BLOCK_NUM>
      <TYPE_NUM>5</TYPE_NUM>
      <TS_NUM>0</TS_NUM>
      <BLOCKS>8</BLOCKS>
      <EXTENTS>1</EXTENTS>
      <INIEXTS>8</INIEXTS>
      <MINEXTS>1</MINEXTS>
      <MAXEXTS>2147483645</MAXEXTS>
      <EXTSIZE>128</EXTSIZE>
      <EXTPCT>0</EXTPCT>
      <USER_NUM>5</USER_NUM>
      <LISTS>1</LISTS>
      <GROUPS>1</GROUPS>
      <BITMAPRANGES>2147483645</BITMAPRANGES>
      <CACHEHINT>0</CACHEHINT>
      <SCANHINT>0</SCANHINT>
      <HWMINCR>58932</HWMINCR>
      <FLAGS>4325377</FLAGS>
    </STORAGE>
    <TS_NAME>SYSTEM</TS_NAME>
    <BLOCKSIZE>8192</BLOCKSIZE>
    <DATAOBJ_NUM>58932</DATAOBJ_NUM>
    <COLS>1</COLS>
    <PCT_FREE>10</PCT_FREE>
    <PCT_USED>40</PCT_USED>
    <INITRANS>1</INITRANS>
    <MAXTRANS>255</MAXTRANS>
    <FLAGS>1</FLAGS>
    <AUDIT_VAL>--------------------------------------</AUDIT_VAL>
    <INTCOLS>1</INTCOLS>
    <KERNELCOLS>1</KERNELCOLS>
    <PROPERTY>536870912</PROPERTY>
    <PROPERTY2>0</PROPERTY2>
    <XMLSCHEMACOLS>N</XMLSCHEMACOLS>
    <TRIGFLAG>0</TRIGFLAG>
    <SPARE1>736</SPARE1>
    <SPARE6>19-MAR-08</SPARE6>
    <COL_LIST>
      <COL_LIST_ITEM>
       <OBJ_NUM>58932</OBJ_NUM>
       <COL_NUM>1</COL_NUM>
       <INTCOL_NUM>1</INTCOL_NUM>
       <SEGCOL_NUM>1</SEGCOL_NUM>
       <PROPERTY>0</PROPERTY>
       <NAME>ID</NAME>
       <TYPE_NUM>2</TYPE_NUM>
       <LENGTH>22</LENGTH>
       <PRECISION_NUM>10</PRECISION_NUM>
       <SCALE>0</SCALE>
       <NOT_NULL>0</NOT_NULL>
       <CHARSETID>0</CHARSETID>
       <CHARSETFORM>0</CHARSETFORM>
       <BASE_INTCOL_NUM>1</BASE_INTCOL_NUM>
       <BASE_COL_TYPE>0</BASE_COL_TYPE>
       <SPARE1>0</SPARE1>
       <SPARE2>0</SPARE2>
       <SPARE3>0</SPARE3>
      </COL_LIST_ITEM>
    </COL_LIST>
    <CON0_LIST/>
    <CON1_LIST/>
    <CON2_LIST/>
    <REFPAR_LEVEL>0</REFPAR_LEVEL>
    </TABLE_T>
    </ROW></ROWSET>
    SQL> select dbms_metadata.get_xml('TABLE','B') from dual;
    DBMS_METADATA.GET_XML('TABLE','B')
    <?xml version="1.0"?><ROWSET><ROW>
      <TABLE_T>
    <VERS_MAJOR>1</VERS_MAJOR>
    <VERS_MINOR>2 </VERS_MINOR>
    <OBJ_NUM>58933</OBJ_NUM>
    <SCHEMA_OBJ>
      <OBJ_NUM>58933</OBJ_NUM>
      <DATAOBJ_NUM>58933</DATAOBJ_NUM>
      <OWNER_NUM>5</OWNER_NUM>
      <OWNER_NAME>SYSTEM</OWNER_NAME>
      <NAME>B</NAME>
      <NAMESPACE>1</NAMESPACE>
      <TYPE_NUM>2</TYPE_NUM>
      <TYPE_NAME>TABLE</TYPE_NAME>
      <CTIME>2008-03-19 11:17:05</CTIME>
      <MTIME>2008-03-19 11:17:05</MTIME>
      <STIME>2008-03-19 11:17:05</STIME>
      <STATUS>1</STATUS>
      <FLAGS>0</FLAGS>
      <SPARE1>6</SPARE1>
      <SPARE2>1</SPARE2>
      <SPARE3>5</SPARE3>
    </SCHEMA_OBJ>
    <STORAGE>
      <FILE_NUM>1</FILE_NUM>
      <BLOCK_NUM>65377</BLOCK_NUM>
      <TYPE_NUM>5</TYPE_NUM>
      <TS_NUM>0</TS_NUM>
      <BLOCKS>8</BLOCKS>
      <EXTENTS>1</EXTENTS>
      <INIEXTS>8</INIEXTS>
      <MINEXTS>1</MINEXTS>
      <MAXEXTS>2147483645</MAXEXTS>
      <EXTSIZE>128</EXTSIZE>
      <EXTPCT>0</EXTPCT>
      <USER_NUM>5</USER_NUM>
      <LISTS>1</LISTS>
      <GROUPS>1</GROUPS>
      <BITMAPRANGES>2147483645</BITMAPRANGES>
      <CACHEHINT>0</CACHEHINT>
      <SCANHINT>0</SCANHINT>
      <HWMINCR>58933</HWMINCR>
      <FLAGS>4325377</FLAGS>
    </STORAGE>
    <TS_NAME>SYSTEM</TS_NAME>
    <BLOCKSIZE>8192</BLOCKSIZE>
    <DATAOBJ_NUM>58933</DATAOBJ_NUM>
    <COLS>1</COLS>
    <PCT_FREE>10</PCT_FREE>
    <PCT_USED>40</PCT_USED>
    <INITRANS>1</INITRANS>
    <MAXTRANS>255</MAXTRANS>
    <FLAGS>1</FLAGS>
    <AUDIT_VAL>--------------------------------------</AUDIT_VAL>
    <INTCOLS>1</INTCOLS>
    <KERNELCOLS>1</KERNELCOLS>
    <PROPERTY>536870912</PROPERTY>
    <PROPERTY2>0</PROPERTY2>
    <XMLSCHEMACOLS>N</XMLSCHEMACOLS>
    <TRIGFLAG>0</TRIGFLAG>
    <SPARE1>736</SPARE1>
    <SPARE6>19-MAR-08</SPARE6>
    <COL_LIST>
      <COL_LIST_ITEM>
       <OBJ_NUM>58933</OBJ_NUM>
       <COL_NUM>1</COL_NUM>
       <INTCOL_NUM>1</INTCOL_NUM>
       <SEGCOL_NUM>1</SEGCOL_NUM>
       <PROPERTY>0</PROPERTY>
       <NAME>ID</NAME>
       <TYPE_NUM>2</TYPE_NUM>
       <LENGTH>22</LENGTH>
       <PRECISION_NUM>15</PRECISION_NUM>
       <SCALE>0</SCALE>
       <NOT_NULL>0</NOT_NULL>
       <CHARSETID>0</CHARSETID>
       <CHARSETFORM>0</CHARSETFORM>
       <BASE_INTCOL_NUM>1</BASE_INTCOL_NUM>
       <BASE_COL_TYPE>0</BASE_COL_TYPE>
       <SPARE1>0</SPARE1>
       <SPARE2>0</SPARE2>
       <SPARE3>0</SPARE3>
      </COL_LIST_ITEM>
    </COL_LIST>
    <CON0_LIST/>
    <CON1_LIST/>
    <CON2_LIST/>
    <REFPAR_LEVEL>0</REFPAR_LEVEL>
    </TABLE_T>
    </ROW></ROWSET>
    SQL> desc a
    Name                                      Null?    Type
    ID                                                 NUMBER(10)
    SQL> desc b
    Name                                      Null?    Type
    ID                                                 NUMBER(15)
    SQL> exec dbms_metadata.set_transform_param( dbms_metadata.session_transform, 'DEFAULT');
    PL/SQL procedure successfully completed.
    SQL> select XMLDIFF(
      2                 xmltype(dbms_metadata.get_xml('TABLE','A')),
      3                 xmltype(dbms_metadata.get_xml('TABLE','B'))
      4                ) as "DIFFERENCES"
      5  from dual;
    DIFFERENCES
    <xd:xdiff xsi:schemaLocation="http://xmlns.oracle.com/xdb/xdiff.xsd http://xmlns.oracle.com/xdb/xdiff.xsd"
        xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <?oracle-xmldiff operations-in-docorder="true" output-model="snapshot" diff-algorithm="global"?>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/OBJ_NUM[1]/text()[1]">
        <xd:content>58933</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/OBJ_NUM[1]/text()[1]">
        <xd:content>58933</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/DATAOBJ_NUM[1]/text()[1]">
        <xd:content>58933</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/text()[1]">
        <xd:content>B</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/CTIME[1]/text()[1]">
        <xd:content>2008-03-19 11:17:05</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/MTIME[1]/text()[1]">
        <xd:content>2008-03-19 11:17:05</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/STIME[1]/text()[1]">
        <xd:content>2008-03-19 11:17:05</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/STORAGE[1]/BLOCK_NUM[1]/text()[1]">
        <xd:content>65377</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/STORAGE[1]/HWMINCR[1]/text()[1]">
        <xd:content>58933</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/DATAOBJ_NUM[1]/text()[1]">
        <xd:content>58933</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COL_LIST[1]/COL_LIST_ITEM[1]/OBJ_NUM[1]/text()[1]">
        <xd:content>58933</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COL_LIST[1]/COL_LIST_ITEM[1]/PRECISION_NUM[1]/text()[1]">
        <xd:content>15</xd:content>
      </xd:update-node>
    </xd:xdiff>
    SQL> select XMLDIFF(
      2                 xmltype(dbms_metadata.get_xml('TABLE','B')),
      3                 xmltype(dbms_metadata.get_xml('TABLE','A'))
      4                ) as "DIFFERENCES"
      5  from dual;
    DIFFERENCES
    <xd:xdiff xsi:schemaLocation="http://xmlns.oracle.com/xdb/xdiff.xsd http://xmlns.oracle.com/xdb/xdiff.xsd"
        xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <?oracle-xmldiff operations-in-docorder="true" output-model="snapshot" diff-al
    gorithm="global"?>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/OBJ_NUM[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/OBJ_NUM[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/DATAOBJ_NUM[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/text()[1]">
        <xd:content>A</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/CTIME[1]/text()[1]">
        <xd:content>2008-03-19 11:16:45</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/MTIME[1]/text()[1]">
        <xd:content>2008-03-19 11:16:45</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/STIME[1]/text()[1]">
        <xd:content>2008-03-19 11:16:45</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/STORAGE[1]/BLOCK_NUM[1]/text()[1]">
        <xd:content>65369</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/STORAGE[1]/HWMINCR[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/DATAOBJ_NUM[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COL_LIST[1]/COL_LIST_ITEM[1]/OBJ_NUM[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COL_LIST[1]/COL_LIST_ITEM[1]/PRECISION_NUM[1]/text()[1]">
        <xd:content>10</xd:content>
      </xd:update-node>
    </xd:xdiff>
    SQL> WITH tabxml AS                                                                        
      2   (SELECT XMLDIFF(                                                                     
      3                            xmltype(dbms_metadata.get_xml('TABLE','A')),                
      4                            xmltype(dbms_metadata.get_xml('TABLE','B'))                 
      5                           ) xmlset                                                     
      6           FROM dual)                                                                   
      7  SELECT u.element_name                                                                 
      8  ,      u.element_value                                                             
      9  FROM   tabxml                                                                         
    10  ,      XMLTABLE                                                                       
    11         (XMLNAMESPACES ('http://xmlns.oracle.com/xdb/xdiff.xsd' AS "xd")               
    12          ,'//xd:update-node'                                                                   
    13           PASSING xmlset                                                               
    14           COLUMNS  element_name  xmltype PATH '//xd:update-node/@xd:xpath'
    15           ,        element_value xmltype PATH '//xd:content/text()'                      
    16         ) u                                                                            
    17  ;                                                                                     
    ELEMENT_NAME
    ELEMENT_VALUE
    /ROWSET[1]/ROW[1]/TABLE_T[1]/OBJ_NUM[1]/text()[1]
    58933
    /ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/OBJ_NUM[1]/text()[1]
    58933
    /ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/DATAOBJ_NUM[1]/text()[1]
    58933
    /ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/text()[1]
    B
    /ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/CTIME[1]/text()[1]
    2008-03-19 11:17:05
    /ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/MTIME[1]/text()[1]
    2008-03-19 11:17:05
    /ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/STIME[1]/text()[1]
    2008-03-19 11:17:05
    /ROWSET[1]/ROW[1]/TABLE_T[1]/STORAGE[1]/BLOCK_NUM[1]/text()[1]
    65377
    /ROWSET[1]/ROW[1]/TABLE_T[1]/STORAGE[1]/HWMINCR[1]/text()[1]
    58933
    /ROWSET[1]/ROW[1]/TABLE_T[1]/DATAOBJ_NUM[1]/text()[1]
    58933
    /ROWSET[1]/ROW[1]/TABLE_T[1]/COL_LIST[1]/COL_LIST_ITEM[1]/OBJ_NUM[1]/text()[1]
    58933
    /ROWSET[1]/ROW[1]/TABLE_T[1]/COL_LIST[1]/COL_LIST_ITEM[1]/PRECISION_NUM[1]/text(
    )[1]
    15
    12 rows selected.
    SQL> WITH tabxml AS                                                                        
      2   (SELECT XMLDIFF(                                                                     
      3                            xmltype(dbms_metadata.get_xml('TABLE','A')),                
      4                            xmltype(dbms_metadata.get_xml('TABLE','B'))                 
      5                           ) xmlset                                                     
      6           FROM dual)                                                                   
      7  SELECT u.element_name                                                                 
      8  ,      u.element_value                                                             
      9  FROM   tabxml                                                                         
    10  ,      XMLTABLE                                                                       
    11         (XMLNAMESPACES ('http://xmlns.oracle.com/xdb/xdiff.xsd' AS "xd")               
    12          ,'//xd:update-node'                                                                   
    13           PASSING xmlset                                                               
    14           COLUMNS  element_name  xmltype PATH '//xd:update-node[@xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/text()[1]"]'
    15           ,        element_value xmltype PATH '//xd:content/text()'                      
    16         ) u
    17  WHERE  u.element_name is not null                                                             
    18  ;                                                                                     
    ELEMENT_NAME
    ELEMENT_VALUE
    <xd:update-node xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd" xd:node-type="t
    ext" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/text()[1]"><xd
    :content>B</xd:content></xd:update-node>
    B
    SQL> col NAME  for a60
    SQL> col VALUE for a20
    SQL> WITH tabxml AS                                                                        
      2   (SELECT XMLDIFF(                                                                     
      3                            xmltype(dbms_metadata.get_xml('TABLE','A')),                
      4                            xmltype(dbms_metadata.get_xml('TABLE','B'))                 
      5                           ) xmlset                                                     
      6           FROM dual)                                                                   
      7  SELECT extract(u.element_name,'//@xd:xpath','xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd"') as "NAME"                                     
      8  ,      u.element_value                                                                          as "VALUE"                                             
      9  FROM   tabxml                                                                         
    10  ,      XMLTABLE                                                                       
    11         (XMLNAMESPACES ('http://xmlns.oracle.com/xdb/xdiff.xsd' AS "xd")               
    12          ,'//xd:update-node'                                                                         
    13           PASSING xmlset                                                               
    14           COLUMNS  element_name  xmltype PATH '//xd:update-node[@xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/text()[1]"]'
    15           ,        element_value xmltype PATH '//xd:content/text()'                      
    16         ) u
    17  WHERE  u.element_name is not null                                                                           
    18  ;                                                                                     
    NAME                                                         VALUE
    /ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/text()[1] B
    SQL> select XMLCONCAT(XMLDIFF(
      2          xmltype(dbms_metadata.get_xml('TABLE','A')),
      3          xmltype(dbms_metadata.get_xml('TABLE','B'))
      4         ),
      5                  XMLDIFF(
      6          xmltype(dbms_metadata.get_xml('TABLE','B')),
      7          xmltype(dbms_metadata.get_xml('TABLE','A'))
      8         ) )
      9  from dual;
    XMLCONCAT(XMLDIFF(XMLTYPE(DBMS_METADATA.GET_XML('TABLE','A')),XMLTYPE(DBMS_METAD
    <xd:xdiff xsi:schemaLocation="http://xmlns.oracle.com/xdb/xdiff.xsd http://xmlns
    .oracle.com/xdb/xdiff.xsd" xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd" xmln
    s:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <?oracle-xmldiff operations-in-docorder="true" output-model="snapshot" diff-al
    gorithm="global"?>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/OBJ
    _NUM[1]/text()[1]">
        <xd:content>58933</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCH
    EMA_OBJ[1]/OBJ_NUM[1]/text()[1]">
        <xd:content>58933</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCH
    EMA_OBJ[1]/DATAOBJ_NUM[1]/text()[1]">
        <xd:content>58933</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCH
    EMA_OBJ[1]/NAME[1]/text()[1]">
        <xd:content>B</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCH
    EMA_OBJ[1]/CTIME[1]/text()[1]">
        <xd:content>2008-03-19 11:17:05</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCH
    EMA_OBJ[1]/MTIME[1]/text()[1]">
        <xd:content>2008-03-19 11:17:05</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCH
    EMA_OBJ[1]/STIME[1]/text()[1]">
        <xd:content>2008-03-19 11:17:05</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/STO
    RAGE[1]/BLOCK_NUM[1]/text()[1]">
        <xd:content>65377</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/STO
    RAGE[1]/HWMINCR[1]/text()[1]">
        <xd:content>58933</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/DAT
    AOBJ_NUM[1]/text()[1]">
        <xd:content>58933</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COL
    _LIST[1]/COL_LIST_ITEM[1]/OBJ_NUM[1]/text()[1]">
        <xd:content>58933</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COL
    _LIST[1]/COL_LIST_ITEM[1]/PRECISION_NUM[1]/text()[1]">
        <xd:content>15</xd:content>
      </xd:update-node>
    </xd:xdiff>
    <xd:xdiff xsi:schemaLocation="http://xmlns.oracle.com/xdb/xdiff.xsd http://xmlns
    .oracle.com/xdb/xdiff.xsd" xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd" xmln
    s:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <?oracle-xmldiff operations-in-docorder="true" output-model="snapshot" diff-al
    gorithm="global"?>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/OBJ
    _NUM[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCH
    EMA_OBJ[1]/OBJ_NUM[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCH
    EMA_OBJ[1]/DATAOBJ_NUM[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCH
    EMA_OBJ[1]/NAME[1]/text()[1]">
        <xd:content>A</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCH
    EMA_OBJ[1]/CTIME[1]/text()[1]">
        <xd:content>2008-03-19 11:16:45</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCH
    EMA_OBJ[1]/MTIME[1]/text()[1]">
        <xd:content>2008-03-19 11:16:45</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCH
    EMA_OBJ[1]/STIME[1]/text()[1]">
        <xd:content>2008-03-19 11:16:45</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/STO
    RAGE[1]/BLOCK_NUM[1]/text()[1]">
        <xd:content>65369</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/STO
    RAGE[1]/HWMINCR[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/DAT
    AOBJ_NUM[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COL
    _LIST[1]/COL_LIST_ITEM[1]/OBJ_NUM[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COL
    _LIST[1]/COL_LIST_ITEM[1]/PRECISION_NUM[1]/text()[1]">
        <xd:content>10</xd:content>
      </xd:update-node>
    </xd:xdiff>
    SQL> WITH tabxml AS                                                                        
      2   ( select XMLCONCAT(XMLDIFF(
      3                            xmltype(dbms_metadata.get_xml('TABLE','A')),
      4                            xmltype(dbms_metadata.get_xml('TABLE','B'))
      5                           ),
      6                                    XMLDIFF(
      7                            xmltype(dbms_metadata.get_xml('TABLE','B')),
      8                            xmltype(dbms_metadata.get_xml('TABLE','A'))
      9                           ) ) xmlset
    10   from DUAL)                                                                   
    11  SELECT extract(u.element_name,'//@xd:xpath','xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd"') as "NAME"                                        
    12  ,      u.element_value                                                                          as "VALUE"                                                
    13  FROM   tabxml                                                                         
    14  ,      XMLTABLE                                                                       
    15         (XMLNAMESPACES ('http://xmlns.oracle.com/xdb/xdiff.xsd' AS "xd")               
    16          ,'//xd:update-node'                                                                         
    17           PASSING xmlset                                                               
    18           COLUMNS  element_name  xmltype PATH '//xd:update-node[@xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/text()[1]"]'
    19           ,        element_value xmltype PATH '//xd:content/text()'                      
    20         ) u
    21  WHERE  u.element_name is not null                                                                           
    22  ;                                                                                     
    NAME                                                         VALUE
    /ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/text()[1] B
    /ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/text()[1] A
    SQL> WITH tabxml AS                                                                        
      2   ( select XMLCONCAT(XMLDIFF(
      3                            xmltype(dbms_metadata.get_xml('TABLE','A')),
      4                            xmltype(dbms_metadata.get_xml('TABLE','B'))
      5                           ),
      6                                    XMLDIFF(
      7                            xmltype(dbms_metadata.get_xml('TABLE','B')),
      8                            xmltype(dbms_metadata.get_xml('TABLE','A'))
      9                           ) ) xmlset
    10   from DUAL)                                                                   
    11  SELECT extract(u.element_name,'//@xd:xpath','xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd"') as "NAME"                                            
    12  ,      u.element_value                                                                 as "VALUE"                                                    
    13  FROM   tabxml                                                                         
    14  ,      XMLTABLE                                                                       
    15         (XMLNAMESPACES ('http://xmlns.oracle.com/xdb/xdiff.xsd' AS "xd")               
    16          ,'/xd:xdiff/xd:update-node'                                                                         
    17           PASSING xmlset                                                               
    18           COLUMNS  element_name  xmltype PATH '/xd:update-node[@xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/text()[1]"]'
    19           ,        element_value xmltype PATH '/xd:update-node/xd:content/text()'                      
    20         ) u
    21  WHERE  u.element_name is not null                                                                           
    22  ;                                                                                     
    NAME                                                         VALUE
    /ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/text()[1] B
    /ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/text()[1] A
    SQL> select XMLCONCAT(XMLDIFF(
      2                           xmltype(dbms_metadata.get_xml('TABLE','A')),
      3                           xmltype(dbms_metadata.get_xml('TABLE','C'))
      4                          ),
      5                                   XMLDIFF(
      6                           xmltype(dbms_metadata.get_xml('TABLE','C')),
      7                           xmltype(dbms_metadata.get_xml('TABLE','A'))
      8                          ) )
      9  from DUAL
    10  ;
    XMLCONCAT(XMLDIFF(XMLTYPE(DBMS_METADATA.GET_XML('TABLE','A')),XMLTYPE(DBMS_METADATA.GET_XML('TABLE',
    <xd:xdiff xsi:schemaLocation="http://xmlns.oracle.com/xdb/xdiff.xsd http://xmlns.oracle.com/xdb/xdif
    f.xsd" xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
    instance">
      <?oracle-xmldiff operations-in-docorder="true" output-model="snapshot" diff-algorithm="global"?>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/OBJ_NUM[1]/text()[1]">
        <xd:content>58935</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/OBJ_NUM[1
    ]/text()[1]">
        <xd:content>58935</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/DATAOBJ_N
    UM[1]/text()[1]">
        <xd:content>58935</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/t
    ext()[1]">
        <xd:content>C</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/CTIME[1]/
    text()[1]">
        <xd:content>2008-03-19 15:08:47</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/MTIME[1]/
    text()[1]">
        <xd:content>2008-03-19 15:08:47</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/STIME[1]/
    text()[1]">
        <xd:content>2008-03-19 15:08:47</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/STORAGE[1]/BLOCK_NUM[1]
    /text()[1]">
        <xd:content>65385</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/STORAGE[1]/HWMINCR[1]/t
    ext()[1]">
        <xd:content>58935</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/DATAOBJ_NUM[1]/text()[1
    ]">
        <xd:content>58935</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COLS[1]/text()[1]">
        <xd:content>2</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/INTCOLS[1]/text()[1]">
        <xd:content>2</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/KERNELCOLS[1]/text()[1]
    ">
        <xd:content>2</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COL_LIST[1]/COL_LIST_IT
    EM[1]/OBJ_NUM[1]/text()[1]">
        <xd:content>58935</xd:content>
      </xd:update-node>
      <xd:append-node xd:node-type="element" xd:parent-xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COL_LIST[1]">
        <xd:content>
          <COL_LIST_ITEM>
            <OBJ_NUM>58935</OBJ_NUM>
            <COL_NUM>2</COL_NUM>
            <INTCOL_NUM>2</INTCOL_NUM>
            <SEGCOL_NUM>2</SEGCOL_NUM>
            <PROPERTY>0</PROPERTY>
            <NAME>EXTRA</NAME>
            <TYPE_NUM>1</TYPE_NUM>
            <LENGTH>50</LENGTH>
            <NOT_NULL>0</NOT_NULL>
            <CHARSETID>873</CHARSETID>
            <CHARSETFORM>1</CHARSETFORM>
            <BASE_INTCOL_NUM>2</BASE_INTCOL_NUM>
            <BASE_COL_TYPE>0</BASE_COL_TYPE>
            <SPARE1>0</SPARE1>
            <SPARE2>0</SPARE2>
            <SPARE3>50</SPARE3>
          </COL_LIST_ITEM>
        </xd:content>
      </xd:append-node>
    </xd:xdiff>
    <xd:xdiff xsi:schemaLocation="http://xmlns.oracle.com/xdb/xdiff.xsd http://xmlns.oracle.com/xdb/xdif
    f.xsd" xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
    instance">
      <?oracle-xmldiff operations-in-docorder="true" output-model="snapshot" diff-algorithm="global"?>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/OBJ_NUM[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/OBJ_NUM[1
    ]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/DATAOBJ_N
    UM[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/NAME[1]/t
    ext()[1]">
        <xd:content>A</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/CTIME[1]/
    text()[1]">
        <xd:content>2008-03-19 11:16:45</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/MTIME[1]/
    text()[1]">
        <xd:content>2008-03-19 11:16:45</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/SCHEMA_OBJ[1]/STIME[1]/
    text()[1]">
        <xd:content>2008-03-19 11:16:45</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/STORAGE[1]/BLOCK_NUM[1]
    /text()[1]">
        <xd:content>65369</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/STORAGE[1]/HWMINCR[1]/t
    ext()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/DATAOBJ_NUM[1]/text()[1
    ]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COLS[1]/text()[1]">
        <xd:content>1</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/INTCOLS[1]/text()[1]">
        <xd:content>1</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/KERNELCOLS[1]/text()[1]
    ">
        <xd:content>1</xd:content>
      </xd:update-node>
      <xd:update-node xd:node-type="text" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COL_LIST[1]/COL_LIST_IT
    EM[1]/OBJ_NUM[1]/text()[1]">
        <xd:content>58932</xd:content>
      </xd:update-node>
      <xd:delete-node xd:node-type="element" xd:xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COL_LIST[1]/COL_LIST
    _ITEM[2]"/>
    </xd:xdiff>
    SQL> col LENGTH for a10
    SQL> WITH tabxml AS                                                                        
      2   ( select XMLCONCAT(XMLDIFF(
      3                            xmltype(dbms_metadata.get_xml('TABLE','A')),
      4                            xmltype(dbms_metadata.get_xml('TABLE','C'))
      5                           ),
      6                                    XMLDIFF(
      7                            xmltype(dbms_metadata.get_xml('TABLE','C')),
      8                            xmltype(dbms_metadata.get_xml('TABLE','A'))
      9                           ) ) xmlset
    10    from DUAL)                                                                   
    11  SELECT extract(v.append_name,'//@xd:parent-xpath','xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd"')             as "NAME"
    12  ,      extract(v.append_value,'//COL_LIST_ITEM/NAME/text()','xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd"')   as "VALUE"
    13  ,      extract(v.append_value,'//COL_LIST_ITEM/LENGTH/text()','xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd"') as "LENGTH"
    14  FROM   tabxml                                                                         
    15  ,      XMLTABLE                                                                       
    16         (XMLNAMESPACES ('http://xmlns.oracle.com/xdb/xdiff.xsd' AS "xd")               
    17          ,'/xd:xdiff/xd:append-node'                                                                         
    18           PASSING  xmlset                                                               
    19           COLUMNS  append_name  xmltype PATH '/xd:append-node[@xd:parent-xpath="/ROWSET[1]/ROW[1]/TABLE_T[1]/COL_LIST[1]"]'
    20           ,        append_value xmltype PATH '/xd:append-node/xd:content'                      
    21         ) v       
    22  WHERE  v.append_name  is not null                                                                         
    23  ;                                                                                     
    NAME                                                         VALUE                LENGTH
    /ROWSET[1]/ROW[1]/TABLE_T[1]/COL_LIST[1]                     EXTRA                50
    SQL> drop procedure proc_01;
    Procedure dropped.
    SQL>
    SQL> create or replace procedure proc_01
      2  as
      3  begin
      4    null;
      5  end;
      6  /
    Procedure created.
    SQL>
    SQL> drop procedure proc_02;
    Procedure dropped.
    SQL>
    SQL> create or replace procedure proc_02
      2  as
      3  begin
      4    NULL;
      5  -- this is extra
      6  end;
      7  /
    Procedure created.
    SQL> select dbms_metadata.get_ddl('PROCEDURE','PROC_01') from dual;
    DBMS_METADATA.GET_DDL('PROCEDURE','PROC_01')
      CREATE OR REPLACE PROCEDURE "SYSTEM"."PROC_01"
    as
    begin
      null;
    end;
    SQL>  select dbms_metadata.get_ddl('PROCEDURE','PROC_02') from dual;
    DBMS_METADATA.GET_DDL('PROCEDURE','PROC_02')
      CREATE OR REPLACE PROCEDURE "SYSTEM"."PROC_02"
    as
    begin
      NULL;
    -- this is extra
    end;
    SQL> select dbms_metadata.get_xml('PROCEDURE','PROC_01') from dual;
    DBMS_METADATA.GET_XML('PROCEDURE','PROC_01')
    <?xml version="1.0"?><ROWSET><ROW>
      <PROCEDURE_T>
    <VERS_MAJOR>1</VERS_MAJOR>
    <VERS_MINOR>1 </VERS_MINOR>
    <OBJ_NUM>58937</OBJ_NUM>
    <TYPE_NUM>7</TYPE_NUM>
    <SCHEMA_OBJ>
      <OBJ_NUM>58937</OBJ_NUM>
      <OWNER_NUM>5</OWNER_NUM>
      <OWNER_NAME>SYSTEM</OWNER_NAME>
      <NAME>PROC_01</NAME>
      <NAMESPACE>1</NAMESPACE>
      <TYPE_NUM>7</TYPE_NUM>
      <TYPE_NAME>PROCEDURE</TYPE_NAME>
      <CTIME>2008-03-19 16:39:34</CTIME>
      <MTIME>2008-03-19 16:39:34</MTIME>
      <STIME>2008-03-19 16:39:34</STIME>
      <STATUS>1</STATUS>
      <FLAGS>0</FLAGS>
      <SPARE1>6</SPARE1>
      <SPARE2>65535</SPARE2>
      <SPARE3>5</SPARE3>
    </SCHEMA_OBJ>
    <SOURCE_LINES>
      <SOURCE_LINES_ITEM>
       <OBJ_NUM>58937</OBJ_NUM>
       <LINE>1</LINE>
       <PRE_NAME>0</PRE_NAME>
       <POST_NAME_OFF>18</POST_NAME_OFF>
       <POST_KEYW>11</POST_KEYW>
       <PRE_NAME_LEN>0</PRE_NAME_LEN>
       <SOURCE>procedure proc_01
    </SOURCE>
      </SOURCE_LINES_ITEM>
      <SOURCE_LINES_ITEM>
       <OBJ_NUM>58937</OBJ_NUM>
       <LINE>2</LINE>
       <PRE_NAME>0</PRE_NAME>
       <POST_NAME_OFF>0</POST_NAME_OFF>
       <POST_KEYW>0</POST_KEYW>
       <PRE_NAME_LEN>0</PRE_NAME_LEN>
       <SOURCE>as
    </SOURCE>
      </SOURCE_LINES_ITEM>
      <SOURCE_LINES_ITEM>
       <OBJ_NUM>58937</OBJ_NUM>
       <LINE>3</LINE>
       <PRE_NAME>0</PRE_NAME>
       <POST_NAME_OFF>0</POST_NAME_OFF>
       <POST_KEYW>0</POST_KEYW>
       <PRE_NAME_LEN>0</PRE_NAME_LEN>
       <SOURCE>begin
    </SOURCE>
      </SOURCE_LINES_ITEM>
      <SOURCE_LINES_ITEM>
       <OBJ_NUM>58937</OBJ_NUM>
       <LINE>4</LINE>
       <PRE_NAME>0</PRE_NAME>
       <POST_NAME_OFF>0</POST_NAME_OFF>
       <POST_KEYW>0</POST_KEYW>
       <PRE_NAME_LEN>0</PRE_NAME_LEN>
       <SOURCE>  null;
    </SOURCE>
      </SOURCE_LINES_ITEM>
      <SOURCE_LINES_ITEM>
       <OBJ_NUM>58937</OBJ_NUM>
       <LINE>5</LINE>
       <PRE_NAME>0</PRE_NAME>
       <POST_NAME_OFF>0</POST_NAME_OFF>
       <POST_KEYW>0</POST_KEYW>
       <PRE_NAME_LEN>0</PRE_NAME_LEN>
       <SOURCE>end;</SOURCE>
      </SOURCE_LINES_ITEM>
    </SOURCE_LINES>
    </PROCEDURE_T>
    </ROW></ROWSET>
    SQL> select dbms_metadata.get_xml('PROCEDURE','PROC_02') from dual;
    DBMS_METADATA.GET_XML('PROCEDURE','PROC_02')
    <?xml version="1.0"?><ROWSET><ROW>
      <PROCEDURE_T>
    <VERS_MAJOR>1</VERS_MAJOR>
    <VERS_MINOR>1 </VERS_MINOR>
    <OBJ_NUM>58938</OBJ_NUM>
    <TYPE_NUM>7</TYPE_NUM>
    <SCHEMA_OBJ>
      <OBJ_NUM>58938</OBJ_NUM>
      <OWNER_NUM>5</OWNER_NUM>
      <OWNER_NAME>SYSTEM</OWNER_NAME>
      <NAME>PROC_02</NAME>
      <NAMESPACE>1</NAMESPACE>
      <TYPE_NUM>7</TYPE_NUM>
      <TYPE_NAME>PROCEDURE</TYPE_NAME>
      <CTIME>2008-03-19 16:39:34</CTIME>
      <MTIME>2008-03-19 16:39:34</MTIME>
      <STIME>2008-03-19 16:39:34</STIME>
      <STATUS>1</STATUS>
      <FLAGS>0</FLAGS>
      <SPARE1>6</SPARE1>
      <SPARE2>65535</SPARE2>
      <SPARE3>5</SPARE3>
    </SCHEMA_OBJ>
    <SOURCE_LINES>
      <SOURCE_LINES_ITEM>
       <OBJ_NUM>58938</OBJ_NUM>
       <LINE>1</LINE>
       <PRE_NAME>0</PRE_NAME>
       <POST_NAME_OFF>18</POST_NAME_OFF>
       <POST_KEYW>11</POST_KEYW>
       <PRE_NAME_LEN>0</PRE_NAME_LEN>
       <SOURCE>procedure proc_02
    </SOURCE>
      </SOURCE_LINES_ITEM>
      <SOURCE_LINES_ITEM>
       <OBJ_NUM>58938</OBJ_NUM>
       <LINE>2</LINE>
       <PRE_NAME>0</PRE_NAME>
       <POST_NAME_OFF>0</POST_NAME_OFF>
       <POST_KEYW>0</POST_KEYW>
       <PRE_NAME_LEN>0</PRE_NAME_LEN>
       <SOURCE>as
    </SOURCE>
      </SOURCE_LINES_ITEM>
      <SOURCE_LINES_ITEM>
       <OBJ_NUM>58938</OBJ_NUM>
       <LINE>3</LINE>
       <PRE_NAME>0</PRE_NAME>
       <POST_NAME_OFF>0</POST_NAME_OFF>
       <POST_KEYW>0</POST_KEYW>
       <PRE_NAME_LEN>0</PRE_NAME_LEN>
       <SOURCE>begin
    </SOURCE>
      </SOURCE_LINES_ITEM>
      <SOURCE_LINES_ITEM>
       <OBJ_NUM>58938</OBJ_NUM>
       <LINE>4</LINE>
       <PRE_NAME>0</PRE_NAME>
       <POST_NAME_OFF>0</POST_NAME_OFF>
       <POST_KEYW>0<

    Hi ,
    Document link :http://docs.oracle.com/cd/E23943_01/doc.1111/e10792/c04_settings.htm#CSMSP463
    This gives details and sample for the configuration of JDBC storage with WCC .
    Thanks,
    Srinath

  • How to compare a database field and form field and highlight differences

    Hi there,
    I have been trying to find a coldfusion function that will help, I have tried comparing two strings but the results of -1 1 or 0 aren't very useful.
    I need to compare a database field with a form field and highlight all the differences in the form field in red.
    Thanks
    Katie

    This is a non-trivial process.  Rather than doing a compare, you really are wanting to do a diff.  CF doesn't do this out of the box, but you might want to have a sniff around on Google to see if anyone has implemented anything for CF.
    Some reading:
    http://en.wikipedia.org/wiki/Diff#Algorithm
    Adam

  • Text document search

    I have 2 text files that I need to compare a child list and a parent list. The problem is leading zeros in one of the files. For example.
    Child (600 mb)
    123
    134
    4241
    456Parent (1.5 gb)
    0000123
    00456
    000789I have to find which numbers in the child list exist in the parent list. I would have just used a bash script and done a 'comm' on both the files, but the leading zeros is preventing me from this. So I decided to do this in java and I'd like to know if my logic seems correct (and if this would be the fastest way of doing it). Would it be faster to remove all the leading zeros from the both files, or would it be better to do something like this...
    //looping through the parent list
    //compare the lines and if they don't match continue
    if ( childLine.elementAt(0) == 0 || parentLine.elementAt(0) == 0 ) {
       if ( childLine.length != parentLine.length ) {
          //trim leading zeros
          //compare again
    }  else {
    //continue through the loopLet me know if you need clarification. TIA.

    prem1ers wrote:
    I have 2 text files that I need to compare a child list and a parent list. The problem is leading zeros in one of the files. For example.
    I have to find which numbers in the child list exist in the parent list. I would have just used a bash script and done a 'comm' on both the files, but the leading zeros is preventing me from this. So I decided to do this in java and I'd like to know if my logic seems correctAssuming that each line in both files is guaranteed to be a number, I would use Integer.parseInt() or Double.parseDouble() to convert the string to a numeric value and then compare those. However, unless you plan on reading one file in completely, or one file is known to be a subset of the other, the comparison logic is not straightforward.
    I suggest you Google the 'diff' algorithm, which uses (as far as I remember) a "staircase" comparison. It may have you scratching your head for a while (as it did me :-)), but with files of that size it may be the best approach.
    HIH
    Winston
    PS: 'comm' will only work if both files are sorted. If that is allowed, then of course the comparison is much more straightforward and would not require diff.
    Edited by: YoungWinston on Nov 13, 2009 6:33 AM

  • Compare 2 different xml versions and highlite the differences

    Hi,
    Currently we have xml and that is displayed on the web page using the css style sheets.
    The xml we have remain the same most part but with small changes (say different version created after a week).
    We want to be able to track the differences from the previous version and highlight them, the differences, when showing it in the web page.
    Please advise if this can be done and how.
    Thanks.

    try
    SQL> set serveroutput on
    SQL> set long 50000
    SQL>
    SQL> declare
      2 
      3    --main
      4    xml1 xmltype := xmltype('<ROWSET>
      5                                <ROW>
      6                                  <EMPNO>7934</EMPNO>
      7                                  <ENAME>MILLER</ENAME>
      8                                  <JOB>CLERK</JOB>
      9                                  <MGR>7782</MGR>
    10                                  <HIREDATE>1982-01-23T00:00:00</HIREDATE>
    11                                  <REMOVED>abc</REMOVED>
    12                                  <SAL>1300</SAL>
    13                                  <COMM/>
    14                                  <DEPTNO>10</DEPTNO>
    15                                </ROW>
    16                              </ROWSET>');
    17    --new
    18    xml2 xmltype := xmltype('<ROWSET>
    19                                <ROW>
    20                                  <EMPNO>7934</EMPNO>
    21                                  <ENAME>MILLER</ENAME>
    22                                  <JOB>CLERK</JOB>
    23                                  <MGR>7782</MGR>
    24                                  <ADDED>xyz</ADDED>
    25                                  <HIREDATE>1982-01-23T00:00:00</HIREDATE>
    26                                  <SAL>1300</SAL>
    27                                  <COMM/>
    28                                  <DEPTNO>10</DEPTNO>
    29                                </ROW>
    30                              </ROWSET>');
    31    diff xmltype;
    32 
    33    xtype varchar2(80);
    34    xpath varchar2(80);
    35    xpathChild varchar2(80);
    36    xnodeChild varchar2(80);
    37    new_value xmltype;
    38 
    39    new_xml xmltype;
    40 
    41 
    42  begin
    43 
    44    -- get diff
    45    select xmldiff(xml1, xml2) into diff from dual;
    46    dbms_output.put_line(diff.getclobval());
    47 
    48    -- that have
    49    select x.xtype, x.xpath, x.new_value
    50      into xtype, xpath, new_value
    51      from xmltable(
    52             xmlnamespaces('http://xmlns.oracle.com/xdb/xdiff.xsd' as "xd"
    53                          ,'http://www.w3.org/2001/XMLSchema-instance' as "xsi"
    54                          )
    55           , '/xd:xdiff'
    56             passing diff
    57             columns xtype     varchar2(80) path 'local-name(xd:insert-node-before)'
    58                   , xpath     varchar2(80) path'xd:insert-node-before/@xd:xpath'
    59                   , new_value xmltype path 'xd:insert-node-before/xd:content/*'
    60           ) x;
    61 
    62     dbms_output.put_line('type of doing: ' || xtype);
    63     dbms_output.put_line('path for doing: ' || xpath);
    64     dbms_output.put_line('value for doing: ' || new_value.getclobval());
    65 
    66     if (xtype = 'insert-node-before') then
    67       xpathChild := substr(xpath, 1, instr(xpath, '/',-1)-1);
    68       xnodeChild := substr(xpath, instr(xpath, '/',-1)+1);
    69 
    70       select insertChildXMLbefore (xml1,
    71                                    xpathChild,
    72                                    xnodeChild,
    73                                    XMLType('<HIGHLIGHT>' || new_value || '</HIGHLIGHT>'))
    74       into new_xml
    75       from dual;
    76     end if;
    77 
    78 
    79     dbms_output.put_line(new_xml.getclobval());
    80 
    81  end;
    82  /
    <xd:xdiff xsi:schemaLocation="http://xmlns.oracle.com/xdb/xdiff.xsd http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><?oracle-xmldiff operations-in-docorder="true" output-model="snapshot" diff-algorithm="global"?><xd:insert-node-before xd:node-type="element" xd:xpath="/ROWSET[1]/ROW[1]/HIREDATE[1]"><xd:content><ADDED>xyz</ADDED></xd:content></xd:insert-node-before><xd:delete-node xd:node-type="element" xd:xpath="/ROWSET[1]/ROW[1]/REMOVED[1]"/></xd:xdiff>
    type of doing: insert-node-before
    path for doing: /ROWSET[1]/ROW[1]/HIREDATE[1]
    value for doing: <ADDED>xyz</ADDED>
    <ROWSET><ROW><EMPNO>7934</EMPNO><ENAME>MILLER</ENAME><JOB>CLERK</JOB><MGR>7782</MGR><HIGHLIGHT><ADDED>xyz</ADDED></HIGHLIGHT><HIREDATE>1982-01-23T00:00:00</HIREDATE><REMOVED>abc</REMOVED><SAL>1300</SAL><COMM/><DEPTNO>10</DEPTNO></ROW></ROWSET>
    PL/SQL procedure successfully completed
    SQL>
    SQL> select * from v$version where rownum=1;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    SQL>

  • XQuery Namespace Problem !

    Hello everyone...
    I'm trying to generate a Xdiff document using XQuery. First, i have tried to generate a static XDiff document using Xquery. I'm getting a problem with namespace. The XQuery I have written is
    select xmlroot(XMLQuery('
    declare namespace xsi="xsi"; (: :)
    declare namespace xd="xd"; (: :)
    let $chk1:=( <xd:delete-node xd:node-type="element" xd:xpath="/RootElement[1]/Invalid[1]" />)
    return <xd:xdiff xsi:schemaLocation="http://xmlns.oracle.com/xdb/xdiff.xsd http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <?oracle-xmldiff operations-in-docorder="false" output-model="current" diff-algorithm="global"?>{$chk1}</xd:xdiff>
    returning content), VERSION '1.0')
    from dual;
    The above query gives me the output
    <?xml version="1.0"?>
    <xd:xdiff xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLo
    cation="http://xmlns.oracle.com/xdb/xdiff.xsd http://xmlns.oracle.com/xdb/xdiff.xsd">
    <?oracle-xmldiff operations-in-docorder="false" output-model="current" diff-algorithm="global"?>
    <xd:delete-node xmlns:xd="xd" xd:node-type="element" xd:xpath="/RootElement[1]/Invalid[1]"/>
    </xd:xdiff>
    I don't want that xmlns="xd" attribute. How to eliminate that?
    Please help me.
    Thanks in advance,
    R Kaja Mohideen

    I found that giving the full URL in declare namespace resolves my issue. Oracle's XMLPatch accepts XDiff document generated by this XQuery.

  • Garageband sound issue

    I was messing around with a finished song and I accidentally bumped the tempo and now all of the tracks I made sound like I'm in a bumpy car. It could have been something other than the tempo that I messed with. If you know a solution please please help!!

    Short answer: Turn on Flex Mode on all Audio Tracks
    Two things:
    Follow Tempo & Pitch
    When you record new audio in your Project, then the "Follow Tempo & Pitch" feature is automatically enabled. That means, when you change the Tempo after you recorded, the Audio File will be Time Shifted to fit the new Tempo. However, the quality, as you have noted, is not as good. Here is a better solution:
    Flex Time:
    The Flex Time feature which is disabled by default, lets you time shift sections inside the waveform to perform time correction. The magic behind that relies on Transient Markers that are automatically ceased at peaks in the audio waveform. Select the Audio Tracks, open the Audio Track Editor and enable the Flex Mode with the Flex Button in the left upper corner. GarageBand even selects different Flex Time Algorithms based on the audio material (percussive, mono phone, polyphony) to get the best results.
    There is so much more to the Flex Time feature. I explain all that magic anyhow to use it in my graphically enhanced manual "GarageBand X - How it Works"
    Hope that helps
    Edgar Rothermich
    http://DingDingMusic.com/Manuals/
    'I may receive some form of compensation, financial or otherwise, from my recommendation or link.'

  • Can diffie hellman security algorithm be implemented on cpt?

    can diffie hellman security algorithm be implemented on cpt?

    The public and the private key arrays that are generated are of length 298 and 296 (keeps changing) . I want to set the size of these values to be 128 bytes How can i Do that ?
    I think, you can't. Using 1024 as "the size in bits of the random exponent (private value)" means that the encoding contains some additional bits of overhead plus the bits of p and g (or something like that). You'd have to use much shorted exponent in order to fit into 128 bytes. I wouldn't do it.
    Do we need to provide the value of vendor public key at X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(pub); !!!
    Is it a question? I don't understand.
    Btw., you should NEVER swallow exceptions.

  • Diffie-Hellman Algorithm and Man-in-the-middle attack

    From the RSA Security site, it says that Diffie-Hellman Algorithm
    is susceptable to the Man-in-the-middle attack, because there
    is not mechanism to prove the authenticity of the public keys
    being exchanged.
    Is it true then, the only way to protect against this,
    is the use of a signed certificate?

    or rather, the only way to protect against
    the attack is to authenticate before generating the
    DH secret key.
    signed certificates are one way of authenticating,
    userid/password, hardware token, biometrics are others.
    i guess you could use any of these after looking at
    trade-offs between security/useability.

  • Diffie-Hellman algorithm hexadecimal

    Hello,
    I've made DH algoritm (link) but I need it to calculate in hex, can someone please show me how to tweek my code for that?
    Attachments:
    DH_algorithm_HEX.vi ‏14 KB

    HEX is a representation (in Base 16) of numeric (usually integer!!) data.  Your code shows Dbl (64-bit floats), which is not an "exact" numeric representation, so is unlikely to implement Diffie-Hillman.  I notice you use the remainder operator which is well-defined for integer representations, but whose meaning is unclear (to me) for floats.
    You should only need to use Hex to turn an input representation into an internal numeric form for computations, and to transform the output into a final representation.
    Rethink what you are doing.
    Bob Schor

  • Ideas for algorithm to display how many words in a sentence differ?

    For example......
    sentenceA: I went to the store today.
    sentenceB: I want to the store tdoay.
    ...easy case...compare word by word, we see one difference. BUT, this fails in a case such as the one below:
    sentenceA: I went to the store today.
    sentenceB: I went went to the store today.
    ....if we just compare word by word, it will fail on the 3rd word, and all the subsequent words will not match as well. We want this case to be returned as 1 error.
    Any ideas? I've tried some algoriths that read both sentences both forward and backwards and compares, and this helps with the extra inserted words, but it is not foolproof/ideal for all cases.
    Maybe I am missing some obvious way to accomplish this?
    Thanks alot for any ideas/inspiration guys!

    turbo, I thought about this again. I'd still recommend you look at some texts on compiler construction. The scanner (in your case) would return one word at a time. If punctuation is not significant in your case, then the scanner should ignore things like periods, commas, etc.
    In a compiler situation, the parser compares the token against a grammar to determine if the token fits any of the rules. In your case, the "rule" could simply be the contents of one of the documents in a "tokenized" format (meaning, if the punctuation is not significant, the tokenized list omits those). The "tokenized" contents of the second document could be compared against that of the first one.
    I have not dealt with compiler writing for quite a few years and so some of the concepts are quite rusty. One of those is the error handling and restarting the parsing process. If I may, that's the area you may want to check. Methinks you ought to be able to adapt that approach to fit your requirements. Just a parser can count the number of errors, yours should be able to keep track of the number of mismatches.
    Hope this helps!
    Cheers!

  • Diffie hellman algorithm

            try{
                    BigInteger p = new BigInteger(1, primeA);
                    BigInteger g = new BigInteger("5");
                    KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DH");
                    DHParameterSpec dhSpec = new DHParameterSpec(p, g, 1024 );
                    keyGen.initialize(dhSpec);
                    KeyPair keypair = keyGen.generateKeyPair();
                    PrivateKey privateKey = keypair.getPrivate();
                    PublicKey publicKey = keypair.getPublic();
                    byte[] pub = publicKey.getEncoded();
                    byte[] priv = privateKey.getEncoded();
                    System.out.println("PRIVATE KEY=" + priv.length + "   PUBLIC KEY=" +pub.length);
                    X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(pub);
                    KeyFactory keyFact = KeyFactory.getInstance("DH");
                    publicKey = keyFact.generatePublic(x509KeySpec);
                    KeyAgreement ka = KeyAgreement.getInstance("DH");
                    ka.init(privateKey);
                    ka.doPhase(publicKey, true);
                    byte []secretKey = ka.generateSecret();
                     System.out.println("------------------------------------"  +secretKey.length);
                    convertByte2Hex(secretKey , "  secretKey  " ) ;
            } catch (java.lang.NumberFormatException nfe) {System.out.println("iNumber format exception");
            } catch (java.security.InvalidAlgorithmParameterException e) {
            } catch (java.security.NoSuchAlgorithmException e) {
            }catch(Exception e) {e.printStackTrace();System.out.println("MAIN EXCEPTION ");}I have 2 problems here.
    The public and the private key arrays that are generated are of length 298 and 296 (keeps changing) . I want to set the size of these values to be 128 bytes How can i Do that ?
    Do we need to provide the value of vendor public key at
    X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(pub); !!!
    Thanks
    Sandesh

    The public and the private key arrays that are generated are of length 298 and 296 (keeps changing) . I want to set the size of these values to be 128 bytes How can i Do that ?
    I think, you can't. Using 1024 as "the size in bits of the random exponent (private value)" means that the encoding contains some additional bits of overhead plus the bits of p and g (or something like that). You'd have to use much shorted exponent in order to fit into 128 bytes. I wouldn't do it.
    Do we need to provide the value of vendor public key at X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(pub); !!!
    Is it a question? I don't understand.
    Btw., you should NEVER swallow exceptions.

  • Is Flex right for me and my project? Developers sought

    Sorry for the long post. I want to know if Flex/Apollo would
    be a good platform for the following project.
    There's also a question of how to store the data, but it will
    almost certainly be XML.
    Briefly, here are the questions, with more background to make
    sense of
    them below. I think it's an interesting project and we're
    looking for contributors!
    1. What's a good way to store about 20,000 texts that are
    highly
    hyperlinked and so that on would have a high degree of
    flexibility in
    how to display within both desktop and web-based
    applications?
    2. What's a good platform for developing an application to
    display
    the texts (usually several at once) in a flexible manner that
    would also
    a) be easy to finddevelopers who can work in the platform
    b) be as OS independent as possible
    c)enable one to utilize as many already existing modules as
    possible, to speed development
    d) be easily able to construct a web interface to interface
    with the same text database.
    e) have the ability to release code with some kind of open
    source license.
    The application I want to build is as follows:
    So about two weeks ago I got very annoyed that there is no
    freely
    available Judaic text database (e.g. Bar Ilan/DBS Master
    Library/Judaic Classics Library) type program available (the
    commercial packages range from $80-$600).
    There are of course some very good websites that
    have a good amount of material easily and freely accessible,
    but it's
    largely spread out and the interfaces are pretty weak. The
    same
    applies to the commercial packages, the interface is quite
    utilitarian, and doesn't seem to have evolved since the
    mid-90s.
    I stumbled across the website www.hebrewbooks.org which has
    scanned
    11,000 books, and OCRd about 10,000 to varying degrees of
    accuracy.
    They are also more than happy to share their information
    freely. I
    spoke with the head of the site, and he was into the idea.
    Two things need to happen simultaneously. One being that the
    texts
    need to be prepared, which is a huge task in and of itself.
    The most
    important thing is to create the appropriate hyperlinks. In
    most
    cases, there is a central text (CT), say the Torah, with
    commentaries
    moving linearly along the CT and commenting on phrases as
    they appear
    in the CT. Each comment is called a Dibur HaMatchil (DH). Of
    course,
    within each DH, there might be references to other parts of
    the CT, or
    to virtually any other text. This really is like a normal
    hyperlink.
    This structure is pretty constant throughout the Jewish
    library, its
    found in the Torah, Mishnah, Talmud, Midrash, Shulchan Aruch,
    etc.
    Each of these CTs however, have different organizational
    systems. The
    Torah has Books, Parshas, as well as the Chapter/Verse
    system. The
    mishna has Tractates divided into Chapters, divided into
    Mishnayot.
    The Talmud has Tractates which are usually referenced
    according to
    Page and Side of the page (printing is standard enough to
    allow for
    this). Shulchan Aruch has 4 sections, which contain Simanim,
    and
    S'eefim. Sometimes, there are multiple CTs following the same
    pattern
    and discussing the same topic, so in essence, one CT becomes
    a
    commentary on another CT.
    There are of course many books which are not necessarily
    commentaries
    on any specific text (i.e. not structured according to DHs),
    but say
    philosophical works which will quote from all over the place.
    Even though we won't be trying to organize it all at once, we
    need to
    create a good data structure from the get go that allows for
    all of
    these connections to be made, that is easily searchable
    (shouldn't be
    a problem), and easily browsable (also not a big deal).
    As for what needs to be done with this data...
    I really see the killer app, what nobody else has done yet
    to my
    knowledge, as being able to select a CT, and choose which
    commentaries
    you would like to see on it, and then having a 'book'
    autogenerated on
    the fly, layed out according to pre-defined templates or
    user-defined
    rules (to a certain degree). With books now, any given
    edition you
    choose always has either too few, too many, or not quite the
    right
    combination of commentaries. I see this really becoming
    awesome in
    the next few years as e-paper/e-book readers become
    (hopefully) cheap
    and ubiquitous.
    Ideally, there should be a tagging engine, so that each book
    can come
    with some pre-defined tags, allow the user to add their own
    tags (and
    share them back with the community), auto-generate keywords
    (maybe
    distinct from tags?) for a given text and then have search
    and browse
    features that leverage those tags. So if you want to see all
    13th
    century books from France and Germany dealing with personal
    injury
    law, it'll be a snap to find them. Or to conduct a free text
    search
    through any subset of the library you want.
    Also, I'd love to see tag clouds and information mapping a la
    www.quintura.com
    www.kartoo.com
    www.kartoo.net (no search here, just nice graphics)
    www.ujiko.com
    This would make it much easier to explore new sources of
    information.
    All current programs essentially require you to know exactly
    what
    you're looking for before you start. If you don't have the
    right
    phrase, you'll never find what you need, and there's no easy
    way to
    discover it.
    And of course, there have to be tabs which can display either
    an
    autoformatted page, or a pdf of the original book.
    So this is a big project, as you can see, but a good portion
    of the
    work seems to be done to me. On the data side, 10,000 books
    are
    already scanned and OCRd, remaining is the laborious task of
    marking
    them all up. Here, it would hopefully be possible to create
    small
    programs that would enable the masses of people who are very
    familiar
    with the texts, but know no computer-ese to aid in the task.
    I think
    there would be good response for at least the most important
    texts.
    On the UI side, all of the search/database features I
    mentioned above
    I think could be found in various open source repositories,
    with only
    the need to customize the code. The auto-layout stuff also
    seems
    pretty simple from an algorithmic point of view, assuming you
    have
    data that's appropriately marked up. Particularly if we stick
    to
    pre-defined templates. Adding user-defined templates later as
    appropriate.
    I'm probably infinitely naive, as I haven't coded anything
    since
    Pascal. I see a timeline of 1 year to a proof-of-concept type
    application with a limited dataset, and 5 years to realize
    what I've
    described above.
    FYI, in addition to finding good hearted volunteers, there
    are some
    good fundraising leads at the moment that could help things
    considerably.
    Any advice you have is more than welcome. If it's easier over
    the
    phone, then let's talk.
    And if you're interested, we're still looking for just about
    everything including:
    1. Chief Software Architect
    2. Coders
    3. Referring me to people who might be interested
    4. Anything else you want!
    Hope all is well,
    Andy

    Coldfusion 9 (currently in open beta) has AIR SQLite Offline support
    http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSAFE323E5-CA8B-429e-BC1C-450DA839D7 05.html
    http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS2C3A7CC5-9A64-4a34-B66B-A2834C22D5 AE.html
    http://askjayvir.blogspot.com/2009/07/coldfusion-9-air-sqlite-offline-support.html
    Coldfusion 9 beta: http://labs.adobe.com/technologies/coldfusion9/

Maybe you are looking for