Share this Page URL

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

Working with XML Data in Access 577 8. 9. Click the Browse button, and verify that the exported files will be saved in the location you want. Click the OK button. You'll notice that this time, Access produced only a single document: MarketingCampaigns.xml. If you take a look inside, you'll see that the schema information is now contained within the XML document itself. The XSD namespace is declared in the same way as the external XSD, and much of the content of the schema is the same. Now, wherever the XML goes, the structure goes with it. Check Yourself You might want to practice writing an XSD for a new XML document from scratch using the sample XSD as a template. Take an existing XML document, and try to create an XSD for it. Then import just the XML document into Access, and export it with an XSD using the procedures we've covered in this chapter. Compare your hand-tooled XSD with the version Access produced for the same document, and see how close you got! When might you use an XML document that was exported from Access to store data instead of just using Access? Here are some scenarios in which using an XML document in conjunction with Ac- cess might be preferred to using Access alone: · You have a one-time need for a simple Web-based tool that will allow people in your organization to register for a company party. You don't really need the more powerful tools in Access, so an Access database is overkill. You just want to be able to capture the data from a Web page and print the results. In this case, you might use Access to create the data structure and field con- straints, export the table to an XML document, and then use that XML document as the basis for your Web-based tool. · You need to capture student information for a small class you're teaching. The data remains fairly static but is updated once or twice in the course of a semester. Here again, you can use Access to create the structure, export the table to an XML document, and use the output on a simple Web site that can be updated when needed.