The DishList62 XML/XSL Sample

The DishList62 XML/XSL Sample

 

The DishList62 XML/XSL Sample contains the Kitchen62.xsd schema file, three xslt XSL Transforms, the DishList62.xml source file, and various ancillary files that were useful in constructing these main files of the sample.  It was constructed using Word2003, from the Microsoft Office System 2003 product, and the Microsoft Office 2003 Developer Resource download, which adds the XML Toolbox to Word2003, and provides the Microsoft Office Word2003 SDK, and with the Microsoft Office 2003 WordprocessingML Transform Inference Tool.  (Actually, I think there are three downloads, and I don’t really remember which bits came with which download.)  For just examining the sample, you don’t need the extra bits, but you will want the XML Toolbox if you want to create your own Cook Book, and you will want the transform tool, if you want to use some other presentation style than the Garish Towers style that I have constructed.

 

Unzip the SchemaHome.zip file.  Copy the Kitchen62.xsd file to your central schema location.  For people with networks, it can be on a server share, or in a SharePoint doclib.  (It is hell to open an xsd file directly from a SharePoint doclib, but the Word 2003 Schema Library can readily access it from a SharePoint doclib.)  Copy the three xslt Transforms toyour central directory for your transforms.  (I keep mine in the central schema directory, unless I am still developing them.)  Copy the dishlist62.xml file, from the DishList62_Sample directory to a convenient location, like MyDocuments.  Now you open the file by right-clicking it, choose Open With Word, if that is in your selection list, or just the Open With choice that flys out, and choose Word from the dialog box. 

 

Dishlist62.xml opens in Word 2003 as a XML-tagged text, in which all the text is inclosed in the appropriate XML tags.  However, it is using the default data schema, and you need to add the correct schema to the Schema Library.  If you haven’t installed the downloads that give you the XML Toolbox Toolbar, then you have to do this the hard way.  Do the two-fingered salute of Ctrl-F1 to bring up the task pane, and then drop down the task menu and choose XML Structure—see Figure 1.

Figure 1: XML-Structure Pane    

at msmvps.com: http://msmvps.com/obts/gallery/image/491.aspx

See Photo Album at: http://spaces.msn.com/members/Wrinkle/PersonalSpace.aspx?_c01_photoalbum=showdefault&_c=photoalbum 

Figure 2: The XML Schema Tab

at msmvps.com: http://msmvps.com/obts/gallery/image/492.aspx

 Now click the Templates and Add-ins… vector. If your XML Structure actually opens with real content, you will want to click the XLM Options vector on the bottom, and then the XML Schema button at the bottom of the XML Options panel.

 

When you open the XML Schema dialog panel—see Figure 2, the schema that is checked will be shown as unavailable.  You will need to click the Add Schema button, and browse to where you stashed the schema file and select it.  You then get another little panel that asks you to input the URI.  This is something in the file, and showing in the schema selection panel but that is hidden behind the current modal input panel, and you will be very aggravated that you can’t get a copy to paste into the input box.  So here it is: "j:\temp6XML\dishlist62"—don’t include the quotes.

Figure 3: The aggravating Schema Settings Window

at msmvps.com: http://msmvps.com/obts/gallery/image/493.aspx

 

 (I keep a notepad file on my desktop, into which I place these bits and click off to an unused desktop, open the file, and copy them into the Windows Paste Buffer, click back to the desktop holding the Word stuff, and paste it into the modal input dialog.)  The input dialog also has a field for an short alias, which you will see in the Schema Dialog panel, and you will check the box there to use it.  (I use kit62, because the schema is named kitchen62.)

 

Once you have the schema listed in the Schema Library Panel, you select it, the Use solution with control becomes active—see Figure 4.

Figure 4:  The Schema Library showing solutions.

at msmvps.com: http://msmvps.com/obts/gallery/image/494.aspx

 Leave that showing Word, and click the solution button, and browse to where you stashed the three transforms.  Select one, and it will ask you for a short alias—use something like Cook Book, Menu, Tables.  Now, when you OK everything back to the document, it should give you the XML documents panel in the task pane.  If not, close the file and open it again.  You then should have the XML document task pane on the left, see the XML data displayed in whichever of the transforms you set as the default.  You can switch between the three transforms and the data only format.

 

Figure 5:  The open XML document showing views.

at msmvps.com: http://msmvps.com/obts/gallery/image/495.aspx

 

You may download the DishList62 XML/XSL Samples zip-file from the  the following URL:

http://common.mvps.org/obts/DishList62-XML-XSL.zip

Enjoy.  I will be writing up text on how to use Word as an XML input program and how to develop your own XML schema and transforms.  Bait your breath and see what develops.

Published Sun, Jun 19 2005 16:00 by OBTS
Filed under: