Share this Page URL

Chapter 16. Working with XML Data in Acc... > Embedding the XSD in the XML Documen... - Pg. 575

Working with XML Data in Access 575 reject the document by generating an error. It also means that any parser that does not have Office 2003 installed (or, to be more specific, does not have the Office 2003 namespace registered on its computer) would not be able to structure the data using this XSD. You should keep that in mind when you're considering using XML to transport your data. You'll also notice throughout the XSD file, elements have tags that begin with od: . The elements that follow this tag are specific to the Office 2003 namespace and can be interpreted only within that namespace. If you look at the preceding namespace declaration, you'll see a reference to od (which stands for Office document). It might help to look at a specific element. Starting at the top of the file, scan down until you see the following line of code: <od:index index-name="Noun" index-key="Noun " primary="no" unique="yes" clustered="no"/> Because this line begins with od , we know it is an Office 2003-specific tag. The tag is the index tag and defines index properties for the Noun field. Why does this tag need to be defined in the Office 2003 namespace and not the general W3C namespace? Because an index is too specific an ele- ment to be included in a broad namespace. Even if indexes could be generalized enough to be included in the generic namespace, the individual properties of those indexes would vary from ap- plication to application and would make the generic definition of an index not very useful. As you can see in the preceding element, Access indexes have a name and a key. The Office 2003 namespace maps each of these properties to the Access field properties so that when an XML document is exported or imported, no loss of information occurs. (This is sometimes called a lossless transformation; a transformation that doesn't include all the necessary information is referred to as lossy.) Let's look at one more part of the XSD. About halfway down, you'll see the following line of code: <xsd:element name="Greeting" minOccurs="0" od:jetType="text" od:sqlSType="nvarchar">