How would we map the following xml file listed below into a database table with the following table layout.

 

Table Name = Category

Column = Description (where value is Tow or Spill)

Column = Type (where value is car, Heavy Duty, flatbed or Gasoline, diesel, Oil)

Column = Details (details value)

 

  How do we do this with out creating a mapping for each element (that is get the value Tow or heavy_duty) into the column type?

We do not want to do a transform if possible and we don’t want to have separate tables for each class of Category.

So basically we want the element to be a value in are table like one normally does for attributes

 

 

<quick_data>

      <category>

         <tow>

            <car type="">

               <details>

                  <cdata />

               </details>

            </car>

            <heavy_duty type="">

               <details>

                  <cdata />

               </details>

            </heavy_duty>

            <flatbed type="">

               <details>

                  <cdata />

               </details>

            </flatbed>

            <double type="">

               <details>

                  <cdata />

               </details>

            </double>

         </tow>

        <spill>

            <gasoline type="">

               <details>

                  <cdata />

               </details>

            </gasoline>

            <diesel type="">

               <details>

                  <cdata />

               </details>

            </diesel>

            <oil type="">

               <details>

                  <cdata />

               </details>

            </oil>

        </spill>

Reply via email to