Blog Stats
  • Posts - 62
  • Articles - 11
  • Comments - 8
  • Trackbacks - 99

 

Tabular XSD

A sample can save me a thousand words:

<?xml version="2.0" ?>
<Products>
  <row>0012345|Flat Monitor     |21ABCDE| 21|987.65</row>
  <row>0012346|Internet Keyboard|99ABCDF| 32|986.64</row>
  <row>0012347|Laser Printer    |44ABCDG|  5|985.63</row>
  <row>0012348|Wireless Mouse   |11ABCDH|108|984.62</row>
  <!-- repeat 10000 times -->
</Products>

<?xml version="2.0"?>
<schema id="Products" namespace="...">
  <element name="Products" type="xsd:table">
    <complexType>
      <element name="row" type="xsd:tuple" separator="|">
        <complexType>
          <sequence>      
            <element name="ProductId"   type="string"/>      
            <element name="Description" type="string"/>    
            <element name="Model"       type="string"/>    
            <element name="Quantity"    type="integer"/>    
            <element name="UnitPrice"   type="decimal"/>    
          </sequence>  
        </complexType>
      </element>
    </complexType>
  </element>
</schema>
Remember, we are NOT replacing hierarchical structures, we are just extending the power of XML, when needed.
 

Feedback

# XML isn't just CSV ... unless you limit yourself to thinking that way.

Gravatar XML isn't just CSV ... unless you limit yourself to thinking that way. 2/16/2005 5:02 AM | Enjoy Every Sandwich

Post a comment





 

Please add 5 and 2 and type the answer here:

 

 

Copyright © RebelGeekz