ATL Transformation Example

Similar documents
ATL Transformation Example

ATL Transformation Example

ATL Transformation Example

HTML: Parsing Library

HTML: Parsing Library

Structure Bars. Tag Bar

Deccansoft Software Services

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

HTML and CSS COURSE SYLLABUS

HTML Markup for Accessibility You Never Knew About

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

HTML TAG SUMMARY HTML REFERENCE 18 TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES MOST TAGS

HTML. HTML Evolution

c122sep2214.notebook September 22, 2014

Wireframe :: tistory wireframe tistory.

Student, Perfect Midterm Exam March 24, 2006 Exam ID: 3193 CS-081/Vickery Page 1 of 5

Oliver Pott HTML XML. new reference. Markt+Technik Verlag

Index. CSS directive, # (octothorpe), intrapage links, 26

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

Static Webpage Development

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

Chapter 2:- Introduction to XHTML. Compiled By:- Sanjay Patel Assistant Professor, SVBIT.

Table-Based Web Pages

Web Development & Design Foundations with HTML5

Evaluation of alignment methods for HTML parallel text 1

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

Alpha College of Engineering and Technology. Question Bank

The [HTML] Element p. 61 The [HEAD] Element p. 62 The [TITLE] Element p. 63 The [BODY] Element p. 66 HTML Elements p. 66 Core Attributes p.

1/6/ :28 AM Approved New Course (First Version) CS 50A Course Outline as of Fall 2014

XML: Introduction. !important Declaration... 9:11 #FIXED... 7:5 #IMPLIED... 7:5 #REQUIRED... Directive... 9:11

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

Advanced HTML Scripting WebGUI Users Conference

ICT IGCSE Practical Revision Presentation Web Authoring

COPYRIGHTED MATERIAL. Contents. Introduction. Chapter 1: Structuring Documents for the Web 1

CSI 3140 WWW Structures, Techniques and Standards. Markup Languages: XHTML 1.0

Tables & Lists. Organized Data. R. Scott Granneman. Jans Carton

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension

Understanding this structure is pretty straightforward, but nonetheless crucial to working with HTML, CSS, and JavaScript.

ICT IGCSE Practical Revision Presentation Web Authoring

Web Design and Development ACS Chapter 12. Using Tables 11/23/2017 1

Web Programming and Design. MPT Senior Cycle Tutor: Tamara Week 1

MPT Web Design. Week 1: Introduction to HTML and Web Design

Displaying XML Documents

OVERVIEW. How tables are structured. Table headers. Cell spanning (rows and columns) Table captions. Row and column groups

LA TROBE UNIVERSITY SEMESTER ONE EXAMINATION PERIOD CAMPUS AW BE BU MI SH ALLOWABLE MATERIALS

Tutorial 5 Working with Tables and Columns. HTML and CSS 6 TH EDITION

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2018)

Web Site Development with HTML/JavaScrip

WML2.0 TUTORIAL. The XHTML Basic defined by the W3C is a proper subset of XHTML, which is a reformulation of HTML in XML.

Document Object Model. Overview

Chapter 1: Getting Started. You will learn:

Chapter 5. Introduction to XHTML: Part 2

Table Basics. The structure of an table

Part A Short Answer (50 marks)

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

Skill Area 323: Design and Develop Website. Multimedia and Web Design (MWD)

COMS 359: Interactive Media

Certified HTML Designer VS-1027

Programming of web-based systems Introduction to HTML5

ROLE OF WEB BROWSING LAYOUT ENGINE EVALUATION IN DEVELOPMENT

Certified HTML5 Developer VS-1029

Web Development IB PRECISION EXAMS

COMP519: Web Programming Lecture 4: HTML (Part 3)

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017)

CSI 3140 WWW Structures, Techniques and Standards

Name Related Elements Type Default Depr. DTD Comment

introduction to XHTML

IT350 Web and Internet Programming. XHTML Tables and Forms (from Chapter 4 of the text 4 th edition Chapter 2 of the text 5 th edition)

Internet publishing HTML (XHTML) language. Petr Zámostný room: A-72a phone.:

Shankersinh Vaghela Bapu Institue of Technology

Designing UI. Mine mine-cetinkaya-rundel

XML. Objectives. Duration. Audience. Pre-Requisites

Review of HTML. Chapter Pearson. Fundamentals of Web Development. Randy Connolly and Ricardo Hoar

Web Development and HTML. Shan-Hung Wu CS, NTHU

PIC 40A. Lecture 4b: New elements in HTML5. Copyright 2011 Jukka Virtanen UCLA 1 04/09/14

Web development using PHP & MySQL with HTML5, CSS, JavaScript

Programmazione Web a.a. 2017/2018 HTML5

Html basics Course Outline

Creating and Setting Up the Initial Content

11. HTML5 and Future Web Application

Creating A Web Page. Computer Concepts I and II. Sue Norris

Web Design and Application Development

Advanced Web Programming C2. Basic Web Technologies

Chapter 9 Table Basics Key Concepts. Copyright 2013 Terry Ann Morris, Ed.D

Exam : 9A Title : Adobe GoLive CS2 ACE Exam. Version : DEMO

HTML HTML/XHTML HTML / XHTML HTML HTML: XHTML: (extensible HTML) Loose syntax Few syntactic rules: not enforced by HTML processors.

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

Symbols INDEX. !important rule, rule, , 146, , rule,

ATL Transformation. Catalogue of Model Transformations

5-Sep-16 Copyright 2016 by GemTalk Systems LLC 1

LING 408/508: Computational Techniques for Linguists. Lecture 14

QUICK REFERENCE GUIDE

Fall Semester 2016 (2016-1)

Chapter 10: Understanding the Standards

CIS 228 (Spring, 2012) Final, 5/17/12

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 7 XML

Tai-Jin Lee. Handout #5 11/01/2005. Navigation

Measuring ATL Transformations

Chapter 7 Tables and Layout

Transcription:

1. ATL Transformation Example: Measure to XHTML The Measure to XHTML example describes a transformation from a Measure model to a XHTML file representing the measurement data. 1.1. Transformation Overview The aim of this transformation is to generate a XHTML file from the input data contained in a Measure model. EMF Text M3 MOF M2 Measure XHTML XML M1 example-measure.ecore Table2XHTML.atl example-xhtml.ecore XHTML2XML.atl example-xml.ecore XML Projector example.html Figure 1: Overview of the transformation The generation of the output XHTML file is realized by a first transformation from Measure to XHTML, followed by the usage of a projector. The projector consists in a transformation from XHTML to XML and the predefined XML extractor (XHTML is a XML-like language). The output.html file contains XHTML tables for each category of metrics and per kind of model element measured. Page 1/8

Figure 2: Samples of XHTML file Page 2/8

2. Metamodels 2.1. Measure The Measure meta-model is used to stored the data collected after a model measurement. RootMeasureSet +modeltype : ModelKind 1 * +root +mesuresets MeasureSet +elementname : String +elementtype : ElementKind +root 1 1..* +categories * Category +name : String +desc : String +subsets 1 +category 1 +owner 1 * +measures Measure * +parent 1 +metric 1..* +metrics Metric +name : String +desc : String +preferredvalue : String IntegerMeasure +value : Integer DoubleMeasure +value : Double PercentageMeasure +value : Double «enumeration» ModelKind +KM3 +UML2 «enumeration» ElementKind +metamodel +model +package +interface +class Figure 3: Measure meta-model A measure model is in the following way made up: the root is a set of measure (RootMeasureSet) which contains information on the type of measured model (modeltype among KM3 or UML2), a set of categories of metric and sets of measure for each model element measured. A category (Category) corresponds to a metric set with a name and a description (desc) (an acronym and its definition). A category gathers one or more metric (Metric) also defined with a name and a description. A default predicate is also associated (preferredvalue), it is the desired values for the metric (for example 0 or > 75). A set of measure (MeasureSet) described measurements performed on a model element (elementname) of a given type (elementtype among meta-model, model, package, interface or class). The set of measure are structured between them, for example a set of measure on a package will contain the set of measure of the classes that this package contains. A measure (Measure) is associated to a metric and is declined in several versions. Measures with an Page 3/8

integer, real or percentage value (respectively IntegerMesasure, DoubleMeasure and PercentageMeasure). 2.2. XHTML The source metamodel of XHTML represents the XHTML language in version 1.1, and is base on the Strict DTD [3] [4]. 3. Transformation from Measure to XHTML 3.1. Rules specification These are the rules to transform a Measure model to a XHTML model. For each not empty sequence of MeasureSet of the same element type, the following element is created: o A Table element. For each Table element created, the following elements are created: o A header Row element. o Several value Row elements. For each header Row element created, the following elements are created: o A first Cell element with the kind of the model element measured. o Several Cell elements with the name of each metric defined for this kind of model element. For each value Row element created, the following elements are created: o A first Cell element with the name of the model element measured. o Several Cell elements with the value of each metric defined for this kind of model element. 3.2. ATL code This ATL code for the Measure2XHTML transformation consists in 8 helpers and 23 rules. The transformation uses the library defined in section 0. Page 4/8

The attribute helpers usecssfile and usejsfile are flags for using external CSS and JavaScript files or the embedded version provided by the helpers getstylesheet and getjavascript. The attribute helper metricdeflocation returns the URL of the metrics definition page. The attribute helpers modelkind and elementkind are a mapping between the corresponding enumeration and the desired string value. The attribute helper html is the root tag of the document. The rule RootMeasureSet() creates a the XHTML document by calling different called an lazy rules. The called rule HTML allocates a HTML element. The rule creates a HTML element ( html ) which is composed of a HEAD and BODY elements. The HEAD element is composed of a TITLE element, a META element, a LINK or STYLE element, a SCRIPT element and a NOSCRIPT element. The called rule LINK allocates a LINK element. The rule creates a LINK element ( link ) which is linked to the CSS file stylesheet.css. The called rule STYLE allocates a STYLE element. The rule creates a STYLE element ( style ) which includes the CSS returned by the helper getstylesheet. The called rule SCRIPT allocates a SCRIPT element. The rule creates a SCRIPT element ( script ) which is linked to the JavaScript file script.js. The called rule EmbeddedSCRIPT allocates a SCRIPT element. The rule creates a SCRIPT element ( embeddedscript ) which includes the JavaScript returned by the helper getjavascript. The called rule NOSCRIPT allocates a NOSCRIPT element. The rule creates a NOSCRIPT element ( noscript ) for preventing users to activate JavaScript in their browser. The called rule ACRONYM allocates an ACRONYM element. The rule creates a nacronym element ( acronym ) with a title and a value. text. The called rule LI allocates a LI element. The rule creates a LI element ( li ) with a The called rule BR allocates a BR element. The rule creates a BR element ( br ). The called rule HowToDIV allocates a DIV element. The rule creates a DIV element ( howtodiv ) which is composed of a FIELDSET element and two BR elements. The FIELDSET element is composed of a LEGEND element, P and UL elements. The general content of this DIV is the usage of the interactive version of the report. Page 5/8

The called rule TABLE allocates a TABLE element for a sequence of MeasureSet and for a Category. The rule creates a TABLE element ( table ) which is composed of CAPTION, THEAD, TFOOT and TBODY elements. The called rule FirstHeaderRow allocates a TR element for a Category. The rule creates a TR element ( tr ) which is composed of two TH elements. The first TH is empty and the second one is composed of an A element and for the colspan given. The A element is composed of an ACRONYM element with the name and description of the category given. The lazy rule HeaderRow allocates a TR element for a MesureSet and a Category. The rule creates a TR element ( tr ) which is composed of first header cell and header cells. The called rule FirstHeaderCell allocates a TH element. The rule creates a TH element ( th ) with the element type given. The lazy rule HeaderCell allocates a TH element for a Metric. The rule creates a TH element ( th ) which contains the name and description of the Metric given as an ACRONYM in an A element. The called rule InputTextRow allocates a TR element for a sequence of Mesure. The rule creates a TR element ( tr ) which is composed of a first empty TH element and input text cells. The called rule InputTextCell allocates a TH element for a Mesure. The rule creates a TH element ( th ) which contains an INPUT element which default value is the preferredvalue of the Measure. The lazy rule DataRow allocates a TR element for a MesureSet and a Category. The rule creates a TR element ( tr ) which is composed of first data cell and data cells. The called rule FirstDataCell allocates a TD element. The rule creates a TD element ( td ) with the element name given. The lazy rule DataCell allocates a TD element for a Metric. The rule creates a TD element ( td ) which contains the string value of the measure. The called rules CDATA allocates a CDATA element for a string. The rule creates a CDATA element which value is the given string. The called rules PCDATA allocates a PCDATA element for a string. The rule creates a PCDATA element which contains a CDATA with the string given. 4. ATL Library MeasureHelpers 4.1. ATL code This ATL code for the MeasureHelpers library consists in 18 helpers. Page 6/8

The two helpers metricname returns the metric name prefixed by the name of the category of the metric. The helper allmetrics returns all the metrics which category name is given. The helper absolutename returns the absolute name of the measured model element for this measure set. The helper allmeasuresets returns all the measure sets for a given element type and sorted by element name. The helper categories returns all the categories used by the measures of the measure set. The helper allmeasures returns all the measures of the measure set and sorted by metric full name. The helper allmeasures returns all the measures of the measure set for a category. set. The helper getmodelkind returns the String value for model type of the root measure The helper simplifiedvalue returns the value with at most one digit after the dot. The helper getelementkind returns the String value for element type of the measure set. The helpers stringvalue returns a string value for a measure with an integer, a real or a percentage value. The helper tonumber returns a real value for a percentage measure. The helper matchpreferredvalue returns true if the value match the predicate for the preferred value. 5. XHTML Projector The XHTML projector is a transformation from XHTML to XML followed by the predefined XML extractor. This can be done in this way, because XHTML is a XML-like language. The XHTML HTML element is mapped to the XML Root element. Other XHTML mark-up are mapped to XML Element element. Each attribute of a XHTML mark-up is mapped as a XML Attribute element. The XHTML CDATA or PCDATA are mapped to XML Text element. Page 7/8

6. References [1] ATLAS (ATLantic data Systems) Official Webpage: http://www.sciences.univnantes.fr/lina/atlas/ [2] The Atlantic Zoo: http://www.eclipse.org/gmt/am3/zoos/atlanticzoo/ [3] XHTML 1.0 Strict DTD: http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd [4] XHTML 1.1 - Module-based XHTML - Second Edition: http://www.w3.org/tr/xhtml11/ Page 8/8