Implementing Forms and Form Renderers in the Open Source Portfolio David McPherson, Chris Maurer Will Trillich, Janice Smith Materials by Sean Keesler.

Slides:



Advertisements
Similar presentations
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
Advertisements

XML III. Learning Objectives Formatting XML Documents: Overview Using Cascading Style Sheets to format XML documents Using XSL to format XML documents.
Advanced XSLT II. Iteration in XSLT we sometimes wish to apply the same transform to a set of nodes we iterate through a node set the node set is defined.
CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
 2001 Prentice Hall, Inc. All rights reserved. 1.
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
XSLT (eXtensible Stylesheet Language Transformation) 1.
Developing Interfaces and Interactivity for DSpace with Manakin Part 5: Introduction to Manakin’s Theme Tier Eric Luhrs Digital Initiatives Librarian,
XSL XSLT and XPath 11-Apr-17.
HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML
XML and XSL Transforming your XML documents with eXtensible Stylesheet Language Transformations [Optional Lecture]
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
XML Unit 6 October 31. XML, review XML is used to markup data Used to describe information Uses tags like HTML –But all tags are user-defined –Must be.
XSL Concepts Lecture 7. XML Display Options What can XSL Transformations do? generation of constant text suppression of content moving text (e.g., exchanging.
XSL Unit 6 November 2. XSL –eXtensible Stylesheet Language –Basically a stylesheet for XML documents XSL has three parts: –XSLT –XPath –XSL-FO.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
17 Apr 2002 XML Stylesheets Andy Clark. What Is It? Extensible Stylesheet Language (XSL) Language for document transformation – Transformation (XSLT)
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
ECA 228 Internet/Intranet Design I Intro to XSL. ECA 228 Internet/Intranet Design I XSL basics W3C standards for stylesheets – CSS – XSL: Extensible Markup.
Chapter 12 Creating and Using XML Documents HTML5 AND CSS Seventh Edition.
Pemrograman Berbasis WEB XML part 2 -Aurelio Rahmadian- Sumber: w3cschools.com.
Sheet 1XML Technology in E-Commerce 2001Lecture 6 XML Technology in E-Commerce Lecture 6 XPointer, XSLT.
OSP Forms and Presentations in a Nutshell Tom Kuipers Universiteit van Amsterdam Information Technology Centre.
XML – Extensible Markup Language XML eXtensible – add to language. Markup – delimit info using tags. Language – a way to express info.
HTML, XHTML, and CSS Chapter 12 Creating and Using XML Documents.
IS432 Semi-Structured Data Lecture 5: XSLT Dr. Gamal Al-Shorbagy.
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
WORKING WITH XSLT AND XPATH
Extensible Markup and Beyond
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 6 XSLT (Based on Møller and Schwartzbach,
XHTML,XML M.Abdullah Mrian. What is the XHTML Why XHTML ?
 XML is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure,
XML About XML Things to be known Related Technologies XML DOC Structure Exploring XML.
Session 1 SESSION 1 Working with Dreamweaver 8.0.
ECA 228 Internet/Intranet Design I XSLT Example. ECA 228 Internet/Intranet Design I 2 CSS Limitations cannot modify content cannot insert additional text.
JSTL, XML and XSLT An introduction to JSP Standard Tag Library and XML/XSLT transformation for Web layout.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
Extensible Stylesheet Language Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University XSL-FO XSLT.
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Presentation Topic: XML and ASP Presented by Yanzhi Zhang.
Lecture 11 XSL Transformations (part 1: Introduction)
Waqas Anwar Next SlidePrevious Slide. Waqas Anwar Next SlidePrevious Slide XML XML stands for EXtensible Markup Language.
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Applying eXtensible Style Sheets (XSL) Ellen Pearlman Eileen Mullin Programming.
1 Overview of XSL. 2 Outline We will use Roger Costello’s tutorial The purpose of this presentation is  To give a quick overview of XSL  To describe.
CHAPTER 15 WPF Windows Presentation Foundation Dr. John Abraham Professor, UTPA.
XP New Perspectives on XML, 2 nd Edition Tutorial 8 1 TUTORIAL 8 CREATING ELEMENT GROUPS.
Web Technologies Lecture 4 XML and XHTML. XML Extensible Markup Language Set of rules for encoding a document in a format readable – By humans, and –
More XML XPATH, XSLT CS 431 – February 23, 2005 Carl Lagoze – Cornell University.
 XSL – Extensible Style Sheet Language  XSLT – XSL Transformations › Used to transform XML documents to other formats,like HTML or other XML documents.
University of Nottingham School of Computer Science & Information Technology Introduction to XML 2. XSLT Tim Brailsford.
XSLT: How Do We Use It? Nancy Hallberg Nikki Massaro Kauffman.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
Chapter 29. Copyright 2003, Paradigm Publishing Inc. CHAPTER 29 BACKNEXTEND 29-2 LINKS TO OBJECTIVES Attach an XML Schema Attach an XML Schema Load XML.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
XML Extensible Markup Language
XML Schema – XSLT Week 8 Web site:
1 XSL Transformations (XSLT). 2 XSLT XSLT is a language for transforming XML documents into XHTML documents or to other XML documents. XSLT uses XPath.
XSLT, XML Schema, and XPath Matt McClelland. Introduction XML Schema ▫Defines the content and structure of XML data. XSLT ▫Used to transform XML documents.
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
Interstage BPM v11.2 1Copyright © 2010 FUJITSU LIMITED FORMS.
XML Databases Presented By: Pardeep MT15042 Anurag Goel MT15006.
Unit 4 Representing Web Data: XML
Using XML Tools CS551 – Fall 2001.
Chapter 7 Representing Web Data: XML
Unit 6 - XML Transformations
Presentation transcript:

Implementing Forms and Form Renderers in the Open Source Portfolio David McPherson, Chris Maurer Will Trillich, Janice Smith Materials by Sean Keesler

Objectives Understand the XML technology stack (XML, XSD, XSL) Understand the role of XSD and XSL in OSP forms Understand how to manipulate form schema in an XML IDE Be able to capture the stored XML from an OSP form Be able to change a form’s appearance through form schema and XSL renderers July th Sakai Conference - Boston, MA, U.S.A.

Form Design and Use

THE XML TECHNOLOGY STACK A little background… July th Sakai Conference - Boston, MA, U.S.A.4

XML A “Correct” XML document is a text file that is: Well formed Opening and closing tags that do not overlap Optionally validated against a set of rules DTD and XML Schema July th Sakai Conference - Boston, MA, U.S.A.5

Parts of a Form XML document File MetaData File ID and Display Name Created and modified dates Structured Data The form data for each field Schema information Instructions and validation rules CSS information for styling July th Sakai Conference - Boston, MA, U.S.A.6

Explore Form XML in Oxygen IDE You do it! Open “sampleFormXML.xml” Identify the parts of the XML document Identify what fields were filled out Identify the form instructions when this form was completed Use OxygenXML to identify the set of elements in the XML to get the “displayName” of this file July th Sakai Conference - Boston, MA, U.S.A.7

XPATH Expressions that are used by many technologies (including XSLT) to specify one or more parts of an XML document (a node set) that meet a set of conditions Can be an absolute path: /formView/formData/artifact/metaData/repo sitoryNode/created July th Sakai Conference - Boston, MA, U.S.A.8

XPATH July th Sakai Conference - Boston, MA, U.S.A.9 Can be an absolute path: /formView/formData/artifact/metaData/reposit oryNode/created … refers to: “ Thu Jul 02 17:03:00 UTC 2009 ”

XPATH Can be a relative PATH:../../displayName July th Sakai Conference - Boston, MA, U.S.A.10 …refers to “ Test Feedback ” if used from the “created” element

XPATH Can include conditions in “predicates” …refers to all “element” node sets that have their “name” attribute set to “value” July th Sakai Conference - Boston, MA, U.S.A.11

Finding an XPATH with OxygenXML July th Sakai Conference - Boston, MA, U.S.A.12 XPATH expressions can be generated and tested by using the XPATH functionality in Oxygen

XPATH You do it! Find the XPATH to the element of the formView XML Generate an XPATH expression that will refer to the “value” field in the form’s structured data Generate an XPATH expression that will refer to the last date the form data was modified July th Sakai Conference - Boston, MA, U.S.A.13

What is an XML Schema? An XML document Describes other XML data files Structure Data types Data validation rules Provides a means to “validate” another XML document 14

XSD Example Form requirements: 3 fields Evaluation – Numeric value from 0 – 3 “Short” Rich text field – 1200 characters max Rich text field – “no limit” July th Sakai Conference - Boston, MA, U.S.A.15

XSD Example One way to represent the “Value” field July th Sakai Conference - Boston, MA, U.S.A.16

XSD in OSP XSD describes “valid” data AND Provides information to form presentation tool about how to render the HTML form Uses “ospi” extensions Form field labels and descriptive text Use of rich text editor “Subform keys” July th Sakai Conference - Boston, MA, U.S.A.17

XSD in OSP Examples This XSD snippet: Evaluation July th Sakai Conference - Boston, MA, U.S.A.18 Produces this HTML form field:

Explore XSD in OSP You do it! Open “schemaEnumeratedTextValue.xsd” Identify the form elements and validation rules Change the “value” scale to include 5 values Reorder the fields so that the “value” field is last on the form Make the “value” a required field Add a new field that prompts user for an evaluation date of the type “xs:date” Create a new form with this new schema and see the results by “Previewing” the form. July th Sakai Conference - Boston, MA, U.S.A.19

Questions about: XML XSD XPATH July th Sakai Conference - Boston, MA, U.S.A.20

FORM RENDERING LOGIC

An XSL Primer An XML document can be “transformed” into a new XML document by a set of instructions written in XSLT (Extensible Stylesheet Language Transformation) Sakai includesXalanJ - an XSLT processor

A “passthrough” XSL file Instructs the XSL processor to send a copy of the input as its output. Useful because we have no way to see the raw XML “behind the scenes” that we want to transform. Included in handouts as “passthrough.xsl” 23

Passthrough XSL Note the use of the XPATH expression in the match attribute Specifies we are taking a “copy-of” everything below the “root element” July th Sakai Conference - Boston, MA, U.S.A.24

Form Rendering XSL When Sakai renders a form, it assembles an XML document behind the scenes. Form XML is rendered using the default renderers (formCreate.xslt/formFieldTemplate.xslt) or your custom renderers. Use a “passthrough” xsl as a custom renderer to capture the raw form XML Use that as your XML input in an XML IDE to create your own form renderers.

Capture “Raw” form XML You do it! Create a form using the the “practice” schema in your handouts. Upload the passthrough XSL file to resources and use it as a form view renderer for this form. Fill the form out in resources. Click on the form name in resources Capture the form XML (you need to “view source” since it isn’t HTML). Copy and paste it into a new XML document in Oxygen Use Oxygen “Format and Indent” ( ) feature to format the file. Save the file as “formPassthrough.xml” 26

“Import” Rather than “Include” The default formCreate.xslt renderer “includes” the formFieldTemplatestylesheet. If you want fields to be rendered differently than the defaults, import formFieldTemplate.xslt and override form field templates locally. Use “customFormCreate.xslt” from the handouts. 27

Oxygen and XSL Oxygen is shipped with XalanJ “Transformation Scenarios” can be established to transform one XML document with an XSL stylesheet Allows for quicker iterative development than repeatedly uploading your XSL stylesheets into Sakai 28

Configure Transformation Scenario Start with the document you wish to transform Establish a new project scenario Inputs XML URL: ${currentFileURL} (the default) XSL URL: browse to locate your new stylesheet Transformer: Xalan Extensions: add the xslt- façade.jar (in handouts) July th Sakai Conference - Boston, MA, U.S.A.29

Configure a Transformation Scenario Outputs: Save As: “out.html” “Open in Browser” and “Saved File”: if you want to view it in a browser “Open in Editor” to view the XML output July th Sakai Conference - Boston, MA, U.S.A.30

Create a Custom Form Renderer Watch me! Using the “practice” form from earlier Set up a scenario with the raw XML and the “formCustomCreate.xslt” in the handouts Add a prompt for the “shortText” field and view the results of a transformation. Switch the “import” of the formFieldTemplate to import from Sakai rather than your desktop. Upload the file and attach it as your custom renderer for this form. July th Sakai Conference - Boston, MA, U.S.A.31

Create a Custom Form Renderer You do it! Using the “practice” form from earlier Set up a scenario with the raw XML and the “formCustomCreate.xslt” in the handouts Add prompts for the “description” and “value” fields only and view the results of a transformation Change their order and transform it. Add descriptive text somewhere on the form about the meaning of each “value” and transform it. Upload the new renderer and attach it as your custom renderer for this form. July th Sakai Conference - Boston, MA, U.S.A.32

Other Ideas for Renderers Adding your own CSS files to change the look of a form Attachment of custom JavaScript files to change the form behavior Addition of “default” text to form fields Others? July th Sakai Conference - Boston, MA, U.S.A.33

Questions about: OxygenXML XSL Form rendering process Form renderers July th Sakai Conference - Boston, MA, U.S.A.34