Structured Text Interchange Format

(Redirected from STIF)
Jump to: navigation, search

The Structured Text Interchange Format (STIF) is a subset of XHTML. It has only those few feature that most structured text formats support.

Q & A[edit]

  • Why STIF? To exchange structured text between different applications
  • Why not XHTML? There are too many elements, making it hard to write transformers from it to other source syntaxes or data models.
  • Why these features? The elements present in STIF map to what users can enter via wiki syntax or BB codes in popular systems.
  • Is STIF extensible? Sure, one can add any XHTML or XML element, but conformant STIF engines are only required to understand the STIF elements.

Related Work[edit]

  • Wiki Creole is the attempt to unify wiki source syntaxes for end-users. STIF unifies the content of structured text pages for easy processing in computers.
  • BB-codes are used in the comment systemts of many blog engines

STIF is a successor of WIF, the wiki interchange format.


The project WikiPipes can crawl wikis as source text or as STIF. Using XSLT, the STIF code is transformat to other target wiki syntaxes.

STIF is also used as the text formatting for CDS Tools.


  • Any UTF-8 string without "<" and ">" is valid STIF.
  • Any UTF-8 string using the defined STIF elements below is valid STIF.
  • Any UTF-8 string using other XML elements is also valid STIF, but STIF processors should/may ignore the extra elements.
  • STIF documents may have XHTML headers.
  • STIF documents may use the STIF elements.
  • Nesting is only allowed according to XHTML rules. I.e. one may not put a <h1> in a <table> without nesting it in <tr> and <td> first.

The STIF elements are:

 headlines:       <h1>, <h2>, <h3>, <h4>, <h5>, <h6>

 block elements:  <p>, <pre>, <hr> 

 lists:           <dl>, <dd>, <dt>, <ol>, <ul>, <li>

 tables:          <table>, <tr>, <th>, <td>

 inline elements: <em>, <strong>, <code>

 images:          <img> with attribute ’src’, 

 links:           <a> with attribute ’href’

   For links within the wiki:
     - attribute 'class' must contain the class 'stif-internal' 
     - attribute 'href'  must be set to the name of the wiki page (no URL)
   For external links:
     - attribute 'class' must contain the class 'stif-external' 
     - attribute 'href'  must be set to an absolute URL

 Extensions under dicusssion for encoding further semant.css:    <span>, <div> both with xml:id attributes

Document-STIF vs. inline-STIF[edit]

By parsing the input

* hello

the resulting document-STIF is


This is ideal to save as a stand-alone file.

The resulting inline-STIF is


which is ideal for embedding in a web page. Note that

 The fox <em>jumps</em> over the fence.

is also valid inline-STIF.


These doctypes are valid for STIF documents:

  • HTML5
  • XHTML 1.0 Strict
  • XHTML 1.0 Transitional
  • HTML 4.01 Strict
  • HTML 4.01 Transitional
  • XHTML 1.1
  • XHTML + RDFa
  • XHTML Basic 1.0
  • XHTML Basic 1.1
  • XHTML 1.1 plus MathML 2.0
  • XHTML 1.1 plus MathML 2.0 plus SVG 1.1

Sample Document[edit]

  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "">
  <html xmlns="">
      <title>  ... a title ...  </title>
  ... innerSTIF content ...

Change Log[edit]


  • added information about internal vs. external links

Removed on 2007-06-05 as many wikis do not support this.

  <sub>, <sup>