By continuing to use this site, you agree to the storing of first- and third-party cookies on your device to enhance site navigation; analyze site, product, and service usage; and assist in our marketing and promotional efforts. Cookie Policy

Skip to Content

Intro to XML and XSL

OU Campus uses XML and XSL to build and create pages. XML is a syntax that stores page data and content, while XSL is a transformation language that transforms that data into the published web page.

XMLLink to this section

XML, eXtensible Markup Language, is a widely-used format for storing data as text so it can be later accessed by XSL or other software. Unlike HTML, XML doesn't have a set of predefined tags; it has some very specific syntax requirements, but the overall data structure is entirely up to the developer using it. Invalid XML that doesn't follow correct syntax leads to parsing errors on PCF pages.

Red highlighted text read "A parsing error in the PCF occurred on line 8: The end-tag for element type "headcode" must end with a '>' dilimiter." Underneath is an "OK" button.
An example of a parsing error you might encounter

As such, any HTML brought into OU Campus PCFs must be made XHTML compliant to ensure they follow XML syntax rules and avoid XSL parsing errors. Three common causes of parsing errors are:

  1. Open tags.
    Unlike HTML, all tags in XML must close, either as self-closing tags or full tags.
    • <img /> or <img></img>
    • <br />
    • <hr />
    • <link /> or <link></link>
  2. Boolean attributes without values.
    A boolean attribute can be listed without a value in valid HTML. However, XML requires all attributes to have associated values, so add a value repeating the name of the attribute.
    • async="async"
    • hidden="hidden"
  3. Special characters not encoded.
    XML treats certain special characters in a unique manner. Any instances of those characters which appear in page content need to be encoded appropriately using HTML entities.
    • < &lt;
    • > &gt;
    • & &amp;
    • © &copy;

Watch the following video to learn about the basics of XML from Yves Lempereur, Chief Product Architect of OmniUpdate.

XSLLink to this section

eXtensible Stylesheet Language is a pseudo-programming language originally built to convert XML structures into different XML structures. However, it has evolved to a powerful tool in terms of its output capabilities and functional abilities. It can transform XML into a number of different products, including .html, .aspx, or .php files.

XSL has three main advantages:

  1. Server-side Agnostic
    Due to its decoupled nature, OU Campus supports all server-side languages. XSL can output any textual content including server-side code, thereby supporting many different production server types and configurations, including outputting basic PHP and C# to the source of the page to call that language. Common languages such as PHP and C# can be output easily by default, but XSL can work with just about any server-side language.
  2. Programmatic Logic & Efficiency
    XSL provides similar functionality to a server-side language, handling that work on OU Campus servers and thus minimizing the work needed by the servers hosting the final products. By reducing the load on server-side scripts and outputting static files, users visiting the live site will experience faster load times than a site powered by server-side scripting alone.
  3. Separation of Content from Design
    By storing only the content and settings that are specific to each page in XML (.pcf extension), developers and administrators can modify the global design in a single location (XSL) without the need to individually fix every page.

Watch the following video to learn about developing in XSL, once again presented by Yves Lempereur.

External references on XSL and XML: