Altova StyleVision 2024 Enterprise Edition

Creating New SPS via HTML Import

Home Prev Top Next

To create a new SPS file from an HTML document, do the following:

 

1.Select the menu command File | New | New from HTML File.

2.In the Open dialog that pops up, browse for the HTML file you wish to import. Select it and click Open.

3.You will be asked whether relative paths should be converted to absolute paths. Make your choice by clicking either Yes or No.

 

A new SPS document is created. The document is displayed in Design View and is marked up with the predefined HTML formats available in StyleVision (screenshot below).

 

HXOpenHTML

 

Note that the HTML document is displayed within the main template. There is no global template.

 

In the Schema Tree sidebar, a user-defined schema is created (screenshot below) with a root element (document element) called UserRoot.

 

WinSchemaSrcCreateUDSchema2

 

Note that there is no global element in the All Global Elements list.

 

SPS structure and design

The SPS contains a single template—the main template—which is applied to the document node of a temporary internal XML document. This XML document has the structure of the user-defined schema which was created in the Schema Tree window. In Design View, at this point, the HTML document components within the main template are included in the SPS as static components. The representation of these HTML components in Authentic View will be as non-editable, non-XML content. The XSLT stylesheets will contain these HTML components as literal result elements. The schema, at this point, has only the document element Root; consequently, the temporary internal XML document contains only the document element Root with no child node.

 

When you create HTML selections as elements and attributes in the user-defined schema, you can do this in either of two ways:

 

1.By converting the selection to an element or attribute. In the design, the node tags are inserted with a (content) placeholder within the tag. In the schema, an element or attribute is created. In the XML document, the selection is converted to the text content of the schema node which is created in the XML document. The contents of the node created in the XML document will be inserted dynamically into the output obtained via the SPS.

2.By surrounding the selection with an element or attribute. In the design, the selection is surrounded by the node tags; no (content) placeholder is inserted. This means that the selection is present in the SPS design as static content. In the schema, an element or attribute is created. In the XML document, the node is created, but is empty. The static text which is within the schema node tags in the design will be output; no dynamic content will be output for this node unless a (content) placeholder for this node is explicitly inserted in the design.

 

The significance of the (content) placeholder is that it indicates locations in the design where data from the XML document will be displayed (in the output) and can be edited (in Authentic View).

 

© 2017-2023 Altova GmbH