html to xml/xsl:

39
HTML to XML/XSL: Lessons Learned Jay Knape Senior Manager of Web Content Services University Information & Technology Services Columbus State University

Upload: knapejay

Post on 21-May-2015

2.171 views

Category:

Education


0 download

DESCRIPTION

edu Web 2011 Conference presentation

TRANSCRIPT

Page 1: HTML to XML/XSL:

HTML to XML/XSL: Lessons Learned

Jay KnapeSenior Manager of Web Content Services

University Information & Technology ServicesColumbus State University

Page 2: HTML to XML/XSL:

Topics:

• Introduction• Definitions• Migration• Future Plans• Lessons Learned• Q & A

Page 3: HTML to XML/XSL:

Introduction

Page 4: HTML to XML/XSL:

University

• Columbus State University• Columbus, Georgia • 100 miles southeast of Atlanta• 8,298 students (fall 2010)• 72 undergrad and 52 grad degrees• 4 colleges

Page 5: HTML to XML/XSL:

Web Team

• Report to CIO• 4 Full-time Staff• 3 Part-time Student Assistants

Page 6: HTML to XML/XSL:

Definition

Page 7: HTML to XML/XSL:

XML is

• eXtensible Markup Language.• XML is designed to transport and store

data.

Page 8: HTML to XML/XSL:

Benefits of XML

• Separates Data from Layout/Design• Simplifies Data Sharing• Simplifies Data Transport• Simplifies Platform Changes• Makes Your Data More Available for

Repurposing

Page 9: HTML to XML/XSL:

XML Format

<?xml version="1.0" encoding="ISO-8859-1"?>

<bookstore>    <book category="WEB">    <title lang="en">Learning XML</title>    <author>Erik T. Ray</author>    <year>2003</year>    <price>39.95</price>  </book></bookstore>

Page 10: HTML to XML/XSL:

<?xml version="1.0" encoding="ISO-8859-1"?>

<csu>

<!-- ACCT 2101 Principles of Accounting 1 (3-0-3) -->

<ACCT>

<scbcrse_subj_code>ACCT</scbcrse_subj_code>

<scbcrse_subj_name>Accounting</scbcrse_subj_name>

<scbcrse_crse_numb>2101</scbcrse_crse_numb>

<scbcrse_lec_hr_low>3</scbcrse_lec_hr_low>

<scbcrse_lab_hr_low>0</scbcrse_lab_hr_low>

<scbcrse_credit_hr_low>3</scbcrse_credit_hr_low>

<scrsyln_long_course_title>Principles of Accounting 1 </scrsyln_long_course_title>

<scbdesc_text_narrative>

A study of the underlying theory and application of financial accounting concepts. It introduces accounting as a decision making tool. Financial accounting principles, methods, and procedures, including assets, liabilities, equity, and financial statements are examined. (Course fee required.)

</scbdesc_text_narrative>

</ACCT>

</csu>

Page 11: HTML to XML/XSL:

XML is like:

Page 12: HTML to XML/XSL:

Syntax Rules

• All XML Elements Must Have a Closing Tag

• XML Tags are Case Sensitive• XML Elements Must be Properly Nested• XML Documents Must Have a Root

Element• XML Attribute Values Must be Quoted

Page 13: HTML to XML/XSL:

Syntax Rules

• Entity References

• Comments in XML<!-- This is a comment -->

&lt; < less than

&gt; > greater than

&amp; & ampersand 

&apos; ‘ apostrophe

&quot; “ quotation mark

Page 14: HTML to XML/XSL:

XSL is

• eXtensible Stylesheet Language • Components:

– XSL-FO– XSLT– XPath

Page 15: HTML to XML/XSL:

XSL-FO is

• eXtensible Stylesheet Language Formatting Objects

• language for formatting XML data for output to screen, print or other media

Page 16: HTML to XML/XSL:

XPath is

• a language for finding information in an XML document

• a syntax for defining parts of an XML document

• uses path expressions to navigate in XML documents

• contains a library of standard functions• a major component of XSLT

Page 17: HTML to XML/XSL:

XSLT is

• eXtensible Stylesheet Language Transformations

• a way to transform an XML document into HTML

• far more sophisticated than CSS

Page 18: HTML to XML/XSL:

XSLT is

Page 19: HTML to XML/XSL:

XSLT 2.0

XSLT 2.0

XSLT 1.0

Velocity

EXSLT

Page 20: HTML to XML/XSL:

Template-Based Publishing

XSLXSLT

2.0

Page

Page

XSLPage

Page 22: HTML to XML/XSL:

Migration

Page 23: HTML to XML/XSL:

Process

• 2007 – RFP for Web Content Management System

• Selected OmniUpdate OUCampus• 2007 – 2010 – manually migrated sites

into CMS– Table designed HTML pages; CSS; PHP– CSS designed HTML pages; CSS PHP

Page 24: HTML to XML/XSL:

Process

• 2010 – University Branding effort– Changed domain from colstate.edu to

ColumbusState.edu– New Logos– New Web Page designs

Page 25: HTML to XML/XSL:

Page Layouts

Page 26: HTML to XML/XSL:

Templates

Page 27: HTML to XML/XSL:

Site Importing

Page 28: HTML to XML/XSL:

XML Structure

• Let’s take a look at our XML file format

Page 29: HTML to XML/XSL:

<?xml version="1.0" encoding="UTF-8"?>

<?pcf-stylesheet path="/z-omniupdate/xsl/default.xsl" extension="php"?>

<!DOCTYPE document SYSTEM "http://commons.omniupdate.com/dtd/standard.dtd">

<document>

<title></title>

<config>

<pageType></pageType>

<scripts></scripts>

<onLoad></onLoad>

</config>

<metadata>

<meta name="description" content="" />

<meta name="keywords" content="" />

</metadata>

<content>

<rightcontent></rightcontent>

<sidebox_title></sidebox_title>

<LeftInclude></LeftInclude>

<breadcrumb></breadcrumb>

<content></content>

</content>

</document>

Page 30: HTML to XML/XSL:

XSL Structure

• default.xsl • Imports in additional files

– <xsl:import href="plain-w-nobox.xsl" />– <xsl:import href="plain-w-box.xsl" />– <xsl:import href="photos-w-nobox.xsl" />– <xsl:import href="photos-w-box.xsl" />– <xsl:import href="photos-w-redbox.xsl" />

Page 31: HTML to XML/XSL:

Future Plans

Page 32: HTML to XML/XSL:

Plans

• Transformation – With and Without CMS• Opportunity with XML/XSL is unlimited• XML storage for reusable content

– Course Descriptions– Degree Description/Requirements– Faculty Profiles/CV

Page 33: HTML to XML/XSL:

Lessons Learned

Page 34: HTML to XML/XSL:

Lessons Learned

• White-space is Preserved in XML• XML Naming Rules

– Names can contain letters, numbers, and other characters

– Names cannot start with a number or punctuation character

– Names cannot start with the letters xml (or XML, or Xml, etc)

– Names cannot contain spaces– Any name can be used, no words are reserved.

Page 35: HTML to XML/XSL:

Lessons Learned

• Naming Practices– Avoid "-" characters. – Avoid "." characters.– Avoid ":" characters.– Non-English letters like éòá are perfectly legal

• XML elements are Case Sensitive

Page 36: HTML to XML/XSL:

Lesson Learned

• Weak error reporting with vague messages

• No room for small typos and mistakes• Bell shaped learning curve• Invest in training and/or personnel• Database vs XML arguments

Page 37: HTML to XML/XSL:

Q & A

Page 38: HTML to XML/XSL:

HTML to XML/XSL: Lessons Learned

Jay KnapeSenior Manager of Web Content Services

University Information & Technology ServicesColumbus State University

[email protected]

Twitter: @knape_jay

Page 39: HTML to XML/XSL:

References

• http://www.w3schools.com/xml• http://www.w3schools.com/xsl• http://www.w3schools.com/xslt