The included source code, service, and the information is provided as is, and OmniUpdate makes no promises or guarantees about its use or misuse. The source code provided is recommended for all users and may not be compatible with all implementations of OU Campus.
Outputting PCF as JSON with XSL
This repository provides an XSL file containing a list of catch-all template matches for converting a PCF file into JSON.
- Zip up the
- Import into OU Campus root. It is recommended that you do this in an empty sandbox site
- View the
- Toggle the output dropdown option to JSON to view the JSON view.
- Publish the page to see the JSON output of the PCF document.
How to Use in Your Code
- Upload the
xsl-map-templates.xslfile to where your xsl files are stored.
- Modify the template to meet your needs (or use as is).
- Upload the provided
sample-json.xslfile or create a new xsl file similar to the sample file.
- Add a new pcf-stylesheet line in the desired PCF file under your default web output. See example below.
<?xml version="1.0" encoding="UTF-8"?> <?pcf-stylesheet path="/xsl/sample-web.xsl" title="Web Page Output" extension="html"?> <?pcf-stylesheet path="/xsl/sample-json.xsl" title="JSON Output" extension="json" alternate="yes"?>
- Preview and publish.