Skip to Content

Intro to XML and XSL

When a page is published from OU Campus, the page product is a flat HTML file. Even thought the file extension may vary based upon your production server configuration, the actual source code of that published page is HTML. Inside OU Campus, a PCF page is an XML file of page unique content, such as page parameter values and editable region content. The XSL takes the page-specific content and inserts it into the final HTML to provide you a preview within OU Campus and to build out the final page product at publish.

XMLLink to this section

XML, eXtensible Markup Language, is a data file that stores information and later accesses it using XSL. It differs from HTML in that it does not have a set of predefined tags. Instead, you can define your own tags for your needs. Within OU Campus, unique tags appear on PCF pages that begin with <ouc:. These tags are a part of the ouc namespace that OmniUpdate has defined specifically for OU Campus.

XML is very flexible when it comes to what tags are being used, but the syntax of the file must follow a set of strict rules in order to be considered valid XML. If you have invalid XML included on a PCF page, you get a parsing error.

  1. All tags need to be closed.
    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 must have a value.
    HTML has some attributes which are considered boolean, meaning the attribute can be listed without a value. 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 must be 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.
    • < &lt;
    • > &gt;
    • & &amp;
    • © &copy;

XSLLink to this section

XSL, eXtensible Stylesheet Language, is the XML transformation instructions. XSL can transform XML into a number of different products. Inside OU Campus, you may see your PCF files transformed into HTML, PHP, or ASPX using XSL.

Within OU Campus, multiple XSL files often reference each other. For most implementations, a PCF file references a page-type XSL stylesheet (e.g. interior.xsl, home.xsl, program.xsl). That page-type XSL stylesheet contains XSL templates and code associated with the unique content and HTML structure found on that type of page. To build out the surrounding elements of the page (e.g. header, footer), the page-type XSL stylesheet references a common.xsl stylesheet.

The common.xsl stylesheet builds out the HTML structure of your web pages which are shared across all page types (e.g. header at the top, page content in the middle, footer at the bottom). It references additional XSL stylesheets that are shared across all of your page types (e.g. variables.xsl, galleries.xsl).

When making changes to XSL in OU Campus, you don't need to publish the XSL file. However, always save a version before and after making edits.

External references on XSL and XML:

Once you've mastered the basics, reference our template development guides for full lists of attributes and values.