Presentation is loading. Please wait.

Presentation is loading. Please wait.

5-1 Facilitating Business over the Internet: The XML language CR (2004) Prentice Hall, Inc. The xml goals The main objects of xml: Diagrams: Blocks and.

Similar presentations


Presentation on theme: "5-1 Facilitating Business over the Internet: The XML language CR (2004) Prentice Hall, Inc. The xml goals The main objects of xml: Diagrams: Blocks and."— Presentation transcript:

1 5-1 Facilitating Business over the Internet: The XML language CR (2004) Prentice Hall, Inc. The xml goals The main objects of xml: Diagrams: Blocks and Characterization Elements and Attributes Well Formed xml Valid xml Optionallity Xml Schema

2 5-2 Xml Design Goals The design goals for XML are: n XML shall be straightforwardly usable over the Internet. n XML shall support a wide variety of applications. n XML shall be compatible with SGML. n It shall be easy to write programs which process XML documents. n The number of optional features in XML is to be kept to the absolute minimum, ideally zero. n XML documents should be human-legible and reasonably clear. n The XML design should be prepared quickly. n The design of XML shall be formal and concise. n XML documents shall be easy to create. n Terseness in XML markup is of minimal importance.

3 5-3 The basic Objects: Elements and Attributes CR (2004) Prentice Hall, Inc. In diagrams we refer to Building blocks and their characterization. In valid xml these are elements and attributes. Elements Hierarchically ordered Well nested May contain other elements or Parsed Character Data

4 5-4 The basic Objects: Elements and Attributes CR (2004) Prentice Hall, Inc. Attributes Attached to identified single element Non hierarchical Must Contain (In Valid XML): Name of element to which they are attached Attribute name Attribute Type Optionality Status

5 5-5 Specification of the Document Structure CR (2004) Prentice Hall, Inc. The most basic Specification for XML is that required in the Well Formed XML. It is so elementary that no specific description is needed. Only a few basic rules must be followed. In the more complex case of Valid XML the full structure of the document content must be specified, prior to reporting any actual document.

6 5-6 Well Formed XML and Valid XML n Well Formed XML. Here we depart from the slide to the article XML in 11.5 minutes: Notice, each element must start with An opening tag And closed with a closing tag All sub sub elements and other content must be located between the opening and the closing. n Valid XML is much more complicated. It specifies the complex structure of the electronic document, including optionallity. n Essentially, it has a declaration refering to the use of XML follows by a DTD the Document Type Definition for the document that describes the possible structure of an actual reported document – the Document Instance, that follows it.

7 5-7 Optionallity n A Critical feature of an electronic document structure is the specification of the optionallity of its elements and its attributes. n Optionallity of Elements and their codes: n An element may appear once: No code is necessary. n An element may appear or may not appear: The code is, ?. n An element may appear zero or more times: The code is, *. n An element may appear once or more times: The code is,+. n That’s it --no more options.

8 5-8 1 st Example for Optionallity of Elements: Exactly one Prof and optional reporting of Lab Course Lab ?Professor

9 5-9 2nd Example: Exactly one Professor and required reporting of lab, if the course has a lab. Course Lab *Professor

10 5-10 3 rd Example: At least one Professor and required reporting of lab, if the course has a lab. Course Lab * Professor +

11 5-11 Optionallity of Elements in Document Type Definition In the above examples we would write: 1 st example: Course has exactly one professor that must be reported. Reporting of a lab is optional.. 2 nd example: Exactly one professor and required reporting of lab, if the course has a lab.

12 5-12 Optionallity examples contd. 3rd example: At least one professor and required reporting of lab, if the course has a lab.

13 5-13 Summary of Examples of Elements Optionallity In summary: In the three examples, we examined three possible design of a section of an electronic document. In reporting actual results in a document instance, the element course may have several sub elements. In any particular document instance, first a lab may be reported as it is the first mentioned (from left to right inside the parenthesis). In example 1, this is necessary only if the person filling the document would want to report the lab. In examples 2 and 3 the reporting of the lab if exists is required by design. Exactly one Professor would have to be reported in the document design of based on examples 1 and 2. At least one professor would have to be documented in design 3. So more may appear if they co-teach the course.

14 5-14 Optionallity of an Attribute n We refer to XML references:no 1 and 11.

15 5-15 Commerce Through the Internet CR (2004) Prentice Hall, Inc.

16 5-16 The Logistics Information System CR (2004) Prentice Hall, Inc.


Download ppt "5-1 Facilitating Business over the Internet: The XML language CR (2004) Prentice Hall, Inc. The xml goals The main objects of xml: Diagrams: Blocks and."

Similar presentations


Ads by Google