9.2.4.8 Overall Rules Example

The following example uses the XML samples shown earlier with appropriate rules to generate the same resulting operation on the MY.TABLE table.

Dynamic XML Static XML
<transaction id="1234"
    ts="2010-02-05:10:11:21">
  <operation table="MY.TABLE" optype="I">
    <column name="keycol" index="0">
      <aftervalue>
<![CDATA[keyval]]>
      </aftervalue>
    </column>
    <column name="col1" index="1">
      <aftervalue>
         <![CDATA[col1val]]>
      </aftervalue>
    </column>
  </operation>
</transaction>
NewMyTableEntries>
  <NewMyTableEntry>
    <CreateTime>
       2010-02-05:10:11:21
    </CreateTime>
    <KeyCol>keyval</KeyCol>
    <Col1>col1val</Col1>
  </NewMyTableEntry>
</NewMyTableEntries>
Dynamic Static
dyntxrule.match=/Transaction
dyntxrule.timestamp=@ts 
dyntxrule.subrules=dynoprule 
dynoprule.match=./Operation 
dynoprule.schemaandtable=@table
dynoprule.optype=@type 
dynoprule.subrules=dyncolrule
dyncolrule.match=./Column 
dyncolrule.name=@name 
stattxrule.match=/NewMyTableEntries
stattxrule.subrules= statoprule 
statoprule.match=./NewMyTableEntry 
statoprule.schemaandtable="MY.TABLE"
statoprule.optype="I" 
statoprule.timestamp=./CreateTime/text()
statoprule.subrules= statkeycolrule,
statcol1rule
statkeycolrule.match=/KeyCol 
INSERT INTO MY.TABLE (KEYCOL, COL1)
VALUES ('keyval', 'col1val')