Presentation is loading. Please wait.

Presentation is loading. Please wait.

Newport Instruments copyright © 2002 Ada & XML Similarities & Harmonization Robert C. Leif, Ph.D. Vice President R&D Newport Instruments

Similar presentations

Presentation on theme: "Newport Instruments copyright © 2002 Ada & XML Similarities & Harmonization Robert C. Leif, Ph.D. Vice President R&D Newport Instruments"— Presentation transcript:

1 Newport Instruments copyright © 2002 Ada & XML Similarities & Harmonization Robert C. Leif, Ph.D. Vice President R&D Newport Instruments

2 Newport Instruments copyright © 2002 Introduction to XML eXtensible Markup Language –Document (file) that describes data –Allows sharing of data by providing a common standard, extensible way to interpret that data.

3 Newport Instruments copyright © 2002 W3C Goals (Requirements) for XML XML shall be straightforwardly usable over the Internet. XML shall support a wide variety of applications. XML shall be compatible with SGML. It shall be easy to write programs which process XML documents. The number of optional features in XML is to be kept to the absolute, minimum, ideally zero.

4 Newport Instruments copyright © 2002 XML documents should be human-legible and reasonably clear. The XML design should be prepared quickly. The design of XML shall be formal and concise. XML documents shall be easy to create. Terseness in XML markup is of minimal importance.

5 Newport Instruments copyright © 2002 Schema Element

6 Newport Instruments copyright © 2002 Person Name

7 Newport Instruments copyright © 2002

8 Newport Instruments copyright © 2002

9 Newport Instruments copyright © 2002

10 Newport Instruments copyright © 2002 Money with a range of $5.00 to $2,000.

11 Newport Instruments copyright © 2002 Harmonization of Data types Bounded Strings Numbers

12 Newport Instruments copyright © 2002 Create XML Strings by Addition of fields to Bounded_String Encapsulated in generic packages, Ada.Strings.Bounded. & Wide_Bounded Solution: 1.Create a generic that instantiates Ada.Strings. Bounded with a generic type. 2.Add a Character_Set_Type etc. to a private tagged type. 3.Add a Modified version of all of the methods in Ada.Strings.Bounded

13 Newport Instruments copyright © 2002 Latin_1_Range : constant Str_Maps.Character_Range := (Low => Latin_1.Null, High => Latin_1.Lc_Y_Diaeresis); Latin_1_Char_Set : Character_Set_Type := Str_Maps.To_Set (Span => Latin_1_Range); How to Create a Character Set

14 Newport Instruments copyright © 2002 XML Bounded Strings with Character Sets with Ada.Strings.Bounded; with Ada.Strings; with Character_Sets; with Pattern_Pkg; generic Max_Bd_Length : Positive; Character_Set : Character_Sets.Character_Set_Type := Character_Sets.Latin_1_Char_Set;

15 Newport Instruments copyright © 2002 Min_Bd_Length : Positive := Min_Bd_Length; ---1 Pattern : Pattern_Bd_Type := Null_Pattern_Bd;

16 Newport Instruments copyright © 2002 Generic Instantiation package Generic_Bd_W_Char_Sets is …………………………… package Generic_Bd_Strings is new Ada.Strings.Bounded.Generic_Bounded_Length (Max => Max_Bd_Length);

17 Newport Instruments copyright © 2002 private type Generic_Bd_W_Char_Set_Type is tagged record Generic_Bd_Part : Generic_Bd_Type := Null_Generic_Bd; Character_Set_Part : Character_Set_Type := Character_Set; --This permits the Character_Set to be --specified at instantiation and defaults to --Latin_1 Min_Bd_Length_Part : Positive := 1; Pattern_Part : Pattern_Bd_Type := Null_Pattern_Bd; end record;

18 Newport Instruments copyright © 2002 Problem XML is based on Unicode –UTF-8, –UTF-16, –UTF-32 Solution Ada.Strings.Unbounded, Ada.Strings.Bounded Ada.Strings.Maps & Ada.Characters.Handling need to have added 32 bit versions. Translation between 8, 16 and 32 bit types Briots XML/Ada does not easily interface with bounded strings.

19 Newport Instruments copyright © 2002

20 ECMA Types Originally, European Computer Manufacturers Association Now, ECMA International - European association for standardizing information and communication systems.

21 Newport Instruments copyright © 2002 Real Types are Primitive XML TypeSourceECMA float IEEE single- precision 32-bitfloat32 double IEEE double-precision 64- bitfloat64 *decimalW3Cdecimal *Minimum of 18 Digits. Pentium uses double extended precision floating point registers. PowerPC uses floating point registers for fixed-point.

22 Newport Instruments copyright © 2002 Integer Types are Derived Type & Derivation SequenceECMA Min- Inclusive Max- Inclusive *integer-infinityinfinity nonPositiveInteger0 negativeInteger longInt64-2**63(2**63) -1 intInt32-2**31(2**31) -1 shortInt16-2**15(2**15) -1 byte SByte Int8-2**7(2**7)-1 *Derived From decimal; fractionDigits·= 0

23 Newport Instruments copyright © 2002 Type & Derivation SequenceECMA Min Inclusive Max Inclusive *nonNegativeInt eger0infinity unsignedLongUInt6402**64-1 unsignedIntUInt3202**32-1 unsignedShortUInt1602**16-1 unsignedByte Byte UInt802**8-1 positiveInteger1infinity Integer Types Cont. *Derived from Integer

24 Newport Instruments copyright © 2002 XML 32 bit Integer Equivalent

25 Newport Instruments copyright © 2002 Ada Int32 Type & Subtypes subtype Int32 is Integer; --or type Int32 is range -2**31..2**31-1; for Int32'SIZE use 32; subtype Natural_32 is Int32 range 0..Int32'Last; subtype Positive_32 is Int32 range 1..Int32'Last;

26 Newport Instruments copyright © 2002 XML Time & Date Types XML TypeXML Description & Format Type & Standard duration is a six-dimensional space where the coordinates designate the Gregorian year, month, day, hour, minute, and second components respectively. These components are ordered in their significance by their order of appearance i.e. as year, month, day, hour, minute, and second. defined in § of [ISO 8601],

27 Newport Instruments copyright © 2002 XML Core Languages Extensible Markup Language (XML) –Schema Definition Language (XSDL) –Extensible Stylesheet Language (XSL) –Scalable Vector Graphics (SVG) –XSL Transformations (XSLT) –XML Path Language (XPath) –XML Linking Language (XLink) –XML Forms (XForms )

28 Newport Instruments copyright © 2002 XSL Includes: Screen objects which scroll Page objects, which can be printed; Blocks with various formatting properties including those representing different levels of titles (some including auto- numbering) and paragraphs (including indented block quote paragraphs); External graphics; Tables.

29 Newport Instruments copyright © 2002 Bulleted and enumerated lists including nested lists; Generated table of contents including leaders and generated page numbers; Running headers and footers including use of markers; Multiple page layouts, folio formats; Page master alternation, various in-line font changes Hyphenation and justification and various combinations of display spacing

30 Newport Instruments copyright © 2002 XSLT Number Formatting Like Ada uses a picture string However is described separately from the data.

31 Newport Instruments copyright © 2002

32 Newport Instruments copyright © 2002

33 Newport Instruments copyright © 2002 XForms is a means for display, inputting, submitting and uploading data, without describing how the data will be presented. includes event handlers such as setFocus, message, and setValue. can: associate a schema datatype with a field, restrict a value from changing by declaring it read-only, require that a value exists before the data is submitted.

34 Newport Instruments copyright © 2002 XForms (Continued) can indicate that a field is the result of a calculation performed on other data and can describe the conditions required for the data to be considered valid. Includes user Interface controls, such as: text boxes including multiline content, secret boxes, buttons, and selection from multiple choices. Interacts with a stylesheet for display of radio buttons, checkboxes, menus, and listboxes.

35 Newport Instruments copyright © 2002 Form Layouts A graphical browser might render form control selectMany as any of the following:

36 Newport Instruments copyright © 2002 XML & Ada have in common: Separation of the declaration of public data types from their use or display; Begins and ends; Strong typing including range checking; Single inheritance; Visibility control by the use of prefixes; Maximization of readability over programmer effort; Conformance Test Suites.

37 Newport Instruments copyright © 2002 XML (Packages) Mathematical Markup Language (MathML)

38 Newport Instruments copyright © 2002 The maximization of a symbiotic relationship between XML and Ada requires the establishment of a formal liaison between SIGAda and the World Wide Web Consortium. Harmonization of XML and Ada How is Ada to be called from a web page? Attribute (J code, compiled, or script)

39 Newport Instruments copyright © 2002 Both Groups Could Learn from Each other XSL, XSLT & SVG would benefit from the services of an experience Ada language designer. Conversely, Ada presentation and GUI software should adopt as much of their formatting and design from XML technologies.

40 Newport Instruments copyright © 2002 XML Demolition of Ada Marketing Fallacies Need to minimize the number of reserved words. Verbosity impedes adoption. A language needs to be simple. C syntax is required for a large market. Small companies can not succeed. Altova, XMLSpy doing well. Shelve space is an absolute necessity for sales. XMLSpy sold over the Internet

41 Newport Instruments copyright © 2002 The XML Cover Pages, By Robin Cover (MLs) Markup Language for Complex Documents (Bergen MLCD Project) US Patent and Trademark Office Electronic Filing System BSML, schema for NCBI (National Center for Biotechnology Information) data model. Microarray Gene Expression Markup Language (MAGE-ML) CytometryML

42 Newport Instruments copyright © 2002 Suggested Web Sites & Readings General Principles of Software Validation; Final Guidance for Industry and FDA Staff, January 11, 2002, Guidance for FDA Reviewers and Industry, May 29, 1998, N. G. Leveson"Safeware, System Safety and Computers", Addison-Wesley, Reading, MA pp , XML and related languages: Worldwide Web Consortium P. Walmsley, Definitive XML Schema, ISBN , Prentice Hall Character Model for the World Wide Web 1.0 W3C Working Draft 30 April 2002

43 Newport Instruments copyright © 2002 Direct Internet Message Encapsulation (DIME) 02.txt 02.txt FormsPlayer from Scalable Vector Graphics (SVG) The Extensible Stylesheet Language (XSL) K. Whistler, M. Davis Unicode Technical Report #17, Character Encoding Model; E. Briot XML/Ada: a full XML suite: The Ada95 XML Library, Version 0.5 Date: 2001/10/30 15:01:17 R. C. Leif, SIGAda 2001 Workshop, Creating a Symbiotic Relationship Between XML and Ada Ada Letters Vol. XXII, pp (2002).

Download ppt "Newport Instruments copyright © 2002 Ada & XML Similarities & Harmonization Robert C. Leif, Ph.D. Vice President R&D Newport Instruments"

Similar presentations

Ads by Google