A Use-Case Driven Approach to the Development of Reusable Stylesheet Modules Terry Brady LexisNexis.

Slides:



Advertisements
Similar presentations
Copyright 2001, ActiveState. XSLT and Scripting Languages or…XSLT: what is everyone so hot and bothered about?
Advertisements

Inside an XSLT Processor Michael Kay, ICL 19 May 2000.
Tahir Nawaz Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a.
Visual Scripting of XML
XML/EDI Overview West Chester Electronic Commerce Resource Center (ECRC)
1 XSLT – eXtensible Stylesheet Language Transformations Modified Slides from Dr. Sagiv.
XSLT (eXtensible Stylesheet Language Transformation) 1.
Describing Process Specifications and Structured Decisions Systems Analysis and Design, 7e Kendall & Kendall 9 © 2008 Pearson Prentice Hall.
1 XML DTD & XML Schema Monica Farrow G30
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
Programming with Objects: Class Libraries and Reusable Code.
1 Copyright (c) [2000]. Roger L. Costello. All Rights Reserved. Using XSLT and XPath to Transform XML Documents Roger L. Costello XML Technologies.
Declare A DTD File. Declare A DTD Inline File For example, use DTD to restrict the value of an XML document to contain only character data.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Creating Document Type Definitions (DTDs) Ellen Pearlman Eileen Mullin.
Copyright © 2002 ProsoftTraining. All rights reserved. XML Document Design.
Chapter 13 XML Concept of XML Simple Example of XML XML vs. HTML in Syntax XML Structure DTD and CDATA Sections Concept of SAX Processing Download and.
IBM Proof of Technology Discovering the Value of SOA with WebSphere Process Integration © 2005 IBM Corporation SOA on your terms and our expertise WebSphere.
XML Fundementals XML vs.. HTML XML vs.. HTML XML Document (elements vs. attributes) XML Document (elements vs. attributes) XML and RDBMS XML and RDBMS.
XML – Extensible Markup Language Sivakumar Kuttuva & Janusz Zalewski.
SCRAM Software Configuration, Release And Management Background SCRAM has been developed to enable large, geographically dispersed and autonomous groups.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Chapter 12: Adding Functionality to Your Classes.
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Document Type Definition.
National Institute of Standards and Technology 1 Testing and Validating OAGi NDRs Puja Goyal Salifou Sidi Presented to OAGi April 30 th, 2008.
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.
Rational Unified Process Fundamentals Module 4: Disciplines II.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
XML – Tools and Trends Schematron Tim Bornholtz Session 55.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
Copyright OASIS, 2005 / 2007 Slaying the Complexity Monster David Webber Chair OASIS CAM TC Presentation January 24 th, 2007 Reston VA.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
File: 06_RETS_Implementation Issues.PPT 1 RETS Implementation Issues  Business Case  Project Preliminaries  Resource Identification  RETS Service Supplier.
High Level Strategy Dependencies Milestones Roles and Responsibilities Iterative Approach Multiple Legacy / Targets Scope Several different migration methods.
DEV337 Modeling Distributed Enterprise Applications Using UML in Visual Studio.NET David Keogh Program Manager Visual Studio Enterprise Tools.
Finalizing Design Specifications
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
L6-S1 UML Overview 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Applying eXtensible Style Sheets (XSL) Ellen Pearlman Eileen Mullin Programming.
Introduction to Markup David J. Birnbaum University of Pittsburgh Slavic Digital Text Workshop University.
Schematron Tim Bornholtz. Schema languages Many people turn to schema languages when they want to be sure that an XML instance follows certain rules –DTD.
XML Grammar and Parser for WSOL Kruti Patel, Vladimir Tosic, Bernard Pagurek Network Management & Artificial Intelligence Lab Department of Systems & Computer.
Advanced Technical Writing 2006 Session #4. Today in Class… ► Meet with your editorial team, refine/post deliverables ► Send URL for deliverables to Bill.
1 Copyright (c) [2000]. Roger L. Costello. All Rights Reserved. Using XSLT and XPath to Transform XML Documents Roger L. Costello XML Technologies.
Dom and XSLT Dom – document object model DOM – collection of nodes in a tree.
Representing Netconf Data Models using Document Schema Definition Languages (DSDL) Rohan Mahy Sharon Chisholm Lada Lhotka IETF 72 - Dublin.
More XML XPATH, XSLT CS 431 – February 23, 2005 Carl Lagoze – Cornell University.
1 Introduction JAXP. Objectives  XML Parser  Parsing and Parsers  JAXP interfaces  Workshops 2.
University of Nottingham School of Computer Science & Information Technology Introduction to XML 2. XSLT Tim Brailsford.
Using DSDL plus annotations for Netconf (+) data modeling Rohan Mahy draft-mahy-canmod-dsdl-01.
Compilation of XSLT into Dataflow Graphs for Web Service Composition Peter Kelly Paul Coddington Andrew Wendelborn.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
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.
Rendering XML Documents ©NIITeXtensible Markup Language/Lesson 5/Slide 1 of 46 Objectives In this session, you will learn to: * Define rendering * Identify.
DSL implementation for UNICOS-CPC Ivan Prieto Barreiro Jeffrey Goderie BE-ICS.
Product Training Program
Unit 4 Representing Web Data: XML
Data Virtualization Tutorial: Introduction to SQL Script
Displaying Form Validation Info
Chapter 7 Representing Web Data: XML
A clinical collaboration platform
CS 431 – February 28, 2005 Carl Lagoze – Cornell University
More XML XML schema, XPATH, XSLT
Ponder policy toolkit Jovana Balkoski, Rashid Mijumbi
SPL – PS1 Introduction to C++.
Presentation transcript:

A Use-Case Driven Approach to the Development of Reusable Stylesheet Modules Terry Brady LexisNexis

Problem to Solve n Collaborative XSLT Development n Create useful modules that will operate in multiple data conversions n Multiple Input DTD’s n Multiple Output DTD’s n Team does not consist of schema “experts”

Challenge n Xslt containment not as easy as OO containment n Import precedence is trickier than you think! l Construction of the import tree can radically alter the behavior of individual modules n Difficult to validate to multiple targets

XSLT Use n Great for conversions n Requires a shift in mind set n Testing capabilities l Full support not there l Or, so counter-intuitive everyone must solve on their own

XSLT Modularity n xsl:import l Creates import tree l Import precedence overrides other precedence l Great for named templates n xsl:include l Creates a single logical module l Precedence: n match specificity n priority n Position l Challenge with named templates!

Very Contrived Examples n Input DTD’s l article.dtd l instructions.dtd n Output DTD’s l book.dtd l faq.dtd

Article n art:article l (in:title, in:section+) n in:title l (#PCDATA|in:emph|meta:edit-by | meta:edit-date)* n in:section l (in:title?, (in:para+ | in:section+)) n in:para l (#PCDATA | in:emph | meta:edit-by | meta:edit-date)* n in:emph l (#PCDATA | meta:edit-by | meta:edit-date)* n meta:edit-by l (#PCDATA) n meta:edit-date l (#PCDATA)

Instructions n man:manual l (in:title, (in:section+ | man:step+)) n in:title l (#PCDATA|in:emph | meta:edit-by | meta:edit-date)* n in:section l (in:title?, (in:para+ | in:section+ | man:step+))> n man:step l (man:num, in:para+) n in:para l (#PCDATA | in:emph | meta:edit-by | meta:edit-date)* n in:emph l (#PCDATA | meta:edit-by | meta:edit-date)* n meta:edit-by l (#PCDATA) n meta:edit-date l (#PCDATA) n man:num l (#PCDATA)

Book n book:book l (out:label?, out:header, out:section+) n out:header l (#PCDATA|out:italics)* n out:section l (out:label?, out:header?, (out:section | out:para)+) n out:para l (#PCDATA | out:italics)* n out:italics l (#PCDATA) n out:label l (#PCDATA)

Faq n faq:faq l (out:label?, out:header, out:section+) n out:header l (#PCDATA|out:italics)* n out:section l (out:label?, out:header?, out:para+) n out:para l (#PCDATA | out:italics)* n out:italics l (#PCDATA) n out:label l (#PCDATA)

Modules Needed General (default/meta) title paragraph section step makebook makefaq n default rule, warn on unmapped elements n In:title  out:header n in:para & in:emph n in:section  out:section n man:step/man:num n root  book:book n root  faq:faq

Module Imports n makebook.xsl imports section.xsl n makefaq.xsl imports section.xsl n para.xsl imports general.xsl n section.xsl imports para.xsl, title.xsl, step.xsl n step.xsl imports para.xsl n title.xsl imports general.xsl

Create Use Cases n Only as complex as needed to illustrate one case n Validate understanding before coding

Create Contrived Use Cases n Title n Paragraph n Section n Step n Article n Manual

Title Use Case Hello

Title with Metadata Hello Terry 1/1/2006

Create stylesheets n Determine import hierarchy in advance n Call wherever possible to allow the DTD to change n Iteratively test with use cases. n Validate to DTD and schematron as an additional tool.

Import Precedence Issue n in:title processed fine by title.xsl n in:para processed fine by para.xsl n When executing the same files with section.xsl l in:para processed fine l In:title processed by default rule

Introduce “template files” n Construct the import tree as needed for production n Modular components reference a “template file” via a processing instruction l Inclusion of default rule l Inclusive set of namespace declarations l Testing-specific match rules

New import strategy n makebook.xsl imports general.xsl, section.xsl n makefaq.xsl imports general.xsl, section.xsl n section.xsl imports para.xsl, title.xsl, step.xsl l References template.xsl via pi n step.xsl imports para.xsl l References template.xsl via pi n template.xsl imports general.xsl

Other Challenges n Validating output of common modules to multiple target DTD’s n Supporting use cases appropriate to a subset of target DTD’s n Viewing results

Unit Test Driver Use Case Files Stylesheets Baseline output Source Code Management Runtime Directory Use Case Files Use Case Files Baseline output Baseline output Schematron, & Template DTD

Copy Resources to runtime area Source Code Management Use Case Files Stylesheets Baseline output Runtime Directory Use Case Files Use Case Files Baseline output Baseline output Use Case Files Stylesheets Baseline output Use Case Files Use Case Files Baseline output Baseline output Schematron, & Template DTD Schematron, & Template DTD

Iterate over use case files Runtime Directory Use Case Files Stylesheets Baseline output Use Case Files Use Case Files Baseline output Baseline output Schematron, & Template DTD

Runtime Directory Use Case Files Stylesheets Baseline output Use Case Files Use Case Files Baseline output Baseline output Use Case File Copy Schematron, & Template DTD This makes it easier to view the input file in a browser that is not catalog aware Copy use case file with fully resolved DTD (if using catalog)

Report the validity of use case file Runtime Directory Use Case Files Stylesheets Baseline output Use Case Files Use Case Files Baseline output Baseline output Schematron, & Template DTD

Find each stylesheet referenced by the use case file… Runtime Directory Use Case Files Stylesheets Baseline output Use Case Files Use Case Files Baseline output Baseline output Schematron, & Template DTD A single use case could serve as input to multiple stylesheets

If the stylesheet references a template, compile a new stylesheet. Runtime Directory Use Case Files Stylesheets Baseline output Use Case Files Use Case Files Baseline output Baseline output Compiled stylesheet Schematron, & Template DTD This is to allow the creation of a custom import tree when testing an individual module

If the stylesheet references a schematron file, compile the schematron and perform semantic validation on the use case file. Runtime Directory Use Case Files Stylesheets Baseline output Use Case Files Use Case Files Baseline output Baseline output Compiled Schematron Compiled stylesheet Schematron, & Template DTD This permits the enforcement of boundary/scope conditions for a styesheet.

For each dtd referenced in the use case file or stylesheet, apply the stylesheet to the use case file. Runtime Directory Use Case Files Stylesheets Baseline output Use Case Files Use Case Files Baseline output Baseline output Output file DTD Schematron, Template, & DTD Compiled stylesheet Set the system identifier of the output file to the referenced DTD. Validate transformation output to all appropriate targets

Report on the validity of the output file. Runtime Directory Use Case Files Stylesheets Baseline output Use Case Files Use Case Files Baseline output Baseline output Output file DTD Schematron, Template, & DTD Compiled stylesheet Set the system identifier of the output file to the referenced DTD.

Apply transformation to use case file without referencing an output DTD. Runtime Directory Use Case Files Stylesheets Baseline output Use Case Files Use Case Files Baseline output Baseline output Output file Schematron, Template, & DTD Compiled stylesheet DTD

If a use case file references a schematron, compile the schematron and perform semantic validation on the output file. Runtime Directory Use Case Files Stylesheets Baseline output Use Case Files Use Case Files Baseline output Baseline output Output file Schematron, Template, & DTD Compiled Schematron

If a baseline file exists that matches the output file, perform a comparison of the two files. Runtime Directory Use Case Files Stylesheets Baseline output Use Case Files Use Case Files Baseline output Baseline output Output file Schematron, Template, & DTD

Generate a summary report of test execution Runtime Directory Use Case Files Stylesheets Baseline output Use Case Files Use Case Files Baseline output Baseline output Schematron, Template, & DTD Summary Report

Summary Report Error Statistics Use case file hierarchy n Tree Structure n Hypertext to resources n Error messages Input FileOutput File Stylesheet, DTD, Schematron

Summary of methodology n System architect defines stylesheet modules n Developer is assigned a module. n Developer creates use case files. n Use cases are reviewed n Developer iteratively creates XSLT module n Stylesheet and output files are reviewed n Output is "baselined“

Benefits n Scope is defined for developer n Developer demonstrates understanding immediately n Use case files serve as communication tool n Architect does not simply state constraints. Constraints are enforced n Regression test is built during development