Presentation is loading. Please wait.

Presentation is loading. Please wait.

Providing Web-based Access and Integrating with XML

Similar presentations


Presentation on theme: "Providing Web-based Access and Integrating with XML"— Presentation transcript:

1 Providing Web-based Access and Integrating with XML
B. Ramamurthy Chapter 8 and 9 1/12/2019 B.Ramamurthy

2 Topics for Web access Web access environments (See figure 8.1)
Client facilities Web server facilities Session management Specialized client devices 1/12/2019 B.Ramamurthy

3 Web application configuration
User client User client User client Web server Application server Database server 1/12/2019 B.Ramamurthy

4 Client Facilities Provide adequate interactive performance
Ensure integrity of system updates Minimize the risk of exposure of confidential data Minimize network activity Enable disconnected user activity 1/12/2019 B.Ramamurthy

5 Implementing Client Functionality
Static pages HTML and variations of it Caching to help performance Cascading style sheets (CSS) separates content from fromat HTML pages provide “FORMs” to accept user input that may generate actions. Active contents: applets, plug ins, javascripts, JSP etc. Stand alone applications, esp. when it is not real-time. 1/12/2019 B.Ramamurthy

6 Web Application Components
HTML & Objects Servlets JSPs Database server Application objects 1/12/2019 B.Ramamurthy

7 Java Server Pages JSP model is well suited for process XML documents
Besides the directives, actions, and scripting elements, it is possible to access Java Beans and support a rich library of tags. Tag libraries provide for sharing of actions among multiple JSPs. They provide implicit objects for a given environment. JSP to XML and back is convenient feature. 1/12/2019 B.Ramamurthy

8 Session Management HTP is stateless. To maintain the user state we can use URL variables (using session key as a variable, insecure) Cookies (a packet of information communicated between the client and the server and stored on the client side, not secure), Secure Socket Layer (SSL) protocol: A session is established, session key is defined for encryption and communication for the duration of the session. 1/12/2019 B.Ramamurthy

9 Specialized Client Devices
Handheld devices such as cell phones and personal digital assistants (PDAs) are becoming popular for remote user access to systems. See Sun’s support for this: (has APIs for TV, phone, telematics and so on) Also connects to J2EE and Web services. 1/12/2019 B.Ramamurthy

10 Integrating with XML (Chapter 9)
XML is anew markup language, developed by W3C (World Wide Web Consortium), mainly to overcome the limitations of HTML. But it took a life of its own and has become a very popular part of distributed systems. We will examine its definition, associated specifications (DTD, XSLT etc.), Java APIs available to process XML, protocols and services based on XML, and the role XML plays in enterprise integration. 1/12/2019 B.Ramamurthy

11 First Look at XML It has no predefined tags. It is stricter.
Such as in HTML Domains may specify their own set of standard tags It is stricter. Most html document have errors and the browser have to built to take care of these. On the other hand XML has a strict syntax. There is a notion of validity and A notion of well-formed. 1/12/2019 B.Ramamurthy

12 XML document Content XML documents are composed of markup and contents
Six kinds of markup: Element Attributes Entity References Comments Processing instructions CDATA sections 1/12/2019 B.Ramamurthy

13 Elements Elements are the most common form of markup.
Delimited by angle brackets, most elements identify the nature of the content they surround. Example: <allen><quote>Goodnight, Gracie.</quote></allen> Some elements may be empty, as seen above, in which case they have no content. If an element is not empty,it begins with a start-tag, <element>, and ends with an end-tag, </element>. Example:<applause/> 1/12/2019 B.Ramamurthy

14 Attributes Attributes are name-value pairs that occur inside start-tags after the element name. For example, <div class="preface"> is a div element with the attribute class having the value preface. In XML, all attribute values must be quoted. 1/12/2019 B.Ramamurthy

15 Entities In XML, entities are used to represent these special characters. Entities are also used to refer to often repeated or varying text and to include the content of external files. Example: &amp to represent & &US to represent United States XML also has a set of predefined entities: &quot, &amp 1/12/2019 B.Ramamurthy

16 Comments Comments begin with <!-- and end with -->. Comments can contain any data except the literal string --. You can place comments between markup anywhere in your document. Example: <!– loosely inspired by the vcard3.0 --> 1/12/2019 B.Ramamurthy

17 Processing Instructions(PI)
Processing instructions (PIs) are an escape hatch to provide information to an application. Like comments, they are not textually part of the XML document, but the XML processor is required to pass them to an application. Processing instructions have the form: <?name pidata?> Example: <?xml-stylesheet href=“simple-ie5.xsl” type=“text/xsl”?> 1/12/2019 B.Ramamurthy

18 CDATA In a document, a CDATA section instructs the parser to ignore most markup characters. <?xml version=“1.0”?> <example> <[CDATA[ <?xml verion=“1.0”?> <entry> …. </entry>]]> </example> 1/12/2019 B.Ramamurthy

19 Well Formed and Valid A document is well formed if it obeys the syntax of XML A well formed document if valid if it contains a proper document type declaration and if the document obeys the constraints of the declaration: Element sequence Valid nesting Required attributed provided Attributes values are of correct type 1/12/2019 B.Ramamurthy

20 Enterprise Application Characteristics
Communicate using , ftp, edi, soap Received messages are published on message queues for guaranteed store/forward delivery. Consumers can subscribe to messages of interest. Messages can be transformed using variety of schemes: XSLT, GUI, user-defined. Internal business processes can be triggered by these messages. 1/12/2019 B.Ramamurthy

21 Role of XML Primary task is movement and interpretation of messages.
XML offers the following benefits: Well-defined grammar for defining message structures (DTD) Tools such as parsers, notepad available for working with XML documents Tools available for generating and consuming XML messages (Ex: numerous APIs offered by SUN) 1/12/2019 B.Ramamurthy

22 XML Processing Models XML Input Processing Business Logic Handling
XML Output Processing WEB EXTRACT BO XML input XML output 1/12/2019 B.Ramamurthy

23 Document Data Type:DTD
The purpose of a DTD is to define the valid building blocks of an XML document. It defines the document structure with a list of valid elements. It is similar to a type (/class) declaration in programming language context. A DTD can be declared inline in your XML document, or as an external reference. DTD defines the grammar of an XML document. 1/12/2019 B.Ramamurthy

24 DOCTYPE If the DTD is internal to an XML file it has to be wrapped in a DOCTYPE: <!DOCTYPE root-element [element-declarations]> If the DTD is external to the XML file then, the filename has be referenced within the DOCTYPE tag: <!DOCTYPE root-element SYSTEM "filename"> 1/12/2019 B.Ramamurthy

25 Example: Internal DTD <?xml version=”1.0”?> <!DOCTYPE memo [
<!ELEMENT memo (header,from,to, body,sign)> <!ELEMENT header (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT to (#PCDATA)> <!ELEMENT body (#PCDATA)> <!ELEMENT sign (#PCDATA)>]> <memo> <header> Hello World </header> <from> bina </from> <to> cse586 </to> <body> Wake up everyone </body> <sign> br </sign> </memo> 1/12/2019 B.Ramamurthy

26 Example: External DTD: memo.xml
<?xml version=”1.0”?> <!DOCTYPE memo SYSTEM “memo.dtd”> <memo> <header> Hello World </header> <from> bina </from> <to> cse586 </to> <body> Wake up everyone </body> <sign> br </sign> </memo> 1/12/2019 B.Ramamurthy

27 memo.dtd <!ELEMENT memo (header,from,to, body,sign)>
<!ELEMENT header (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT to (#PCDATA)> <!ELEMENT body (#PCDATA)> <!ELEMENT sign (#PCDATA)> 1/12/2019 B.Ramamurthy

28 DTD: Element In a DTD XML elements are declared with an ELEMENT tag.
You declare an element using these formats: <!ELEMENT element-name element-type> <!ELEMENT element-name (element-content)> 1/12/2019 B.Ramamurthy

29 Element Declarations Empty element <!ELEMENT element-name EMPTY>
DTD : <!ELEMENT BON EMPTY> XML : <BON /> Elements with one character data: <!ELEMENT elem-name (#PCDATA)> <!ELEMENT from (#PCDATA)> <to> cse586 </to> Elements with sub-elements: <!ELEMENT elem-name (elem1, elem2, ..)> <!ELEMENT memo (header, from, to, body, sign)> See memo.xml for example 1/12/2019 B.Ramamurthy

30 Element Declarations <!ELEMENT elem-name (sub-elem+)>
one or more subelements <!ELEMENT elem-name (sub-elem*)> zero or more subelements <!ELEMENT elem-name (sub-elem?)> zero or one Declaring mixed sub-elements: <!ELEMENT memo (header,to+,from,para*,#PCDATA)> 1/12/2019 B.Ramamurthy

31 XSLT XSLT is XML Style Language Transforms
XSLT transforms the content of an XML document into another form which could possibly be another XML document. In an XSLT processor, the information in the XML source document will be evaluated, rearranged, then reassembled. Most visible outcome is a pretty version of the content of the XML document. XSLT more importantly provides flexible source information, called Result Tree, that can be easily added to, modified, or reordered. 1/12/2019 B.Ramamurthy

32 Displaying XML XML DocumentXSL TransHTML Doc Web Browser
XML Document + CSS Style sheetXML-enabled Web Browser XML Document+ XSL StyleSheet  XSL Display Engine 1/12/2019 B.Ramamurthy

33 Style sheet Two details are specified:
Transformation of input document into another form (optional) Description of how to present the transformed information 1/12/2019 B.Ramamurthy

34 Transformation Capabilities
Generation of constant text Suppression of content Moving text Duplicating text Sorting Compute new information from given information 1/12/2019 B.Ramamurthy

35 Formatting capabilities
Specification of general layout Assignment of the transformed content into basic units (paragraph, lists etc.) Specify formatting properties (margins, alignment etc.) 1/12/2019 B.Ramamurthy

36 Components of XSL XPath: XML Path language for referencing parts of the XML document XSLT: XSL Transformations: for transforming one form to another XSL: Extensible Style Sheet Language: For formatting objects 1/12/2019 B.Ramamurthy


Download ppt "Providing Web-based Access and Integrating with XML"

Similar presentations


Ads by Google