Download presentation
Presentation is loading. Please wait.
2
2a.1 Brief outline of mark-up languages and XML ITCS 4146/5146 Grid Computing, UNC Charlotte, B. Wilkinson, 2007 Jan 22, 2007
3
2a.2 Mark-up Languages A way of describing information in a document. Standard Generalized Mark-Up Language (SGML) A mark-up language specification ratified in 1986. Key aspect - using pairs of tags that surround information - a begin tag and a matching end tag. Example ITCS 4146 home page
4
2a.3 Questions 1.Put your and up if you know HTML 2.Put your hand up if you know XML If yes to both, next part will be easy.
5
2a.4 HyperText Markup Language (HTML) A mark-up language used in web pages. “Hypertext” refers to the text’s ability to link to other documents. “Markup” refers to providing information to tell browser how to display page and other things.
6
2a.5 HTML page format Signifies an HTML document Head section includes information about document - “metadata” Body section contains text and references to images to be displayed End of document
7
2a.6 HTML Tags Tags specify details such as type of text. Example to start bold text to end bold text to start italic text to end italic text
8
2a.7 HTML page Hello world My name is Barry
9
2a.8 Question What does the previous HTML page display? Answer Hello World My name is Barry
10
2a.9 HTML page Hello world My name is Barry Line break tag - some tags in HTML are not in pairs
11
2a.10 Attributes Many tags can have attributes which specify something about the body between tag pair. Example This text is displayed in red in Times font, about 12 pt. Attributes
12
2a.11 Extensible Mark-up Language XML Ratified in 1998 - very important standard mark-up language - a “simplified” SGML. Developed to represent textual information in a structured manner that could be read and interpreted by a computer. A foundation for web services and grid services.
13
2a.12 Some key aspects of XML Tags always used in pairs delineate information to make it easy to process. (Exception: when body between tags holds nothing. Then a single tag can be used.) Tags can be nested. Names of tags are not fixed/predefined as in HTML. Creates multitude of “XML” languages.
14
2a.13 XML Tag Attributes As in HTLM, provides a way of providing information rather than in the body between the tags. Use of attributes rather than the body is application dependent. Often have both attributes and a body.
15
2a.14 XML used for two areas: –Document-centric XML Documents usually meant for humans, (could be processing by computers). Semi-structured - some tags placed more-or-less anywhere, similar to HTML tags. –Data-centric XML Usually generated and meant to be read by computer programs. Structured. Nesting useful to create a clearly structured and computer-readable document. As we shall see, even when generated by computer programs, programmers still have to be able to read these documents to fully understand what’s going on
16
2a.15 Sample document-centric XML Prerequisites for grid computing course Spring 2007 CS I Programming I or equivalent CS II Programming II or equivalent desirable Able to program in Java or learn quickly. Able to program in C/C++ or learn quickly. Able to use Linux system or learn quickly. For more information look at Outline.
17
2a.16 Sample data-centric XML Department of Computer Science University of North Carolina at Charlotte 9201 University City Blvd. Charlotte NC 28223 Department of Computer Science University of North Carolina at Charlotte 9201 University City Blvd. Charlotte NC 28223 computer system type 1234 Unmanaged 16 port GigE switch.
18
2a.17 Example of attributes and a body computer system type 1234 Attributes Body of element
19
2a.18 Structure of an XML document Optional Prolog Root Element
20
2a.19 Prolog Includes: Processing instruction to specify how to process document. Uses symbol sequence: Meta-information about document, and comments.
21
2a.20 Root element Root element contains contents of document. Other elements are within root element and can be nested.
22
2a.21 XML Tags Name of tags and meaning need to defined, just as variables are given names in a programs and need to be defined. As in programming languages, restrictions. Case sensitive. Start with a letter.
23
2a.22 Question How are variable names defined (declared) in a programs? Answer Using variable definitions at top of program Example int pi;
24
2a.23 Question How are the meanings for variable names defined (declared) in a programs? Answer Using comments: Example int pi; // this represents
25
2a.24 Defining tags in a XML Document Type Definitions Uses tags either within document or contained in a separate document to specify tag information. More details see: http://www.w3schools.com/dtd/dtd_intro.asp Not a preferred approach nowadays
26
2a.25 XML Schema A very flexible way of handing legal tag (element) names and defining structure. An XML document with required definitions. Expressed in XML. Has notation of data types Handles namespaces (see later).
27
2a.26 Question If tags and structure are defined in an XML document, how does one define the tags and structure in the schema XML document? Answer We use a scheme definition language (XSD) with fixed definition of the tags and structure. Includes data types.
28
2a.27 XML Tags Not a single set of predefined tags as in HTML. Each document will conform to a schema (an XML language) that defines the tags and structure. Many many XML languages
29
2a.28 Examples WSDL Web Services Description language –XML language used to as the interface description language for web services. SAML Security Assertion Markup Language.
30
2a.29 schema for the particular XML document, written in XSD “language” XML document written in particular schema (particular XML language Definition of XSD Uses Other schemas Other Documents in other XML languages Structure of documents
31
2a.30 XML schema Document xlns:xsi=“http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=“.. “ Associating a Schema with an instance of an XML document
32
2a.31 Schema validation The schema approach allows documents that are supposed to conform to XML syntax and a specific schema to be checked against the scheme, prior to processing.
33
2a.32 Two formal aspects Well-formedness – document conforms to rules of XML syntax. Validity – checks the structure and identity of elements etc. that the document should have from that schema.
34
2a.33 Namespace Mechanism Namespace mechanism allows author to provide logical domains for parts of the document. Allows XML documents to combined, where each document uses same tag names to mean different things. With namespace mechanism, tags given additional namespace identifier to qualify it.
35
2a.34 Qualifying names Qualified name given by namespace identifier and name used in document: Qualified name = namespace identifier + local name
36
2a.35 Namespace identifier Uses URI’s (Uniform Resource Identifiers) - web naming mechanism. URLs are a subset of URIs, and would typically be used, e.g.: http://www.cs.wcu.edu/~abw/ns
37
2a.36 Associating namespace identifier with local name Names in document given a prefix, i.e.: Namespace identifier associated with prefix in root element:: xmlns:mypo=“http://www.cs.uncc.edu/~abw/ns”
38
2a.37 Namespace Example Computer, Pentium IV, 4.7 Ghz, 4 Gbytes main memory prefix
39
2a.38 Can apply namespace to every tag without a prefix automatically if that is required: Computer, Pentium IV, 4.7 Ghz, 4 Gbytes main memory
40
2a.39 The name space given by the xmlns tag becomes the default namespace unless overridden by a prefix.
41
2a.40 XML Schema Structure Example <myRootElement xmlns=http://www.cs.uncc.edu/namespaces/myName/ myMathService> … … … Here all tags without prefixes have the namespace given
42
2a.41 XML Schema Structure Example <myRootElement xmlns:math=http://www.cs.uncc.edu/namespaces/myName / myMathService> … … … Here the tag operation is qualified with the prefix math that identifies the namespace
43
2a.42 What XML gives you A way of describing things which can be read by computer. Used in web services to describe the service interface, how to deploy it, etc, (in separate XML documents (see later). Used in the job description document to describe a job being submitted (next set of slides)
44
2a.43 Sample XML documents found in the assignments
45
2a.44 Job description XML document (Assignment 2) (Resource specification language, RSL) /bin/echo ${GLOBUS_USER_HOME} abc GLOBUS_DUROC_SUBJOB_INDEX 0 ${GLOBUS_USER_HOME}/stdout ${GLOBUS_USER_HOME}/stderr 1 multiple
46
2a.45 Grid service deployment descriptor file Assignment 3 (?) WSDD language <deployment name="defaultServerConfig" xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <service name="examples/core/first/MathService" provider="Handler“ use="literal" style="document"> <parameter name="className“ value= "org.globus.examples.services.core.first.impl.MathService"/> share/schema/examples/MathService_instance/Math_serv ice.wsdl
47
2a.46 Grid service description file (First part) Assignment 3 (?) WSDL language <definitions name="MathService" targetNamespace="http://www.globus.org/namespaces/exa mples/core/MathService_instance" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.globus.org/namespaces/examples/ core/MathService_instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsrp="http://docs.oasis- open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2- draft-01.xsd" xmlns:wsrpw="http://docs.oasis- open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2- draft-01.wsdl" xmlns:wsdlpp="http://www.globus.org/namespaces/2004/1 0/WSDLPreprocessor" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
48
2a.47 Last part <portType name="MathPortType" wsdlpp:extends="wsrpw:GetResourceProperty" wsrp:ResourceProperties="tns:MathResourceProperties"> Namespace These names defined earlier in document
49
2a.48 Quiz 1.How are tags defined in HTML? Answer
50
2a.49 Quiz 2.How are tags defined in XML? Answer
51
2a.50 Quiz 3. A pair of XML tags with empty contents: can be written as Under what circumstances would such a construction make sense? Answer
52
2a.51 Multiple choice Quiz Similar to WebCT quizzes What is an XML schema? (a) A way to make XML documents secure (b) A way of defining XML tags (c) A way of encoding data for transmission (d) None of the other answers
53
2a.52 Reference Books Several books on XML, e.g.: “Building Web Services with Java: Making sense of XML, SOAP, WSDL, and UDDI, 2nd edition” by S. Graham et al, SAMS publishing, 2004 Very good but 792 pages!!
54
2a.53 Additional XML materials On-line materials W3C consortium home page: http://www.w3.org/XML/ W3Schools XML Tutorial : http://www.w3schools.com/xml/
55
2a.54 Questions
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.