Presentation is loading. Please wait.

Presentation is loading. Please wait.

XML Why is XML so popular? –It’s flexible –It enables you to create your own documents with elements (tags) that you define Non-XML example: This is a.

Similar presentations


Presentation on theme: "XML Why is XML so popular? –It’s flexible –It enables you to create your own documents with elements (tags) that you define Non-XML example: This is a."— Presentation transcript:

1

2 XML Why is XML so popular? –It’s flexible –It enables you to create your own documents with elements (tags) that you define Non-XML example: This is a paragraph of text What does this tell you? What does it tell a program?

3 XML What does the browser see? <p>blah, blah, blah</p>

4 XML example: Dog Rover 12 Dave

5 XML XML tags provide meaning or context Programs can interpret these meanings XML is ideal for sharing data between programs One user can encode data using XML and share it with others A different user can interpret that data

6 XML XML documents may have three parts –Prolog –Body –Epilog Prolog –Comments & processing instructions –Version information –Reference to a specific XML DTD or schema

7 XML Epilog –Comments & processing instructions Body –One or more elements –Defined by the DTD or schema –Forms a hierarchical tree structure One top-level element All others below it in the hierarchy

8 XML Why is XML important? –Forms the basis for web services How is XML different from HTML? –HTML is fairly forgiving of errors This is a paragraph will probably work OK –You can mix upper and lower case –Attribute values don’t have to be enclosed in quotes

9 XML Bottom line: –Poorly-formed HTML documents are no big deal XML does not provide that level of informality –You have to follow the rules What are the rules to remember?

10 XML XHTML documents must have a DOCTYPE declaration <!DOCTYPE html PUBLIC ¬ “-//W3C//DTD XHTML 1.0 Transitional//EN” ¬ http://www/w3/org/TR/xhtml/11/DTD/xhtml1- transitional.dtd> –Must occur before the root element

11 XML Root element –Top of the hierarchy of elements ( ) –Only one element at this level –No other elements before it –No other elements after the ending tag ( ) Lowercase only (XML is case sensitive)

12 XML Attribute values must be encased in quotes –HTML: –XML: Attribute values must not be minimized –That is, the name entered without a value –That’s why selected=“selected” Spaces in attribute values will be removed

13 XML Only the id attribute is used to uniquely identify an element –The name element is not recognized Both starting and ending tags are required –HTML: –XML: Elements must be nested, not overlapping

14 XML and elements must be marked as CDATA areas <![CDATA[ function clickalert() { alert(“VSNET is cool!”) } ]]>

15 Object-Oriented Concepts Object-oriented programming –Certain block of code treated as reusable objects –Accept certain inputs –Produce certain outputs –Programmer doesn’t have to know how the output is produced, only how to manipulate the object –Programmer has to know what parts of an object can be manipulated

16 Object-Oriented Concepts Properties –Contain values –Addressable That is, programmer has access to the property Methods –Functions that the object can perform –Can supply data via arguments –Don’t have to know how they work

17 Object-Oriented Concepts Events –Triggers that are activated in specific situations –Affects object without user intervention Many objects are already part of the VS.NET environment –You don’t have to create them, only use them –You can build your own objects if you need to

18 Object-Oriented Concepts Objects are derived from classes Classes are basically templates –Human is a class An object is an instance of a class –Creating an object is called instantiation –Making a baby is instantiating a human

19 Object-Oriented Concepts Encapsulation –Objects can be used without knowing what goes on inside them Inheritance –New classes can be created based on base classes –Each new derived class Inherits the properties and methods of the base class May have properties and methods not in the base class

20 Object-Oriented Concepts Polymorphism –Properties and methods of both base and derived classes can have the same name and be used in the same way –This means that the output of a method may be produced by completely different internal processing methods The user doesn’t care

21 .NET Structures & Languages Common Language Runtime (CLR) –CLR is an intermediate state Not source Not object –Makes VS.NET applications machine independent –Code running within the CLR is called managed code

22 .NET Structures & Languages Communications protocols –VS.NET supports many –Necessary for networked environment Multiple computers Multiple operating systems Encoding formats –ISO 8859-1 –Unicode

23 .NET Structures & Languages VS.NET supports –Visual Basic (VB.NET) –C# –J# –Others being added We’ll be using VB.NET –It’s components are …

24 .NET Structures & Languages Variables –Strongly typed –Name begins with alphabetic character –May contain alphabetic characters or digits No special characters or punctuation symbols –No more than 255 characters in length –Cannot match a reserved word –Declared: dim SSN as String

25 .NET Structures & Languages Constants –Literals (simply a value): Const 19.95 –Symbolic (includes name): Const TVPrice=19.95 Comments –Begins with apostrophe

26 .NET Structures & Languages Data types –Boolean –String –Integer –Decimal –Date –Object –User-defined

27 .NET Structures & Languages Operators –Assignment = –Arithmetic + - / * ^ –Relational >= > Like –Wild cards * and ?

28 .NET Structures & Languages Operators (cont.) –Logical and or –Concatenation + &

29 .NET Structures & Languages Control Structures –if…then –do –for…next –select case –while…wend –with

30 .NET Structures & Languages Namespaces –Closed set of names that identifies elements from a DTD –Can be used to include classes of objects in an application Scope –Local –Blobal

31 Example Application What savings are needed to achieve a specific retirement goal? Variables –Amount at retirement –Amount saved each month –Time until retirement –Interest rate

32 Example Application Web page format –Welcome page with link to a form –Data entry form –Results shown in browser window Validation on client side –Javascript Processing on server side –Computations

33 Example Application Server-side processing is a little different –Web form – web page in HTML with a form –Form written in HTML on client side –Comes to client from server Page & form start on server Contains HTML and other elements (XML) Application also includes code behind the page –Web form and Code-Behind page automatically generated by VS.NET

34 Assignment Complete the application described on pages 53 thru 63 Follow the instructions exactly You can check your code the same way I will –Through a browser: http://coit-ts2003.uncc.edu/ Grade based on functionality


Download ppt "XML Why is XML so popular? –It’s flexible –It enables you to create your own documents with elements (tags) that you define Non-XML example: This is a."

Similar presentations


Ads by Google