Professional Documents
Culture Documents
Client Tier
Service Tier
10
11
Front-End
12
Front-End
13
14
15
16
17
GROUP DISCUSSION
W H A T
T O D O ?
18
What is XML?
eXtensible Markup Language, is a specification for creating custom markup languages W3C Recommendation Primary purpose is to help computers to share data XML is meta-language. This means that you use it for creating languages. XML is an extensive concept.
XML Document
Every XML-document is text-based => sharing data between different computers! => sharing data in Internet! => platform independence!
Since XML is text-based, it does not have the problems mentioned above. What are the disadvantages in text format?
Mac OS X Since .doc is closed binary-format, there are very few alternatives for word processors that fully support the doc file format
Mac OS X Hopefully in the future there will be loads of free programs that support this new open and easy access file format
<xml> <heading1>title</heading1> . Now the format is . open and it's much </xml> easier to access
XML
OOXML (.docx)
MathML (.mml)
XHTML (.xhtml)
HTML (.html)
XHTML - Example
<?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Minimal XHTML 1.0 Document</title> </head> <body> <p>This is a minimal <a href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a> document.</p> </body> </html>
SVG - Example
<?xml version="1.0"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"/> </svg>
XML Editors
XML Spy EditiX Microsoft XML Notepad Visual XML XML Viewer Xeena XML Styler, Morphon, XML Writer
Correctness
There are two levels of correctness of an XML document:
1. Well-formed. A well-formed document conforms to all of XML's syntax rules. 2. Valid. A valid document additionally conforms to some semantic rules.
XML-Declaration
XML-declaration is optional in XML 1.0, mandatory in 1.1.
Recommendation: use it.
Comparing Declarations
<?xml version="1.0" encoding="utf-8" standalone="no"?> <presentation> <slide> <name>Introduction to XML</name> <contents>XML is ...</contents> </slide> </presentation> <?xml version="1.0"?> <presentation> <slide> <name>Introduction to XML</name> <contents>XML is ...</contents> </slide> </presentation>
Same Declaration
Start tag
<name>
Content
Introduction to XML
End tag
</name>
Naming Tags
Names can contain letters, numbers, and other characters Names must not start with a number or punctuation character Names must not start with the letters xml (or XML, or Xml, etc) Names cannot contain spaces
Well-Formed XML
XML document is well-formed if it follows the syntax rules. XML document must be well-formed!
it's not an xml-document, if it does not follow the rules..
Valid XML
XML document is valid if
1) It is well formed AND 2) It follows some semantic rules
XML document is usually linked to an external file, that has semantic rules for the document.
The file can be dtd (.dtd) or schema (.xsd)
Semantic rules?
Name of tags, order of elements
DTD Linking
<?xml version="1.0"?> Rules for XHTML elements (order, names, etc) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Minimal XHTML 1.0 Document</title> </head> <body> <p>This is a minimal <a href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a> document.</p> </body> </html>
DTD Linking
Defines the structure, tag names and order for all xhtml - documents
1. 2. 3.
There is no DTD! What language is this? MathML? SVG? XHTML? Assuming this is XHTML, what version of XHTML? Transitional? Strict? Assuming this is XHTML strict, does "jorma" tag belong to XHTML Language?
Invalid XHTML-document
<?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Minimal XHTML 1.0 Document</title> </head> <body> <jorma>This is a minimal <a href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a> document.</jorma> </body> </html>
May work... or not. Browser tries to detect the errors and tries to understand them. If it works with one browser, are you certain that it works with all other browsers? And with all the versions with the browsers? What about browsers in handheld devices? And it might work now, but what about future? How will Firefox 5.0 handle incorrect web pages?
JSON
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent. These properties make JSON an ideal datainterchange language.
Why JSON?
Because JSON is lightweight, easy to understand, manipulate and generate, it has almost replaced XML which was used previously as the only datainterchange format. JSON is preferable because of the following reasons:
XML is heavier than JSON to parse XML, we have to use xPath which is an overhead removed in JSON because JSON is native to JavaScript XML uses tags to describe user data and tags increase the size of data
JSON Structures
JSON is built on two structures:
A collection of name/value pairs.
In various languages, this is realized as an object, record, dictionary, hash table, keyed list, or associative array.
Syntax of JSON
Object
An object is an unordered set of name/value pairs. An object begins with { (left brace) and ends with } (right brace). Each name is followed by : (colon) and the name/value pairs are separated by , (comma).
Syntax of JSON
Array
An array is an ordered collection of values. An array begins with [ (left bracket) and ends with ] (right bracket). Values are separated by , (comma).
Syntax of JSON
A value can be a string in double quotes, or a number, or true or false or null, or an object or an array. These structures can be nested. A string is a collection of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. A character is represented as a single character string. A string is very much like a C or Java string.
JSON Example
{ students : [ {id":1, "name":"Adnan Sohail"}, {id":2, "name":"Irfan Razzaq"} ] }
XML Example
<?xml version="1.0" ?> <root> <student> <id>1</id> <name>Adnan Sohail</name> </student> <student> <id>2</id> <name>Irfan Razzaq</name> </student> </root>
Strings can be generating from objects of JSONObject or JSONArray using their toString() methods
JSON References
http://www.xul.fr/en-xml-ajax.html http://www.xul.fr/ajax-javascript-json.html http://json.org/ http://www.json.org/java/
Introduction
WSDL is an XML language that contains information about the interface semantics and administrivia of a call to a Web Service Once you develop a Web Service you publish its description and a link to it in a UDDI repository so that potential users can find it When someone wants to use your service, they request the WSDL file in order to find out the location of the service, the function calls and how to access them Then they use this information in your WSDL file to form a SOAP request to the computer
Definitions
Definitions:
- WSDL is an XML-based language used to define Web Services and describe how to access them. - WSLD is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information.
Working of WSDL
What is UDDI?
Universal
Specifications
Schemas for service description Schemas for business (service implementers) description Developed on industry standards (XML, HTTP, TCP/IP, SOAP) Applies equally to XML and non-XML web services
Implementation
major technology providers Global corporations Strong resource and product commitment Roadmap for transition to standards body
Unprecedented
collaboration
XML and Web Services recognized as core standards Competition on services built on a common model Technology, platform, and development language neutral
Describe Services Discover Services Integrate Them Together Publish for Accessibility
A B2B marketplace cannot get catalog data for relevant suppliers in its industry, along with connections to shippers, insurers, etc. Provide a standards-based profile for all electronic services that are provided. Includes web sites, other electronic resources
UDDI
Standards Bodies, Agencies, Programmers, Publishers register specifications for their Service Types
Service providers register precise information about themselves and their Web services
Contact info
Names, phone numbers, fax numbers, web sites, etc.
Known identifiers
List of unique identifiers for a business
D-U-N-S, Thomas, domain name, stock ticker symbol, other
Business categories
3 base taxonomies in V1
Industry: NAICS (Industry codes - US Govt.) Product/Services: UNSPSC (ECCMA) Location: Geographical taxonomy (ISO 3166) easy extension in upcoming releases
New set of information businesses use to describe how to do e-commerce with them
Nested model
Business process (functional) Service specifications (technical) Binding information (implementation)
Software companies, standards bodies, and developers populate the registry with descriptions (specifications) of types of services
.
UDDI Registry
Marketplaces, search engines, and business applications query the registry to discover services at other companies and to facilitate integration
Implementers populate the registry with descriptions of their businesses and the services they expose
Implementations
Service Types
UDDI Registry assigns a programmatically unique identifier to each service and registration Large businesses apply the same architecture and technologies internally
Marketplaces
UDDI.org HP (planned)
Microsoft
B2B Directory
Implementationneutral
GROUP DISCUSSION
W H A T
T O D O ?
84