8

Learning:
The Journey of a Lifetime
A Cloud Chamber of the Mind

May 2006 Technology Notebook

Introduction      
Goals
   

Tuesday, May 2 2006 6:00 am

Notes based on the W3C tutorial web pages for XML.


Yesterday, I failed to make any notes as I became sidetracked into playing, unproductively, with my own XML files for a Journal page. Today I will return to the Documentation files and make notes of the important points from Chapter 1.


Chapter 1 Getting Started with Stylus Studio

1.3. Updating an XML Document - Getting Started

    1.3.1 Updating the Text of a Sample Document

    • While editing an XML file in the text tab window, Stylus Studio has an auto-completion feature that will automatically insert additional tags based on the context. For example, if one begins a closing tag, and there is only one possible valid tag to be closed, it will automatically type the name of the tag.
    • If there is a schema already attached to the file, and one begins typing <, Stylus Studio will immediately provide a pop-up list of elements that are valid at that point in the code.
    • Stylus Studio provides a Query feature while in the text tab window. If one types in a path name that corresponds to the XML structure for the current file, a new window will appear on the right that indicates all of the places in the code that matches that path name. If one then clicks on any of these matches in the right window, the cursor will immediately appear at that location in the text window. This looks like a very cool feature for quickly locating appropriate code that one may want to edit. Furthermore, these queries may be saved for future use.

Following are a few comments as I go through the material of chapter 1:

  • I have not used the Query feature before. I am not sure when I would find this useful, but that fact that it is mentioned early in the documentation is a signal that this is an important feature. I will try using it whenever I create an XML data file, just to help feel my around the code.
  • I think that I understand all of the material in this section of chapter 1.

Chapter 1 Getting Started with Stylus Studio

1.3 Updating an XML Document - Getting Started

    1.3.2 Updating the Schema of a Sample Document

    • A schema is the Document Type Definition (DTD) for an XML data file. It provides a detailed description of the nature of the date in each element and may then be used to check a file for validity.

    • The remainder of this section describes procedures that apply when one has an internal schema. However I have created an external schema for my Ausbirds file. In order to edit an external schema, one must first open it in the DTD Editor. I will try this and see if I can then follow the steps of this section.



    • Here is the result:


    It is easy to toggle between the external schema file and the XML data file once one has opened the schema file with the DTD Editor. It is relatively easy to modify both files and verify that the result is still well-formed and valid.

 

  • The idea of checking a data file for validity reminds me of my very early programming days in industry in the late 1960's! The data base software that I have been using the last 20 years does not automatically provide such a feature. I feel like I am going back to the future.

  • Viewing the schema in the DTRD Editor was a bit of a shock. There is a fairly elaborate diagram provided for the schema, but I am not familiar with the various images or their significance. The good news is that by just moving the cursor over the various images, a small alternative text appears indicating that it is an element, is of a complex type or is part of a sequence. Great.

  • I was able to add a new element to the external schema and to the XML data file. Excellent! However there appears to be much about this environment that I am still unsure about. I am able to reason by analogy, but I do not fully understand all of the options when I create a schema.

Chapter 1 Getting Started with Stylus Studio

1.3 Updating an XML Document - Getting Started

    1.3.4. Updating the Tree Representation of a Sample Document

    • It is also possible to modify a text file through the Tree and Grid windows.

  • It is also possible to modify a text file through the Tree and Grid windows. This gives the author a lot of personal freedom on how to best approach making the changes. So far I have followed the description for changing the data file using the text window and explicitly adding the appropriate tags and values. I have also learned how to change the external schema file so that the schema and data still correspond and that the data is considered to be valid.
  • However one can also modify the data file using the Tree or Grid windows. But I must remember to also update the external schema file!
  • The details for using either the Tree or Grid windows are fairly straight-forward. The main difficulty is not with the Stylus Studio interfaces but with a clear understanding of the underlying nature of the options available within XML.
  • The next session will be: 1.4 Working With Stylesheets - Getting Started. 8:15 am