XML, XSL, and VeroStyle

 

VeroTrace uses XML data and XSL stylesheets rendered as HTML, so that viewing requirements and life cycle traceability information is as simple as browsing a web page.  VeroStyle uses the same XML data and Verocel’s own document stylesheets to automatically generate (render) certification and traceability documents.

 

This page provides a rudimentary explanation of the relationship between XML, XSL, and HTML and a description of how VeroStyle operates in a similar way.

 

XML, XSL, and HTML

 

XML (eXtensible Markup Language) files can be rendered as HTML with the use of an XSL (XML Stylesheet Language) stylesheet.  An XML/XSL capable browser renders an XML/XSL file pair as HTML in order to display the formatted information in its window.  XML/XSL capable browsers have engines in them that perform the rendering.  The resulting rendered HTML is then displayed by the browser.

 

Here is a trivial example of an XML file, an XSL stylesheet, and the resulting HTML.

 

person.xml

 

<?xml-stylesheet type="text/xsl" href="person.xsl"?>

<person>

  <surname>Romanski</surname>

  <givenName>George</givenName>

</person>

 

The first line of the XML file is the Processing Instruction (PI).  This simple form defines the name and location of the stylesheet file to be used with the XML file.  “person” is the name of the top (or outermost) level element, which is defined by the start tag “<person>” and the end tag “</person>”.  There are also two nested elements called “surname” and “givenName”. 

 

For additional information about XML, please see: http://www.w3.org/TR/REC-xml.

 

 

person.xsl

 

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:template match="/">

      <html>

            <head>

            <title>Personal Data</title>

            </head>

            <body>

                  Name:<br/>

                  First Name: <b><xsl:value-of

                                  select="person/givenName"/>

                              </b><br/>

                  Last  Name: <font color="Red"><b>

                                 <xsl:value-of select="person/surname"/>

                              </b></font>

            </body>

      </html>

  </xsl:template>

</xsl:stylesheet>

 

Embedded within this stylesheet are HTML tags and XSL stylesheet elements.  The “xsl:value-of” stylesheet element is one means of extracting a value from an XML element.  When processed by the rendering engine, the stylesheet element “<xsl:value-of select="person/givenName"/>” is replaced by its value “George”.  HTML tags within this stylesheet will cause the value of the “givenName” element to be rendered as boldface and the “surname” element to be rendered as boldface red.

 

For additional information about XSL, please see: http://www.w3.org/TR/xsl/

 

 

person.html

 

<html>

<head>

<META http-equiv="Content-Type" content="text/html; charset=UTF-16">

<title>Personal Data</title>

</head>

<body>

  Name:<br>

  First Name: <b>George</b><br>

  Last  Name: <font color="Red"><b>Romanski</b></font>

</body>

</html>

 

Above is the resulting HTML as rendered by the Microsoft Internet Explorer 6.0 msxsl 3.0 engine.

 

This is what the output looks like:

 

Name:
First Name: George
Last Name: Romanski

 

This was an example of XML/XSL at its most basic.  XML/XSL is an extremely powerful means for displaying information.

 

 

XML and VeroStyle

 

VeroStyle can take the same XML file as input and, with the help of a document stylesheet, render a document containing formatted XML information.  Here are a couple of document stylesheets:

 

person-ss.txt

 

Name:

First Name: {<givenName>}

Last  Name: {<surname>}

 

person-ss.doc

 

Name:

First Name:

{<givenName>}

Last  Name:

{<surname>}

 

 

Here are the results of running VeroStyle over person.xml using these two document stylesheets:

 

person.txt

 

Name:

First Name: George

Last  Name: Romanski

 

person.doc

 

Name:

First Name:

George

Last  Name:

Romanski

 

 

VeroStyle acts as an XML/document-stylesheet rendering engine in much the same way as the XML/XSL rendering engine in Microsoft IE 6.0.

 

Click here for more information about VeroStyle and how it is used by VeroTrace.