Presentation is loading. Please wait.

Presentation is loading. Please wait.

SIGAda 2001 Workshop, “Creating a Symbiotic Relationship Between XML and Ada” 30 September, 2001 Robert C. Leif with unsolicited help from the XML Spy.

Similar presentations


Presentation on theme: "SIGAda 2001 Workshop, “Creating a Symbiotic Relationship Between XML and Ada” 30 September, 2001 Robert C. Leif with unsolicited help from the XML Spy."— Presentation transcript:

1 SIGAda 2001 Workshop, “Creating a Symbiotic Relationship Between XML and Ada” 30 September, 2001 Robert C. Leif with unsolicited help from the XML Spy Manual and W3C documents. Ada_Med, a Division of Newport Instruments 5648 Toyon Road, San Diego, CA 92115-1022, USA E-mail rleif@rleif.comrleif@rleif.com www.newportinstruments.com www.Ada-Med.com +1 (619)582-0437

2 Workshop Purpose To organize the Ada community to take advantage of this opportunity. This requires creating applications in Ada that use and support XML; and using XML to create Ada environments including XML based tools.

3 PC Software Development Eras: DOS (IBM => Microsoft) Text Windows (Microsoft) Graphics including GUI XML (World Wide Web Consortium and perhaps Microsoft) Internet SGML (Standard Generalized Markup Language)--Too much & too early HTML (Hypertext Markup Language--Too little XML (Extensible Markup Language) --Just right

4 XML is driven by the exploding use of the Internet and the economic advantage of having the same software operate on both the client and server. The historic Ada was a gambler. Her namesake, the computer language, has just had her luck change very much for the better. The commercial use of the Internet is the driving force behind XML. Fortunately, the programming language that has the best fit with XML is Ada.

5 W3C Goals for XML 1. XML shall be straightforwardly usable over the Internet. 2. XML shall support a wide variety of applications. 3. XML shall be compatible with SGML. 4. It shall be easy to write programs which process XML documents. 5. The number of optional features in XML is to be kept to the absolute, minimum, ideally zero.

6 W3C Goals for XML Continued. 6. XML documents should be human-legible and reasonably clear. 7. The XML design should be prepared quickly. 8. The design of XML shall be formal and concise. 9. XML documents shall be easy to create. 10. Terseness in XML markup is of minimal importance.

7 The XML Standards Puzzle DTD The "Document Type Definition" is a part of the original XML 1.0 specification that allows a developer, or standards body, to specify what elements and attributes may be used in a particular type of XML document and what their structure and nesting may be. This is also called the content model or schema of an XML document. If an XML document conforms with the content model defined by a DTD, it is said to be valid with respect to that DTD.

8 XML Schema The "XML Schema" is an ongoing effort by the W3C to supplant DTDs with a more flexible and powerful system to describe the structure of conforming XML documents, including provisions for defining data types including ranges and inheritance.

9 XML Schema Part 2: Datatypes, Section 2 Type System [Definition:] In this specification, a datatype is a 3- tuple, consisting of a) a set of distinct values, called its ·value space, Integers, strings, enumerated, boolean, etc. b) a set of lexical representations, called its ·lexical space·, and c) a set of ·facets that characterize properties of the ·value space·, individual values or lexical items. Ranges, Formatting, Default values

10 Facets A fundamental facet is an abstract property which serves to semantically characterize the values in a ·value space·. 4.2.1 equal 4.2.2 ordered {false, partial, total}. 4.2.3 bounded 4.2.4 cardinality 4.2.5 numeric

11 Ordered Partial for no a in the ·value space·, a < a (irreflexivity) for all a and b in the ·value space·, a < b implies not(b < a) (asymmetry) for all a, b and c in the ·value space·, a < b and b < c implies a < c (transitivity) Total =Partial + for all a and b in the ·value space·, either a < b or b < a or a = b

12 New Derived by restriction (Subtypes or New Types) ·derived· by restriction from another datatype when values for zero or more ·constraining facets are specified that serve to constrain its ·value space· and/or its ·lexical space· to a subset of those of its ·base type·.

13 Bounded String

14 Integer Type with Range

15 OO in XML v1.xsd:

16 v2.xsd:

17 v2.xsd has everything specified by v1.xsd, with the personName type extended by the addition of the generation element. Equivalent of a tagged type in Ada

18

19 XML Types

20

21 A Schema describes what one or more XML documents can contain by defining: – The elements and types the document contains, and the order in which they appear – The element content (type), and element attributes if any The purpose of a schema is to allow machine validation of document structure. Instead of using the syntax of XML 1.0 DTD declarations, schema definitions use XML element syntax. A correct XML schema definition is, therefore, a well-formed XML document.

22 XSL & XSLT The "eXtensible Stylesheet Language Transformation" is a very powerful programming language that allows XML documents to be displayed, transformed from one schema to another or into entirely different forms, such as HTML pages, WML cards, or PDF files. CSS Cascading Style Sheets are a popular way to control the appearance of HTML documents and can be used with XML.

23 XPath The "XML Path Language" is a language for addressing and querying the content of XML documents. XLink The "XML Linking Language" describes hyperlinking in XML documents and extends the hyperlinking concepts of HTML. XPointer The "XML Pointer Language" is a companion standard to Xlink and describes mechanisms for addressing particular parts of a document.

24 SVG Scalable Vector Graphics. SVG is an XML application used to describe 2D vector graphics, text and raster images. This enables vector graphics to be defined solely in XML. SVG is well designed, complete, and powerful. Unfortunately, it is based on a DTD. VML Vector Markup Language is a Microsoft creation, which is well designed and based on a schema.

25 DTD’s DTDs (Document Type Definitions) have their own arcane syntax (inherited from SGML). –DTDs should be made obsolete –Do not appear to have strong typing –Should use Schemas instead –DTDs can be incomplete and not permit translation into a schema.

26 XML Choices

27 XML, Schema, & XSL Roles XML is the data Schemas are the specifications of types and objects XSL describes how the output of the data should look and how (XSLT) it should be translated; it is some what equivalent to any Ada body..

28 Similarity of Schemas to Ada Specifications Schemas are XML documents. –{Ada’s specifications & bodies have the same syntax.} XML has visibility and scoping rules XML has strong typing and subtyping XML has single inheritance similar to Ada

29 XML Schema Style Issues UTF-8 or ISO-8859-1?

30 Visibility in XML XML documents include schemas. Including a schema makes it visible and does the equivalent of an Ada with and an Ada renames. –Starting with the root schema { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/13/3851979/slides/slide_30.jpg", "name": "Visibility in XML XML documents include schemas.", "description": "Including a schema makes it visible and does the equivalent of an Ada with and an Ada renames. –Starting with the root schema

31 With & Use Xmls:A=“http://www.ada-xml.org/namespace” targetNamespace=“http://www.ada- xml.org/namespace”http://www.ada- xml.org/namespace ElementFormDefault=qualified” attributeFormDefault=qualified”>

32 Person name and Address to be used as part of other schemas and to be mirrored by an equivalent Ada package(s) 2001 Sep 18

33 Person name and Address to be used as part of other schemas and to be mirrored by an equivalent Ada package(s) 2001 Sep 18

34 Prefixes xmlns:nam_add="http://NewportInstruments.com/Na me_And_Address" xmlns=http://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchema xmlns=http://NewportInstruments.com/Name_And_Ad dresshttp://NewportInstruments.com/Name_And_Ad dress xmlns:xs=http://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchema Only one name-space can have a null string as a prefix. Root schema for XML or the one under design?

35 XSL Candidate Recommendation Extremely Powerful  Together with SVG could build Microsoft Office Needs true “What you see is what you get.” Needs to be defined by a schema

36 Tables & XSL Procedural like HTML Object Oriented.

37 Procedural On/Before 4 Sep After 4 Sep On/Before 4 Sep

38 After 4 Sep On/Before 4 Sep

39 From Extensible Stylesheet Language (XSL) Version 1.0, 6.7. Formatting Objects for Tables

40 Object Oriented

41 Cell 1 Cell 2

42 Cell 3

43 9.1 Conditional Processing with xsl:if The following colors every other table row yellow: { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/13/3851979/slides/slide_43.jpg", "name": "9.1 Conditional Processing with xsl:if The following colors every other table row yellow: yellow", "description": "9.1 Conditional Processing with xsl:if The following colors every other table row yellow: yellow", "width": "800" }

44 9.2 Conditional Processing with xsl:choose The following example enumerates items in an ordered list using arabic numerals, letters, or roman numerals depending on the depth to which the ordered lists are nested.

45

46 .

47 In order to create the necessary applications in Ada that use and support XML: The present existing Ada software for XML should be described. A higher level design should be developed for the future packages required for the symbiosis (mutually beneficial relationship) of Ada and XML. This could initially include following packages: XML.Schema.Datatypes, XML.MathML (mathematics markup), and XML.SVG (Scalable Vector Graphics).

48 Automated translation of the Ada data types & objects in a specification to an XML Schema. –ASIS application Automated translation of the data types & elements in a XML Schema to an Ada specification.

49 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. -How is Ada to be called from a web page? -Attribute (J code, compiled, or script) XSL & XSLT 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.

50 XML Demolition of Ada Marketing Fallacies Need to minimize the number of reserved words Verbosity impedes sales A language needs to be simple C syntax is required for a large market. Small companies can not succeed. Shelve space is an absolute necessity for sales.

51 Postscript on Operating Systems XML, Schemas, XSL(T), etc can be used in a document centric system. OLE, COM, etc. can to a large part be replaced by withing schemas for use in one XML document which could contain: Text, Intelligent Tables (Spreadsheets), Images, and Graphs. The XSLT processor could inherit from the Scalable Vector Graphics. An Ada XML equivalent of a MHT (Web archive single) file needs to be created.

52 The database that controls the files should also be suitable for the creation of these files.  One of the first steps in development is the elimination of unnecessary requirements.  Less is often better.  Compared with Microsoft et al., it should be much better and cheaper.


Download ppt "SIGAda 2001 Workshop, “Creating a Symbiotic Relationship Between XML and Ada” 30 September, 2001 Robert C. Leif with unsolicited help from the XML Spy."

Similar presentations


Ads by Google