xml spy
Previous  Top  Next

Creating a New SPS


In this section, you will learn:

 

How to create a new SPS document.
How to add a schema source for the SPS.
How to select the XSLT version of the SPS.
How to assign the Working XML File.
How to specify the output encoding.
How to save the SPS document.

 

 

Creating a new SPS document

Create a new SPS document by clicking File | New | New (Empty) or select New (Empty) ic_new in the dropdown list of the New icon ic_newfromschema in the application toolbar. A new document titled SPS1.sps is created and displayed in Design View (screenshot below).

 

TutQS_NewCreate

 

In Design View, an empty main template is displayed. In the Design Overview and Schema Tree sidebars, there are no schema entries.

 

 

Adding a schema source

For this SPS, you will use the schema, QuickStart.xsd. To add this schema as the schema source, do the following:

 

1.In the Design Overview sidebar, under the Sources heading, click the Add New Source command (screenshot above). In the menu that pops up (screenshot below), select Add XML Schema/DTD/XML.

 

SS_SchemaSrcs_AddSchema

 

2.In the Open dialog that pops up browse for the file C:\Documents and Settings\<username>\My Documents\Altova\StyleVision2008\StyleVisionExamples\Tutorial\QuickStart\QuickStart.xsd, and click Open.
3.You will be prompted to select a Working XML File. Select the option to select the file from the filesystem, then browse for the file C:\Documents and Settings\<username>\My Documents\Altova\StyleVision2008\StyleVisionExamples\Tutorial\QuickStart\QuickStart.xml, and click Open. The schema will be added as a schema source in the Design Overview sidebar and in the Schema Tree sidebar (screenshot below). Also, in the Design Overview, the Working XML File you chose will be assigned to the schema.

 

TutQS_AddWorkingXMLQS1a

 

You should note the following points: (i) In Design Overview, the $XML entry for the schema source lists the schema and the Working XML File and Template XML File; (ii) In the Schema Tree sidebar, the Root Elements tree would list the one or more root elements (document elements) you select from among the global elements defined in the schema. In the case of this schema, the element presswatch is selected by default because it is the one global element in the schema that lies clearly at the top of the hierarchy defined in the schema; (iii) All global elements in the schema are listed in the All Global Elements tree.

 

 

Selecting the XSLT version

For this SPS you will use XSLT 2.0. To specify the XSLT version, in the application toolbar, click the ic_xslt_20 icon.

 

 

Assigning or changing the Working XML File

While adding the XML Schema to the SPS in the previous step, you also assigned a Working XML File to the schema. A Working XML File provides the SPS with a source of XML data to process. To assign, change, or unassign a Working XML File for a given schema, in the Design Overview sidebar, right-click anywhere in the Working XML File line you wish to modify (or click the Context Menu icon ic_contextmenu at the right), and select the required command from the context menu that pops up. The Working XML File is now assigned, and the filename is entered in the Design Overview. Before proceeding, ensure that you have correctly assigned the file C:\Documents and Settings\<username>\My Documents\Altova\StyleVision2008\StyleVisionExamples\Tutorial\QuickStart\QuickStart.xml as the Working XML File.

 

 

Specifying the encoding of output

In the Encoding tab of the Options dialog (Tools | Options), set the HTML encoding to Unicode UTF-8, and RTF, PDF, and Word 2007 encoding to UTF-8.

 

 

Saving the SPS document

After you have set up the SPS as described above, save it as MyQuickStart.sps in the C:\Documents and Settings\<username>\My Documents\Altova\StyleVision2008\StyleVisionExamples\Tutorial\QuickStart folder. Do this by clicking the menu command File | Save Design or Ctrl+S, and then entering the file name in the Save Design dialog that pops up.

 

 


Links:

 

 


 

 


Previous  Top  Next

© 2008 Altova