Intro to XML and XSL
When a page is published from Modern Campus CMS the product is a flat HTML file. The file extension may vary based upon your production server configuration but the actual source code of that published page is HTML. Inside Modern Campus CMS, a PCF page is an Extensible Markup Language (XML) file of content such as page parameter values and editable region content. The Extensible Stylesheet Language (XSL) file takes the page-specific content and inserts it into the final HTML to provide you a preview within Modern Campus CMS and to build out the final page product at publish.
XMLLink to this section
XML 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 Modern Campus CMS, unique tags appear on PCF pages that begin with <ouc:
. These tags are a part of the ouc
namespace that Modern Campus has defined specifically for Modern Campus CMS.
XML is flexible with tags, but the syntax of the file must follow a set of strict rules in order to be considered valid XML. Invalid XML on a PCF page returns 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.<img />
or<img></img>
<br />
<hr />
<link />
or<link></link>
- 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"
- 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.- <
<
- >
>
- &
&
- ©
©
- <
XSLLink to this section
XSL is the XML transformation instructions. XSL can transform XML into a number of different products. Inside Modern Campus CMS, you may see your PCF files transformed into HTML, PHP, or ASPX using XSL.
Within Modern Campus CMS, multiple XSL files often reference each other. For most implementations, a PCF file references a page-type XSL stylesheet (for example 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 (for example 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 (for example 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 (for example variables.xsl
, galleries.xsl
).
When making changes to XSL in Modern Campus CMS, 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.