SlideShare une entreprise Scribd logo
1  sur  34
OSP Preconference Workshop:OSP Form Schemas and Renderers Janice Smith, Education Consultant, Three Canoes Sean Keesler, Education Consultant, Three Canoes
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 2009 2 10th Sakai Conference - Boston, MA, U.S.A.
Form Design and Use
The XML Technology Stack A little background… July 2009 10th 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 2009 10th 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 2009 10th 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 2009 10th 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/repositoryNode/created July 2009 10th Sakai Conference - Boston, MA, U.S.A. 8
XPATH July 2009 10th Sakai Conference - Boston, MA, U.S.A. 9 Can be an absolute path: /formView/formData/artifact/metaData/repositoryNode/created … refers to: “<created>Thu Jul 02 17:03:00 UTC 2009</created>”
XPATH Can be a relative PATH:	../../displayName July 2009 10th Sakai Conference - Boston, MA, U.S.A. 10 …refers to “<displayName>Test Feedback</displayName>” if used from the “created” element
XPATH Can include conditions in “predicates”//element[@name=‘value’]/ …refers to all “element” node sets that have their “name” attribute set to “value” July 2009 10th Sakai Conference - Boston, MA, U.S.A. 11
Finding an XPATH with OxygenXML July 2009 10th 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 <displayName> 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 2009 10th 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 15
XSD  Example One way to represent the “Value” field                <xs:element name="value">                     <xs:simpleType>                         <xs:restriction base="xs:integer">                             <xs:minInclusive value="0"/>                             <xs:maxInclusive value="3”/>                         </xs:restriction>                     </xs:simpleType>                 </xs:element> July 2009 10th 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 17
XSD in OSP Examples This XSD snippet: <xs:element name="value" minOccurs="0"> <xs:annotation>   <xs:documentation source="ospi.label">Evaluation    </xs:documentation> </xs:annotation> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="3"></xs:enumeration> <xs:enumeration value="2"></xs:enumeration> <xs:enumeration value="1"></xs:enumeration> <xs:enumeration value="0"></xs:enumeration> </xs:restriction> </xs:simpleType> </xs:element> July 2009 10th 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 19
Questions about: XML XSD XPATH July 2009 10th Sakai Conference - Boston, MA, U.S.A. 20
Form RenderINGLogic
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 2009 10th 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 2009 10th 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 2009 10th 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 2009 10th 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 2009 10th 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 33
Questions about: OxygenXML XSL Form rendering process Form renderers July 2009 10th Sakai Conference - Boston, MA, U.S.A. 34

Contenu connexe

Tendances (20)

Extensible Stylesheet Language
Extensible Stylesheet LanguageExtensible Stylesheet Language
Extensible Stylesheet Language
 
C5 Javascript
C5 JavascriptC5 Javascript
C5 Javascript
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Php ch-2_html_forms_and_server_side_scripting
Php ch-2_html_forms_and_server_side_scriptingPhp ch-2_html_forms_and_server_side_scripting
Php ch-2_html_forms_and_server_side_scripting
 
SessionTen_CaseStudies
SessionTen_CaseStudiesSessionTen_CaseStudies
SessionTen_CaseStudies
 
Xml
XmlXml
Xml
 
Xml
XmlXml
Xml
 
Project Report on HTML
Project Report on HTMLProject Report on HTML
Project Report on HTML
 
XML
XMLXML
XML
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Editing XML data with XForms
Editing XML data with XFormsEditing XML data with XForms
Editing XML data with XForms
 
Session 1
Session 1Session 1
Session 1
 
XML
XMLXML
XML
 
03 HTML #burningkeyboards
03 HTML #burningkeyboards03 HTML #burningkeyboards
03 HTML #burningkeyboards
 
Session 2
Session 2Session 2
Session 2
 
Xml
XmlXml
Xml
 
Fergus Fahey - DRI/ARA(I) Training: Introduction to EAD - Introduction to XML
Fergus Fahey - DRI/ARA(I) Training: Introduction to EAD - Introduction to XMLFergus Fahey - DRI/ARA(I) Training: Introduction to EAD - Introduction to XML
Fergus Fahey - DRI/ARA(I) Training: Introduction to EAD - Introduction to XML
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
Docbook
DocbookDocbook
Docbook
 

Similaire à Sakai09 Osp Preconference Afternoon Forms

Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4Stephan Schmidt
 
Transforming Xml Data Into Html
Transforming Xml Data Into HtmlTransforming Xml Data Into Html
Transforming Xml Data Into HtmlKarthikeyan Mkr
 
5 xsl (formatting xml documents)
5   xsl (formatting xml documents)5   xsl (formatting xml documents)
5 xsl (formatting xml documents)gauravashq
 
XML and Web Services with PHP5 and PEAR
XML and Web Services with PHP5 and PEARXML and Web Services with PHP5 and PEAR
XML and Web Services with PHP5 and PEARStephan Schmidt
 
Week 12 xml and xsl
Week 12 xml and xslWeek 12 xml and xsl
Week 12 xml and xslhapy
 
Xslt by asfak mahamud
Xslt by asfak mahamudXslt by asfak mahamud
Xslt by asfak mahamudAsfak Mahamud
 
Sakai09 Osp Preconference Afternoon Templates
Sakai09 Osp Preconference Afternoon TemplatesSakai09 Osp Preconference Afternoon Templates
Sakai09 Osp Preconference Afternoon TemplatesSean Keesler
 
Rendering XML Document
Rendering XML DocumentRendering XML Document
Rendering XML Documentyht4ever
 
3 xml namespaces and xml schema
3   xml namespaces and xml schema3   xml namespaces and xml schema
3 xml namespaces and xml schemagauravashq
 
crystal xcelsius and web services by dashboardcafe.com
crystal xcelsius and web services by dashboardcafe.comcrystal xcelsius and web services by dashboardcafe.com
crystal xcelsius and web services by dashboardcafe.comSigit Yunanto
 
Xml For Dummies Chapter 10 Building A Custom Xml Schema it-slideshares.blog...
Xml For Dummies   Chapter 10 Building A Custom Xml Schema it-slideshares.blog...Xml For Dummies   Chapter 10 Building A Custom Xml Schema it-slideshares.blog...
Xml For Dummies Chapter 10 Building A Custom Xml Schema it-slideshares.blog...phanleson
 
XML Transformations With PHP
XML Transformations With PHPXML Transformations With PHP
XML Transformations With PHPStephan Schmidt
 
XML Schema
XML SchemaXML Schema
XML Schemayht4ever
 
Rendering XML Documents
Rendering XML DocumentsRendering XML Documents
Rendering XML Documentsyht4ever
 

Similaire à Sakai09 Osp Preconference Afternoon Forms (20)

Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4Inroduction to XSLT with PHP4
Inroduction to XSLT with PHP4
 
Xml Schema
Xml SchemaXml Schema
Xml Schema
 
Transforming Xml Data Into Html
Transforming Xml Data Into HtmlTransforming Xml Data Into Html
Transforming Xml Data Into Html
 
5 xsl (formatting xml documents)
5   xsl (formatting xml documents)5   xsl (formatting xml documents)
5 xsl (formatting xml documents)
 
XML and Web Services with PHP5 and PEAR
XML and Web Services with PHP5 and PEARXML and Web Services with PHP5 and PEAR
XML and Web Services with PHP5 and PEAR
 
Week 12 xml and xsl
Week 12 xml and xslWeek 12 xml and xsl
Week 12 xml and xsl
 
Xslt by asfak mahamud
Xslt by asfak mahamudXslt by asfak mahamud
Xslt by asfak mahamud
 
Sakai09 Osp Preconference Afternoon Templates
Sakai09 Osp Preconference Afternoon TemplatesSakai09 Osp Preconference Afternoon Templates
Sakai09 Osp Preconference Afternoon Templates
 
Rendering XML Document
Rendering XML DocumentRendering XML Document
Rendering XML Document
 
3 xml namespaces and xml schema
3   xml namespaces and xml schema3   xml namespaces and xml schema
3 xml namespaces and xml schema
 
Processing XML with Java
Processing XML with JavaProcessing XML with Java
Processing XML with Java
 
Xml
XmlXml
Xml
 
crystal xcelsius and web services by dashboardcafe.com
crystal xcelsius and web services by dashboardcafe.comcrystal xcelsius and web services by dashboardcafe.com
crystal xcelsius and web services by dashboardcafe.com
 
Xml For Dummies Chapter 10 Building A Custom Xml Schema it-slideshares.blog...
Xml For Dummies   Chapter 10 Building A Custom Xml Schema it-slideshares.blog...Xml For Dummies   Chapter 10 Building A Custom Xml Schema it-slideshares.blog...
Xml For Dummies Chapter 10 Building A Custom Xml Schema it-slideshares.blog...
 
XSD
XSDXSD
XSD
 
2310 b 12
2310 b 122310 b 12
2310 b 12
 
XML Transformations With PHP
XML Transformations With PHPXML Transformations With PHP
XML Transformations With PHP
 
XML Schema
XML SchemaXML Schema
XML Schema
 
Rendering XML Documents
Rendering XML DocumentsRendering XML Documents
Rendering XML Documents
 
Sax Dom Tutorial
Sax Dom TutorialSax Dom Tutorial
Sax Dom Tutorial
 

Dernier

Digital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfDigital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfJos Voskuil
 
Marketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent ChirchirMarketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent Chirchirictsugar
 
Darshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdfDarshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdfShashank Mehta
 
Financial-Statement-Analysis-of-Coca-cola-Company.pptx
Financial-Statement-Analysis-of-Coca-cola-Company.pptxFinancial-Statement-Analysis-of-Coca-cola-Company.pptx
Financial-Statement-Analysis-of-Coca-cola-Company.pptxsaniyaimamuddin
 
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckPitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckHajeJanKamps
 
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCRashishs7044
 
Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Peter Ward
 
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCRashishs7044
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Pereraictsugar
 
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdfNewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdfKhaled Al Awadi
 
Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Anamaria Contreras
 
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!Doge Mining Website
 
Investment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy CheruiyotInvestment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy Cheruiyotictsugar
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMintel Group
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03DallasHaselhorst
 
Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Seta Wicaksana
 
Organizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessOrganizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessSeta Wicaksana
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCRashishs7044
 
Annual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesAnnual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesKeppelCorporation
 

Dernier (20)

Digital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdfDigital Transformation in the PLM domain - distrib.pdf
Digital Transformation in the PLM domain - distrib.pdf
 
Japan IT Week 2024 Brochure by 47Billion (English)
Japan IT Week 2024 Brochure by 47Billion (English)Japan IT Week 2024 Brochure by 47Billion (English)
Japan IT Week 2024 Brochure by 47Billion (English)
 
Marketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent ChirchirMarketplace and Quality Assurance Presentation - Vincent Chirchir
Marketplace and Quality Assurance Presentation - Vincent Chirchir
 
Darshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdfDarshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdf
 
Financial-Statement-Analysis-of-Coca-cola-Company.pptx
Financial-Statement-Analysis-of-Coca-cola-Company.pptxFinancial-Statement-Analysis-of-Coca-cola-Company.pptx
Financial-Statement-Analysis-of-Coca-cola-Company.pptx
 
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckPitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
 
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
8447779800, Low rate Call girls in Kotla Mubarakpur Delhi NCR
 
Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...Fordham -How effective decision-making is within the IT department - Analysis...
Fordham -How effective decision-making is within the IT department - Analysis...
 
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Perera
 
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdfNewBase  19 April  2024  Energy News issue - 1717 by Khaled Al Awadi.pdf
NewBase 19 April 2024 Energy News issue - 1717 by Khaled Al Awadi.pdf
 
Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.Traction part 2 - EOS Model JAX Bridges.
Traction part 2 - EOS Model JAX Bridges.
 
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
Unlocking the Future: Explore Web 3.0 Workshop to Start Earning Today!
 
Investment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy CheruiyotInvestment in The Coconut Industry by Nancy Cheruiyot
Investment in The Coconut Industry by Nancy Cheruiyot
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 Edition
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03
 
Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...
 
Organizational Structure Running A Successful Business
Organizational Structure Running A Successful BusinessOrganizational Structure Running A Successful Business
Organizational Structure Running A Successful Business
 
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
8447779800, Low rate Call girls in Uttam Nagar Delhi NCR
 
Annual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesAnnual General Meeting Presentation Slides
Annual General Meeting Presentation Slides
 

Sakai09 Osp Preconference Afternoon Forms

  • 1. OSP Preconference Workshop:OSP Form Schemas and Renderers Janice Smith, Education Consultant, Three Canoes Sean Keesler, Education Consultant, Three Canoes
  • 2. 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 2009 2 10th Sakai Conference - Boston, MA, U.S.A.
  • 4. The XML Technology Stack A little background… July 2009 10th Sakai Conference - Boston, MA, U.S.A. 4
  • 5. 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 5
  • 6. 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 6
  • 7. 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 7
  • 8. 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/repositoryNode/created July 2009 10th Sakai Conference - Boston, MA, U.S.A. 8
  • 9. XPATH July 2009 10th Sakai Conference - Boston, MA, U.S.A. 9 Can be an absolute path: /formView/formData/artifact/metaData/repositoryNode/created … refers to: “<created>Thu Jul 02 17:03:00 UTC 2009</created>”
  • 10. XPATH Can be a relative PATH: ../../displayName July 2009 10th Sakai Conference - Boston, MA, U.S.A. 10 …refers to “<displayName>Test Feedback</displayName>” if used from the “created” element
  • 11. XPATH Can include conditions in “predicates”//element[@name=‘value’]/ …refers to all “element” node sets that have their “name” attribute set to “value” July 2009 10th Sakai Conference - Boston, MA, U.S.A. 11
  • 12. Finding an XPATH with OxygenXML July 2009 10th Sakai Conference - Boston, MA, U.S.A. 12 XPATH expressions can be generated and tested by using the XPATH functionality in Oxygen
  • 13. XPATH You do it! Find the XPATH to the <displayName> 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 13
  • 14. 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
  • 15. 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 15
  • 16. XSD Example One way to represent the “Value” field <xs:element name="value"> <xs:simpleType> <xs:restriction base="xs:integer"> <xs:minInclusive value="0"/> <xs:maxInclusive value="3”/> </xs:restriction> </xs:simpleType> </xs:element> July 2009 10th Sakai Conference - Boston, MA, U.S.A. 16
  • 17. 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 17
  • 18. XSD in OSP Examples This XSD snippet: <xs:element name="value" minOccurs="0"> <xs:annotation> <xs:documentation source="ospi.label">Evaluation </xs:documentation> </xs:annotation> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="3"></xs:enumeration> <xs:enumeration value="2"></xs:enumeration> <xs:enumeration value="1"></xs:enumeration> <xs:enumeration value="0"></xs:enumeration> </xs:restriction> </xs:simpleType> </xs:element> July 2009 10th Sakai Conference - Boston, MA, U.S.A. 18 Produces this HTML form field:
  • 19. 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 19
  • 20. Questions about: XML XSD XPATH July 2009 10th Sakai Conference - Boston, MA, U.S.A. 20
  • 22. 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
  • 23. 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
  • 24. 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 24
  • 25. 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.
  • 26. 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
  • 27. “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
  • 28. 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
  • 29. 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 29
  • 30. 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 30
  • 31. 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 31
  • 32. 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 32
  • 33. 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 2009 10th Sakai Conference - Boston, MA, U.S.A. 33
  • 34. Questions about: OxygenXML XSL Form rendering process Form renderers July 2009 10th Sakai Conference - Boston, MA, U.S.A. 34

Notes de l'éditeur

  1. Explore a form Data XML document