|
|
Learning:
The
Journey of a Lifetime
A
Cloud Chamber of the Mind
January 2006 Technology Notebook |
Introduction |
|
|
|
Goals |
|
|
|
|
|
|
|
Monday, January 09 2006 6:20 am
There are 16 sections to Chapter 1 Getting Started with Stylus Studio. I am going to keep my notes for the first two sections and add to them this morning. I will begin making my notes with Section 3.
Section 1 Starting Stylus Studio
Double-click on the icon to begin the program. |
Section 2 Updating an XML Document - Getting Started
- Opening a Sample XML Document
Use File -> Open to navigate to the appropriate location where the XML file is located and double-click on the file name.
Program Files -> Stylus Studio 2006 XML Professional Edition -> examples -> examples.professional -> quotes -> your-quotes.xml
- Set parameter to display line numbers in the text editor
Select Tools -> Options... -> General -> Editor General
- One can simply type the new code into the file while in Text view. Stylus Studio will display pop-up lists of valid choices whenever it can.
- When an XML document has an internal DTD, one can edit view and edit it in both the Schema tab and the Text tab of the XML editor. The Schema tab works by selecting options from pop-up windows, which is great if one understands the options.
- To create an external schema file for an XML document, open the XML document and click on the Schema tab. Select XML -> Create Schema from XML Content. One obtains a Create Schema or DTD dialog box. Select Generate XML Schema and specify a path name.
- To create an internal DTD specification within the XML file, open the XML document and click on the Schema tab. Select XML -> Generate DTD and click on the Internal radio button.
|
Section 3 Working with Stylesheets - Getting Started
- Stylesheets can generate either HTML files or XML files.
- Stylus Studio creates .xsl files using the XSLT Editor (This is a different editor that the XML Editor.).
- The XSLT Editor works with 4 tabs: XSLT Source, Mapper, Param/Other and WYSIWYG.
- One can easily edit the stylesheet using either the XSLT Source tab or the WYSIWYG tab. The basic idea is to create "templates" that (a) match a specified condition and then (b) give the instructions for displaying the output.
- Note: I have done something to the your-quotes.xsl file and it no longer prints the heading.
- To apply a stylesheet to an XML document in Stylus Studio, you use a scenario. A scenario is a group of customizable settings that allows you to experiment with different source XML documents.
- Subsection 3.4 is about revising an HTML file that displays a page to display all of the records in a data base.
- First import the HTML file into the XSLT Editor. This is a bit tricky as one begins by selecting the Document Wizards option under the File menu. One then clicks on the XSLT Editor tab. Then one selects the XML file. However the result is impressive as Sylus Studio immediately creates a stylesheet file in the XSLT Editor.
- The next step is to create a Stylus Studio Scenario. A Scenario associates a stylesheet (the .xsl file) with the XML data file (the .xml file). Click on the Preview Result icon (small green traingle) and obtain a Scenario Properties window. Give the scenario a name, type in the path name for the XML file and then type in the absolute path name to the folder that will contain the resulting xsl file. The result so far is to display the information for the first data record.
- Double-click the repeating element (e.g. video) in the source tree on the right side of the screen. This will create an empty template. Select all of the code in the xsl file that displays the information for one record. Cut this code and paste it into the template that was just created.
- Go back to the spot where you cut the code and type <x . A completion pop-up window will appear. Scroll down and double-click on xsl:apply-templates, type a space, double-click on select, double-click result, type a /, double-click videos, type a /, double-click video, type "/> . This will select all of the video elements for processing. Click Preview Result icon. You will see a series of displays, one for each record. However each display is the same. I still need to modify the code to pull in the information for each record.
- For each field click once on the display to locate the code in the XSL file. Then delete the data from the code and replace it with <x which will open a pop-up window. Select xsl.apply-templates, type a space, double-click on select, double-click result, type a /, double-click the name of the field, type a /, double-click video, type "/> .
|
I am still frustrated following the instructions as I have somehow altered the xsl file. I'm going to take a quick break and then return to section 3.4 Making a Static Web Page Dynamic by Editing XSLT. 8:15 am
9:00 am Now to try again... It has taken me 30 minutes to get the correct value for the Scenario path name ( C:\Program Files\Stylus Studio 2006 XML Professional Edition\examples\examples.professional\VideoCenter )
I have finally finished this section! 11:00 am
6:15 PM This is just a short exercise in summarizing the implications of my session earlier today.
I should be able to find (or create) a web page using Dreamweaver and save it as an HTML file. I can then use Stylus Studio to read this file using the XSLT Editor to create an XML stylesheet file. One then creates a Scenario that links the stylesheet to an XML file that contains the data.
For example, I already have an XML file of birds seen since I arrived in Australia. I have a basic HTML file from my earlier visit to Australia that should be the basis for the creation of a stylesheet using the XSLT Editor. A good exercise for the near future. 6:25 PM |