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.
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.
- All tags need to be closed.
Unlike HTML, all tags in XML must close, either as self-closing tags or full tags.
- 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.
- 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.
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.
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 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.
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.