XML Extensible Markup Language

Size: px
Start display at page:

Download "XML Extensible Markup Language"

Transcription

1 XML Extensible Markup Language Generic format for structured representation of data. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

2 XML Extensible Markup Language Generic format for structured representation of data. No predefined tags, but a syntax similar to HTML. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

3 XML Extensible Markup Language Generic format for structured representation of data. No predefined tags, but a syntax similar to HTML. Applications: Web services, business transactions DD1335 (Lecture 9) Basic Internet Programming Spring / 34

4 XML Extensible Markup Language Generic format for structured representation of data. No predefined tags, but a syntax similar to HTML. Applications: Web services, business transactions XHTML HTML on XML syntax DD1335 (Lecture 9) Basic Internet Programming Spring / 34

5 XML Extensible Markup Language Generic format for structured representation of data. No predefined tags, but a syntax similar to HTML. Applications: Web services, business transactions XHTML HTML on XML syntax The graphics format SVG DD1335 (Lecture 9) Basic Internet Programming Spring / 34

6 XML Extensible Markup Language Generic format for structured representation of data. No predefined tags, but a syntax similar to HTML. Applications: Web services, business transactions XHTML HTML on XML syntax The graphics format SVG Configuration files DD1335 (Lecture 9) Basic Internet Programming Spring / 34

7 XML Extensible Markup Language Generic format for structured representation of data. No predefined tags, but a syntax similar to HTML. Applications: Web services, business transactions XHTML HTML on XML syntax The graphics format SVG Configuration files Much more... DD1335 (Lecture 9) Basic Internet Programming Spring / 34

8 Strengths XML DD1335 (Lecture 9) Basic Internet Programming Spring / 34

9 Strengths XML Open standard from W3C DD1335 (Lecture 9) Basic Internet Programming Spring / 34

10 XML Strengths Open standard from W3C Simple text format, easy to parse DD1335 (Lecture 9) Basic Internet Programming Spring / 34

11 XML Strengths Open standard from W3C Simple text format, easy to parse Supported by numerous vendors and platforms DD1335 (Lecture 9) Basic Internet Programming Spring / 34

12 XML Strengths Open standard from W3C Simple text format, easy to parse Supported by numerous vendors and platforms Excellent for transactions between different systems DD1335 (Lecture 9) Basic Internet Programming Spring / 34

13 XML Strengths Open standard from W3C Simple text format, easy to parse Supported by numerous vendors and platforms Excellent for transactions between different systems Structure allows for search DD1335 (Lecture 9) Basic Internet Programming Spring / 34

14 XML Strengths Open standard from W3C Simple text format, easy to parse Supported by numerous vendors and platforms Excellent for transactions between different systems Structure allows for search Facilitates separation between content and presentation DD1335 (Lecture 9) Basic Internet Programming Spring / 34

15 Example XML <?xml version="1.0"?> <pricelist> <item> <name>pears</name> <price>12.90</price> </item> <item> <name>apples</name> <price>19.90</price> </item> </pricelist> DD1335 (Lecture 9) Basic Internet Programming Spring / 34

16 Form XML DD1335 (Lecture 9) Basic Internet Programming Spring / 34

17 Form XML The XML declaration first, perhaps stating the file encoding. For example one of <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="iso "?> DD1335 (Lecture 9) Basic Internet Programming Spring / 34

18 XML Form The XML declaration first, perhaps stating the file encoding. For example one of <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="iso "?> More declarations may follow. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

19 XML Form The XML declaration first, perhaps stating the file encoding. For example one of <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="iso "?> More declarations may follow. Thereafter exactly one XML element on the outermost level. (Pricelist in the example.) DD1335 (Lecture 9) Basic Internet Programming Spring / 34

20 XML Form The XML declaration first, perhaps stating the file encoding. For example one of <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="iso "?> More declarations may follow. Thereafter exactly one XML element on the outermost level. (Pricelist in the example.) End tags required. (Compare with <p> in HTML.) Special case: An empty element may be abbreviated: <a></a> becomes <a/>. (<a /> also allowed.) DD1335 (Lecture 9) Basic Internet Programming Spring / 34

21 XML Form The XML declaration first, perhaps stating the file encoding. For example one of <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="iso "?> More declarations may follow. Thereafter exactly one XML element on the outermost level. (Pricelist in the example.) End tags required. (Compare with <p> in HTML.) Special case: An empty element may be abbreviated: <a></a> becomes <a/>. (<a /> also allowed.) Correct nesting required. <a><bbb></a></bbb> never allowed. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

22 XML Form The XML declaration first, perhaps stating the file encoding. For example one of <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="iso "?> More declarations may follow. Thereafter exactly one XML element on the outermost level. (Pricelist in the example.) End tags required. (Compare with <p> in HTML.) Special case: An empty element may be abbreviated: <a></a> becomes <a/>. (<a /> also allowed.) Correct nesting required. <a><bbb></a></bbb> never allowed. Attribute values must be between quote marks. Example (SVG): <circle cx="10" cy="10" r="5" />. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

23 XML Form The XML declaration first, perhaps stating the file encoding. For example one of <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="iso "?> More declarations may follow. Thereafter exactly one XML element on the outermost level. (Pricelist in the example.) End tags required. (Compare with <p> in HTML.) Special case: An empty element may be abbreviated: <a></a> becomes <a/>. (<a /> also allowed.) Correct nesting required. <a><bbb></a></bbb> never allowed. Attribute values must be between quote marks. Example (SVG): <circle cx="10" cy="10" r="5" />. As in HTML, entities are used for some characters. Example: < for < (Starts a tag otherwise). DD1335 (Lecture 9) Basic Internet Programming Spring / 34

24 XML Form The XML declaration first, perhaps stating the file encoding. For example one of <?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="iso "?> More declarations may follow. Thereafter exactly one XML element on the outermost level. (Pricelist in the example.) End tags required. (Compare with <p> in HTML.) Special case: An empty element may be abbreviated: <a></a> becomes <a/>. (<a /> also allowed.) Correct nesting required. <a><bbb></a></bbb> never allowed. Attribute values must be between quote marks. Example (SVG): <circle cx="10" cy="10" r="5" />. As in HTML, entities are used for some characters. Example: < for < (Starts a tag otherwise). A well-formed document follows the syntactic rules. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

25 XML Specifying valid content Different applications expect different content in their XML files. Several techniques to specify valid content: DD1335 (Lecture 9) Basic Internet Programming Spring / 34

26 XML Specifying valid content Different applications expect different content in their XML files. Several techniques to specify valid content: DTD (document type definition). W3C s first standard. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

27 XML Specifying valid content Different applications expect different content in their XML files. Several techniques to specify valid content: DTD (document type definition). W3C s first standard. XML schemas. W3C s follow-up standard with data types and name spaces. Rich but complicated. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

28 XML Specifying valid content Different applications expect different content in their XML files. Several techniques to specify valid content: DTD (document type definition). W3C s first standard. XML schemas. W3C s follow-up standard with data types and name spaces. Rich but complicated. Several private initiatives, including well-supported Relax NG. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

29 XML Specifying valid content Different applications expect different content in their XML files. Several techniques to specify valid content: DTD (document type definition). W3C s first standard. XML schemas. W3C s follow-up standard with data types and name spaces. Rich but complicated. Several private initiatives, including well-supported Relax NG. An instance document is valid if it satisfies a specification. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

30 XML Document Type Definition DTD for the pricelist example <!ELEMENT pricelist (item*)> <!ELEMENT item (name, price)> <!ELEMENT name (#PCDATA)> <!ELEMENT price (#PCDATA)> DD1335 (Lecture 9) Basic Internet Programming Spring / 34

31 XML Document Type Definition DTD for the pricelist example <!ELEMENT pricelist (item*)> <!ELEMENT item (name, price)> <!ELEMENT name (#PCDATA)> <!ELEMENT price (#PCDATA)> A pricelist element contains any number of item elements. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

32 XML Document Type Definition DTD for the pricelist example <!ELEMENT pricelist (item*)> <!ELEMENT item (name, price)> <!ELEMENT name (#PCDATA)> <!ELEMENT price (#PCDATA)> A pricelist element contains any number of item elements. An item element contains one name and one price element. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

33 XML Document Type Definition DTD for the pricelist example <!ELEMENT pricelist (item*)> <!ELEMENT item (name, price)> <!ELEMENT name (#PCDATA)> <!ELEMENT price (#PCDATA)> A pricelist element contains any number of item elements. An item element contains one name and one price element. The name and price elements consist of parsed character data. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

34 XML Document Type Definition DTD for the pricelist example <!ELEMENT pricelist (item*)> <!ELEMENT item (name, price)> <!ELEMENT name (#PCDATA)> <!ELEMENT price (#PCDATA)> A pricelist element contains any number of item elements. An item element contains one name and one price element. The name and price elements consist of parsed character data. Reference to external DTD in instance document: <!DOCTYPE pricelist SYSTEM "pricelist.dtd"> DD1335 (Lecture 9) Basic Internet Programming Spring / 34

35 Schemas XML XML schemas offer more flexibility than DTDs. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

36 XML Schemas XML schemas offer more flexibility than DTDs. Data types are supported, with several built-in types such as String types Numeric types Types for date and time DD1335 (Lecture 9) Basic Internet Programming Spring / 34

37 XML Schemas XML schemas offer more flexibility than DTDs. Data types are supported, with several built-in types such as String types Numeric types Types for date and time Minimum and maximum values may be specified, sets may be enumerated, etc. Unlike DTDs, schemas are themselves defined in XML. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

38 Name spaces XML You may need to combine parts from different schemas. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

39 Name spaces XML You may need to combine parts from different schemas. Together with schemas, name spaces were introduced to avoid name conflicts. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

40 Name spaces XML You may need to combine parts from different schemas. Together with schemas, name spaces were introduced to avoid name conflicts. A name space is identified with a URL, and used with an arbitrary prefix. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

41 Name spaces XML You may need to combine parts from different schemas. Together with schemas, name spaces were introduced to avoid name conflicts. A name space is identified with a URL, and used with an arbitrary prefix. Note! The URL only serves as a name. There is no requirement on content. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

42 XML Example, name spaces <ica:pricelist xmlns:ica=" </ica:pricelist> DD1335 (Lecture 9) Basic Internet Programming Spring / 34

43 XML Example, name spaces <ica:pricelist xmlns:ica=" </ica:pricelist> Here, xmlns stands for XML name space. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

44 XML Example, name spaces <ica:pricelist xmlns:ica=" </ica:pricelist> Here, xmlns stands for XML name space. Defining a default namespace (no prefix): <pricelist xmlns=" </pricelist> DD1335 (Lecture 9) Basic Internet Programming Spring / 34

45 XML Schema for the pricelist element (1/3) The first part of the schema: <?xml version="1.0"?> <schema xmlns=" xmlns:ica=" targetnamespace=" elementformdefault="unqualified">... DD1335 (Lecture 9) Basic Internet Programming Spring / 34

46 XML Schema for the pricelist element (2/3)... <element name="pricelist"> <complextype> <sequence> <element name="item" type="ica:item" minoccurs="0" maxoccurs="unbounded"> </element> </sequence> </complextype> </element>... DD1335 (Lecture 9) Basic Internet Programming Spring / 34

47 XML Schema for the pricelist element (3/3)... <complextype name="item"> <sequence> <element name="name" type="string" /> <element name="price" type="string" /> </sequence> </complextype> </schema> DD1335 (Lecture 9) Basic Internet Programming Spring / 34

48 XML Comments to the schema With xmlns=" we choose as default name space W3C s schema for schema definition. From there we use the elements schema, element, complextype and sequence, and the type string. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

49 XML Comments to the schema With xmlns=" we choose as default name space W3C s schema for schema definition. From there we use the elements schema, element, complextype and sequence, and the type string. With targetnamespace=" we define the name space of the new pricelist element, as well as the type item. To access this type ourselves, we also had to define the ica prefix. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

50 XML Comments to the schema With xmlns=" we choose as default name space W3C s schema for schema definition. From there we use the elements schema, element, complextype and sequence, and the type string. With targetnamespace=" we define the name space of the new pricelist element, as well as the type item. To access this type ourselves, we also had to define the ica prefix. Regarding elementformdefault="unqualified", see the next slide, and DD1335 (Lecture 9) Basic Internet Programming Spring / 34

51 Using the schema XML Refer like this in the instance document: <?xml version="1.0"?> <ica:pricelist xmlns:ica=" <item> <name>pears</name> <price>12.90</price> </item> </ica:pricelist> DD1335 (Lecture 9) Basic Internet Programming Spring / 34

52 Using the schema XML Refer like this in the instance document: <?xml version="1.0"?> <ica:pricelist xmlns:ica=" <item> <name>pears</name> <price>12.90</price> </item> </ica:pricelist> Note. Only pricelist is name space qualified. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

53 Using the schema XML Refer like this in the instance document: <?xml version="1.0"?> <ica:pricelist xmlns:ica=" <item> <name>pears</name> <price>12.90</price> </item> </ica:pricelist> Note. Only pricelist is name space qualified. With elementformdefault="qualified" all elements would have needed qualification. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

54 Best Practices XML A schema for an organization should perhaps DD1335 (Lecture 9) Basic Internet Programming Spring / 34

55 XML Best Practices A schema for an organization should perhaps work smoothly with other schemas DD1335 (Lecture 9) Basic Internet Programming Spring / 34

56 XML Best Practices A schema for an organization should perhaps work smoothly with other schemas allow updating without making old instance document invalid DD1335 (Lecture 9) Basic Internet Programming Spring / 34

57 XML Best Practices A schema for an organization should perhaps work smoothly with other schemas allow updating without making old instance document invalid allow instance documents to contain extra information DD1335 (Lecture 9) Basic Internet Programming Spring / 34

58 XML Best Practices A schema for an organization should perhaps work smoothly with other schemas allow updating without making old instance document invalid allow instance documents to contain extra information This is not easy to attain. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

59 XML Best Practices A schema for an organization should perhaps work smoothly with other schemas allow updating without making old instance document invalid allow instance documents to contain extra information This is not easy to attain. See advice at DD1335 (Lecture 9) Basic Internet Programming Spring / 34

60 Relax NG XML A simpler schema definition language than that from W3C. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

61 XML Relax NG A simpler schema definition language than that from W3C. Has become an ISO standard (ISO/IEC ) in sept DD1335 (Lecture 9) Basic Internet Programming Spring / 34

62 XML Relax NG A simpler schema definition language than that from W3C. Has become an ISO standard (ISO/IEC ) in sept Two syntaxes: Compact Syntax and an XML syntax. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

63 XML Relax NG A simpler schema definition language than that from W3C. Has become an ISO standard (ISO/IEC ) in sept Two syntaxes: Compact Syntax and an XML syntax. See links at the end of DD1335 (Lecture 9) Basic Internet Programming Spring / 34

64 Schema with Relax NG Compact Syntax XML namespace ica = " element ica:pricelist { element item { element name {text}, element price {text} }* } DD1335 (Lecture 9) Basic Internet Programming Spring / 34

65 Schema with Relax NG Compact Syntax XML namespace ica = " element ica:pricelist { element item { element name {text}, element price {text} }* } The compact form may be translated to the XML form with the java program trang. See DD1335 (Lecture 9) Basic Internet Programming Spring / 34

66 XML Schema with Relax NG XML Syntax <?xml version="1.0"?> <element name="ica:pricelist" xmlns:ica=" xmlns=" <zeroormore> <element name="item"> <element name="name"> <text /> </element> <element name="price"> <text /> </element> </element> </zeroormore> </element> DD1335 (Lecture 9) Basic Internet Programming Spring / 34

67 Validation XML On Unix/Linux xmllint --noout file check for validity, only show errors DD1335 (Lecture 9) Basic Internet Programming Spring / 34

68 Validation XML On Unix/Linux xmllint --noout file check for validity, only show errors --dtdvalid validate against external DTD DD1335 (Lecture 9) Basic Internet Programming Spring / 34

69 Validation XML On Unix/Linux xmllint --noout file check for validity, only show errors --dtdvalid --schema validate against external DTD validate against W3C-schema DD1335 (Lecture 9) Basic Internet Programming Spring / 34

70 Validation XML On Unix/Linux xmllint --noout file check for validity, only show errors --dtdvalid --schema --relaxng validate against external DTD validate against W3C-schema validate against Relax NG schema DD1335 (Lecture 9) Basic Internet Programming Spring / 34

71 Validation XML On Unix/Linux xmllint --noout file check for validity, only show errors --dtdvalid --schema --relaxng validate against external DTD validate against W3C-schema validate against Relax NG schema Web pages such as DD1335 (Lecture 9) Basic Internet Programming Spring / 34

72 The parse tree XML <pricelist> <item> <name>pear</name> <price>12.90</price> </item> <item> <name>apple</name> <price>19.90</price> </item> <pricelist> DD1335 (Lecture 9) Basic Internet Programming Spring / 34

73 The parse tree XML <pricelist> <item> <name>pear</name> <price>12.90</price> </item> <item> <name>apple</name> <price>19.90</price> </item> <pricelist> name pricelist item item price name price DD1335 (Lecture 9) Basic Internet Programming Spring / 34

74 XSL Extensible Stylesheet Language For presentation of XML documents. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

75 XSL Extensible Stylesheet Language For presentation of XML documents. Compare with HTML, which conveys presentational structure by itself. Additional style information may be put in a stylesheet. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

76 XSL Extensible Stylesheet Language For presentation of XML documents. Compare with HTML, which conveys presentational structure by itself. Additional style information may be put in a stylesheet. XML says nothing about presentation. So XSL has three different components: DD1335 (Lecture 9) Basic Internet Programming Spring / 34

77 XSL Extensible Stylesheet Language For presentation of XML documents. Compare with HTML, which conveys presentational structure by itself. Additional style information may be put in a stylesheet. XML says nothing about presentation. So XSL has three different components: XSLT (XSL Transformation) selects elements in the XML file. Can sort, perform tests, etc. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

78 XSL Extensible Stylesheet Language For presentation of XML documents. Compare with HTML, which conveys presentational structure by itself. Additional style information may be put in a stylesheet. XML says nothing about presentation. So XSL has three different components: XSLT (XSL Transformation) selects elements in the XML file. Can sort, perform tests, etc. XPath syntax for positioning in the XML tree. Similar to path notation in a file system. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

79 XSL Extensible Stylesheet Language For presentation of XML documents. Compare with HTML, which conveys presentational structure by itself. Additional style information may be put in a stylesheet. XML says nothing about presentation. So XSL has three different components: XSLT (XSL Transformation) selects elements in the XML file. Can sort, perform tests, etc. XPath syntax for positioning in the XML tree. Similar to path notation in a file system. XSL-FO (XSL Formatting Objects) Page formatting. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

80 XSL Example on XSLT and XPath <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl=" xmlns:ica=" <xsl:template match="/"> <html> <body> <table border="1" cellpadding="5" cellspacing="0"> <tr><th>item</th><th>price</th></tr> <xsl:for-each select="ica:pricelist/item"> <tr><td><xsl:value-of select="name"/></td> <td><xsl:value-of select="price"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> DD1335 (Lecture 9) Basic Internet Programming Spring / 34

81 XSL Comments on the XSLT example <xsl:template match="/"> says that the template should start matching from the root of the XML tree. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

82 XSL Comments on the XSLT example <xsl:template match="/"> says that the template should start matching from the root of the XML tree. For each item in pricelist we then create a row in an HTML table. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

83 XSL Comments on the XSLT example <xsl:template match="/"> says that the template should start matching from the root of the XML tree. For each item in pricelist we then create a row in an HTML table. The row will contain the name and the price of the item. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

84 Referring to the stylesheet(s) in the XML file <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="pricelist.xsl"?> DD1335 (Lecture 9) Basic Internet Programming Spring / 34

85 Referring to the stylesheet(s) in the XML file <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="pricelist.xsl"?> <ica:pricelist xmlns:ica=" <item> <name>pears</name> <price>12.90</price> </item> <item> <name>apples</name> <price>19.90</price> </item> </ica:pricelist> See the result on DD1335 (Lecture 9) Basic Internet Programming Spring / 34

86 XSL Tip XML Put the files in your public_html directory and view them in a web browser the normal way ( DD1335 (Lecture 9) Basic Internet Programming Spring / 34

87 XSL Tip XML Put the files in your public_html directory and view them in a web browser the normal way ( The browser depends on the MIME-type that the server sends in the HTTP heading. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

88 XSL Tip XML Put the files in your public_html directory and view them in a web browser the normal way ( The browser depends on the MIME-type that the server sends in the HTTP heading. With Open File this information is not obtained. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

89 DOM Document Object Model DD1335 (Lecture 9) Basic Internet Programming Spring / 34

90 DOM Document Object Model W3C object oriented APIs for XML documents. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

91 DOM Document Object Model W3C object oriented APIs for XML documents. Access and change a document via the DOM parse tree. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

92 DOM Document Object Model W3C object oriented APIs for XML documents. Access and change a document via the DOM parse tree. Methods such as DD1335 (Lecture 9) Basic Internet Programming Spring / 34

93 DOM Document Object Model W3C object oriented APIs for XML documents. Access and change a document via the DOM parse tree. Methods such as documentelement returns the root node DD1335 (Lecture 9) Basic Internet Programming Spring / 34

94 DOM Document Object Model W3C object oriented APIs for XML documents. Access and change a document via the DOM parse tree. Methods such as documentelement returns the root node childnodes returns all children of a node DD1335 (Lecture 9) Basic Internet Programming Spring / 34

95 DOM Document Object Model W3C object oriented APIs for XML documents. Access and change a document via the DOM parse tree. Methods such as documentelement returns the root node childnodes returns all children of a node attributes returns all attributes of a node DD1335 (Lecture 9) Basic Internet Programming Spring / 34

96 DOM Document Object Model W3C object oriented APIs for XML documents. Access and change a document via the DOM parse tree. Methods such as documentelement returns the root node childnodes returns all children of a node attributes returns all attributes of a node nodetype, nodevalue, etc. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

97 DOM Document Object Model W3C object oriented APIs for XML documents. Access and change a document via the DOM parse tree. Methods such as documentelement returns the root node childnodes returns all children of a node attributes returns all attributes of a node nodetype, nodevalue, etc. removechild, appendchild, etc. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

98 in Java XML JAXP Java API for XML Processing: a common interface to DOM, SAX, and XSLT. SAX: Simple API for XML Processes an XML file while reading through it Fast, memory efficient More complicated than DOM DD1335 (Lecture 9) Basic Internet Programming Spring / 34

99 in Java XML JAXP Java API for XML Processing: a common interface to DOM, SAX, and XSLT. SAX: Simple API for XML Processes an XML file while reading through it Fast, memory efficient More complicated than DOM Many other APIs: JDOM, DOM4J other DOM implementations JAXB converts XML into classes, and vice versa JAXM, JAX-RPC for asynchronous and synchronous messaging DD1335 (Lecture 9) Basic Internet Programming Spring / 34

100 DOM in JAXP XML import javax.xml.parsers.*; import org.w3c.dom.document; // Reads an XML file into a DOM structure. // Usage: java DomExample filename public class DomExample { public static void main(string argv[]) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newdocumentbuilder(); Document document = builder.parse(argv[0]); // Explore the document here. } } DD1335 (Lecture 9) Basic Internet Programming Spring / 34

101 Web services XML Applications available over a network via standard protocols. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

102 Web services XML Applications available over a network via standard protocols. Client-server, as well as peer-to-peer. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

103 Web services XML Applications available over a network via standard protocols. Client-server, as well as peer-to-peer. Typical traditional web service: HTML content, down-loadable with the HTTP protocol. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

104 Web services XML Applications available over a network via standard protocols. Client-server, as well as peer-to-peer. Typical traditional web service: HTML content, down-loadable with the HTTP protocol. New web services: composed of distributed parts that are linked dynamically to run seamlessly. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

105 Web services XML Applications available over a network via standard protocols. Client-server, as well as peer-to-peer. Typical traditional web service: HTML content, down-loadable with the HTTP protocol. New web services: composed of distributed parts that are linked dynamically to run seamlessly. XML plays a key role. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

106 Protocols for new web services DD1335 (Lecture 9) Basic Internet Programming Spring / 34

107 Protocols for new web services SOAP encodes and transmits messages between programs on the web. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

108 Protocols for new web services SOAP encodes and transmits messages between programs on the web. WSDL (Web Services Description Language) XML format to describe web services (operations, messages, types etc). DD1335 (Lecture 9) Basic Internet Programming Spring / 34

109 Protocols for new web services SOAP encodes and transmits messages between programs on the web. WSDL (Web Services Description Language) XML format to describe web services (operations, messages, types etc). UDDI (Universal Description Discovery and Integration) Protocol for distributed registries over web services. Company information like name, category and services. Uses WSDL and SOAP. A program should automatically be able to find and use the services it needs. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

110 SOAP XML Simple Object Access Protocol (a misnomer, not really object oriented). DD1335 (Lecture 9) Basic Internet Programming Spring / 34

111 SOAP XML Simple Object Access Protocol (a misnomer, not really object oriented). Smaller and simpler to implement than earlier distributed protocols, which did not become so wide spread. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

112 SOAP XML Simple Object Access Protocol (a misnomer, not really object oriented). Smaller and simpler to implement than earlier distributed protocols, which did not become so wide spread. Allows programs written in different languages and running on different platforms to communicate. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

113 The SOAP format XML <?xml version="1.0"?> <soap:envelope xmlns:soap=" soap:encodingstyle=" <soap:header>... </soap:header> <soap:body>... </soap:body> </soap:envelope> DD1335 (Lecture 9) Basic Internet Programming Spring / 34

114 Use of SOAP XML The Body element contains the message in XML. Two common cases are document-style for arbitrary documents, and RPC-Style for function calls. The Body element may also contain a Fault element to describe that a fault has occurred. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

115 Use of SOAP XML The Body element contains the message in XML. Two common cases are document-style for arbitrary documents, and RPC-Style for function calls. The Body element may also contain a Fault element to describe that a fault has occurred. The Header element is optional, and intended for instructions to intermediaries on the way to the message destination. Intermediaries may add information, verify payment, etc. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

116 Use of SOAP XML The Body element contains the message in XML. Two common cases are document-style for arbitrary documents, and RPC-Style for function calls. The Body element may also contain a Fault element to describe that a fault has occurred. The Header element is optional, and intended for instructions to intermediaries on the way to the message destination. Intermediaries may add information, verify payment, etc. SOAP is normally sent over HTTP, but other transport protocols (even ) can be used. DD1335 (Lecture 9) Basic Internet Programming Spring / 34

117 Summary XML We have looked at the XML syntax Three ways to specify allowed elements: DTDs, XML schemas and Relax NG Name Spaces XSL for presentation XML support in Java SOAP, WSDL and UDDI for flexible web services DD1335 (Lecture 9) Basic Internet Programming Spring / 34

Delivery Options: Attend face-to-face in the classroom or via remote-live attendance.

Delivery Options: Attend face-to-face in the classroom or via remote-live attendance. XML Programming Duration: 5 Days US Price: $2795 UK Price: 1,995 *Prices are subject to VAT CA Price: CDN$3,275 *Prices are subject to GST/HST Delivery Options: Attend face-to-face in the classroom or

More information

Delivery Options: Attend face-to-face in the classroom or remote-live attendance.

Delivery Options: Attend face-to-face in the classroom or remote-live attendance. XML Programming Duration: 5 Days Price: $2795 *California residents and government employees call for pricing. Discounts: We offer multiple discount options. Click here for more info. Delivery Options:

More information

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 7 XML

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 7 XML Chapter 7 XML 7.1 Introduction extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML Lax syntactical rules Many complex features that are rarely used HTML

More information

Introduction to XML. XML: basic elements

Introduction to XML. XML: basic elements Introduction to XML XML: basic elements XML Trying to wrap your brain around XML is sort of like trying to put an octopus in a bottle. Every time you think you have it under control, a new tentacle shows

More information

7.1 Introduction. extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML

7.1 Introduction. extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML 7.1 Introduction extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML Lax syntactical rules Many complex features that are rarely used HTML is a markup language,

More information

CSI 3140 WWW Structures, Techniques and Standards. Representing Web Data: XML

CSI 3140 WWW Structures, Techniques and Standards. Representing Web Data: XML CSI 3140 WWW Structures, Techniques and Standards Representing Web Data: XML XML Example XML document: An XML document is one that follows certain syntax rules (most of which we followed for XHTML) Guy-Vincent

More information

What is XML? XML is designed to transport and store data.

What is XML? XML is designed to transport and store data. What is XML? XML stands for extensible Markup Language. XML is designed to transport and store data. HTML was designed to display data. XML is a markup language much like HTML XML was designed to carry

More information

XML. Objectives. Duration. Audience. Pre-Requisites

XML. Objectives. Duration. Audience. Pre-Requisites XML XML - extensible Markup Language is a family of standardized data formats. XML is used for data transmission and storage. Common applications of XML include business to business transactions, web services

More information

XML. Jonathan Geisler. April 18, 2008

XML. Jonathan Geisler. April 18, 2008 April 18, 2008 What is? IS... What is? IS... Text (portable) What is? IS... Text (portable) Markup (human readable) What is? IS... Text (portable) Markup (human readable) Extensible (valuable for future)

More information

Web Programming Paper Solution (Chapter wise)

Web Programming Paper Solution (Chapter wise) What is valid XML document? Design an XML document for address book If in XML document All tags are properly closed All tags are properly nested They have a single root element XML document forms XML tree

More information

COPYRIGHTED MATERIAL. Contents. Part I: Introduction 1. Chapter 1: What Is XML? 3. Chapter 2: Well-Formed XML 23. Acknowledgments

COPYRIGHTED MATERIAL. Contents. Part I: Introduction 1. Chapter 1: What Is XML? 3. Chapter 2: Well-Formed XML 23. Acknowledgments Acknowledgments Introduction ix xxvii Part I: Introduction 1 Chapter 1: What Is XML? 3 Of Data, Files, and Text 3 Binary Files 4 Text Files 5 A Brief History of Markup 6 So What Is XML? 7 What Does XML

More information

XML. COSC Dr. Ramon Lawrence. An attribute is a name-value pair declared inside an element. Comments. Page 3. COSC Dr.

XML. COSC Dr. Ramon Lawrence. An attribute is a name-value pair declared inside an element. Comments. Page 3. COSC Dr. COSC 304 Introduction to Database Systems XML Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca XML Extensible Markup Language (XML) is a markup language that allows for

More information

XML: Introduction. !important Declaration... 9:11 #FIXED... 7:5 #IMPLIED... 7:5 #REQUIRED... Directive... 9:11

XML: Introduction. !important Declaration... 9:11 #FIXED... 7:5 #IMPLIED... 7:5 #REQUIRED... Directive... 9:11 !important Declaration... 9:11 #FIXED... 7:5 #IMPLIED... 7:5 #REQUIRED... 7:4 @import Directive... 9:11 A Absolute Units of Length... 9:14 Addressing the First Line... 9:6 Assigning Meaning to XML Tags...

More information

Intro to XML. Borrowed, with author s permission, from:

Intro to XML. Borrowed, with author s permission, from: Intro to XML Borrowed, with author s permission, from: http://business.unr.edu/faculty/ekedahl/is389/topic3a ndroidintroduction/is389androidbasics.aspx Part 1: XML Basics Why XML Here? You need to understand

More information

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

PASS4TEST. IT Certification Guaranteed, The Easy Way!   We offer free update service for one year PASS4TEST IT Certification Guaranteed, The Easy Way! \ http://www.pass4test.com We offer free update service for one year Exam : 000-141 Title : XML and related technologies Vendors : IBM Version : DEMO

More information

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI Department of Information Technology IT6801 SERVICE ORIENTED ARCHITECTURE Anna University 2 & 16 Mark Questions & Answers Year / Semester: IV / VII Regulation:

More information

Lecture 15: Frameworks for Application-layer Communications

Lecture 15: Frameworks for Application-layer Communications Lecture 15: Frameworks for Application-layer Communications Prof. Shervin Shirmohammadi SITE, University of Ottawa Fall 2005 CEG 4183 15-1 Background We have seen previously that: Applications need to

More information

Lecture 15: Frameworks for Application-layer Communications

Lecture 15: Frameworks for Application-layer Communications Lecture 15: Frameworks for Application-layer Communications Prof. Shervin Shirmohammadi SITE, University of Ottawa Fall 2005 CEG 4183 15-1 Background We have seen previously that: Applications need to

More information

Introduction to XML Zdeněk Žabokrtský, Rudolf Rosa

Introduction to XML Zdeněk Žabokrtský, Rudolf Rosa NPFL092 Technology for Natural Language Processing Introduction to XML Zdeněk Žabokrtský, Rudolf Rosa November 28, 2018 Charles Univeristy in Prague Faculty of Mathematics and Physics Institute of Formal

More information

Java EE 7: Back-end Server Application Development 4-2

Java EE 7: Back-end Server Application Development 4-2 Java EE 7: Back-end Server Application Development 4-2 XML describes data objects called XML documents that: Are composed of markup language for structuring the document data Support custom tags for data

More information

Notes. Any feedback/suggestions? IS 651: Distributed Systems

Notes. Any feedback/suggestions? IS 651: Distributed Systems Notes Grading statistics Midterm1: average 10.60 out of 15 with stdev 2.22 Total: average 15.46 out of 21 with stdev 2.80 A range: [18.26, 23] B range: [12.66, 18.26) C or worse range: [0, 12.66) The curve

More information

7.1 Introduction. 7.1 Introduction (continued) - Problem with using SGML: - SGML is a meta-markup language

7.1 Introduction. 7.1 Introduction (continued) - Problem with using SGML: - SGML is a meta-markup language 7.1 Introduction - SGML is a meta-markup language - Developed in the early 1980s; ISO std. In 1986 - HTML was developed using SGML in the early 1990s - specifically for Web documents - Two problems with

More information

XML: Extensible Markup Language

XML: Extensible Markup Language XML: Extensible Markup Language CSC 375, Fall 2015 XML is a classic political compromise: it balances the needs of man and machine by being equally unreadable to both. Matthew Might Slides slightly modified

More information

SDPL : XML Basics 2. SDPL : XML Basics 1. SDPL : XML Basics 4. SDPL : XML Basics 3. SDPL : XML Basics 5

SDPL : XML Basics 2. SDPL : XML Basics 1. SDPL : XML Basics 4. SDPL : XML Basics 3. SDPL : XML Basics 5 2 Basics of XML and XML documents 2.1 XML and XML documents Survivor's Guide to XML, or XML for Computer Scientists / Dummies 2.1 XML and XML documents 2.2 Basics of XML DTDs 2.3 XML Namespaces XML 1.0

More information

Chapter 7: XML Namespaces

Chapter 7: XML Namespaces 7. XML Namespaces 7-1 Chapter 7: XML Namespaces References: Tim Bray, Dave Hollander, Andrew Layman: Namespaces in XML. W3C Recommendation, World Wide Web Consortium, Jan 14, 1999. [http://www.w3.org/tr/1999/rec-xml-names-19990114],

More information

The main Topics in this lecture are:

The main Topics in this lecture are: Lecture 15: Working with Extensible Markup Language (XML) The main Topics in this lecture are: - Brief introduction to XML - Some advantages of XML - XML Structure: elements, attributes, entities - What

More information

COMP9321 Web Application Engineering

COMP9321 Web Application Engineering COMP9321 Web Application Engineering Semester 2, 2017 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 http://webapps.cse.unsw.edu.au/webcms2/course/index.php?cid= 2465 1

More information

XML. Presented by : Guerreiro João Thanh Truong Cong

XML. Presented by : Guerreiro João Thanh Truong Cong XML Presented by : Guerreiro João Thanh Truong Cong XML : Definitions XML = Extensible Markup Language. Other Markup Language : HTML. XML HTML XML describes a Markup Language. XML is a Meta-Language. Users

More information

Introduction to XML the Language of Web Services

Introduction to XML the Language of Web Services Introduction to XML the Language of Web Services Tony Obermeit Senior Development Manager, Wed ADI Group Oracle Corporation Introduction to XML In this presentation, we will be discussing: 1) The origins

More information

XML. Technical Talk. by Svetlana Slavova. CMPT 842, Feb

XML. Technical Talk. by Svetlana Slavova. CMPT 842, Feb XML Technical Talk by Svetlana Slavova 1 Outline Introduction to XML XML vs. Serialization Curious facts, advantages & weaknesses XML syntax Parsing XML Example References 2 Introduction to XML (I) XML

More information

M359 Block5 - Lecture12 Eng/ Waleed Omar

M359 Block5 - Lecture12 Eng/ Waleed Omar Documents and markup languages The term XML stands for extensible Markup Language. Used to label the different parts of documents. Labeling helps in: Displaying the documents in a formatted way Querying

More information

DEVELOPING A MESSAGE PARSER TO BUILD THE TEST CASE GENERATOR

DEVELOPING A MESSAGE PARSER TO BUILD THE TEST CASE GENERATOR CHAPTER 3 DEVELOPING A MESSAGE PARSER TO BUILD THE TEST CASE GENERATOR 3.1 Introduction In recent times, XML messaging has grabbed the eyes of everyone. The importance of the XML messages with in the application

More information

.. Cal Poly CPE/CSC 366: Database Modeling, Design and Implementation Alexander Dekhtyar..

.. Cal Poly CPE/CSC 366: Database Modeling, Design and Implementation Alexander Dekhtyar.. .. Cal Poly CPE/CSC 366: Database Modeling, Design and Implementation Alexander Dekhtyar.. XML in a Nutshell XML, extended Markup Language is a collection of rules for universal markup of data. Brief History

More information

XSL Languages. Adding styles to HTML elements are simple. Telling a browser to display an element in a special font or color, is easy with CSS.

XSL Languages. Adding styles to HTML elements are simple. Telling a browser to display an element in a special font or color, is easy with CSS. XSL Languages It started with XSL and ended up with XSLT, XPath, and XSL-FO. It Started with XSL XSL stands for EXtensible Stylesheet Language. The World Wide Web Consortium (W3C) started to develop XSL

More information

XML for Java Developers G Session 3 - Main Theme XML Information Modeling (Part I) Dr. Jean-Claude Franchitti

XML for Java Developers G Session 3 - Main Theme XML Information Modeling (Part I) Dr. Jean-Claude Franchitti XML for Java Developers G22.3033-002 Session 3 - Main Theme XML Information Modeling (Part I) Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical

More information

COMP9321 Web Application Engineering. Extensible Markup Language (XML)

COMP9321 Web Application Engineering. Extensible Markup Language (XML) COMP9321 Web Application Engineering Extensible Markup Language (XML) Dr. Basem Suleiman Service Oriented Computing Group, CSE, UNSW Australia Semester 1, 2016, Week 4 http://webapps.cse.unsw.edu.au/webcms2/course/index.php?cid=2442

More information

Chapter 1: Getting Started. You will learn:

Chapter 1: Getting Started. You will learn: Chapter 1: Getting Started SGML and SGML document components. What XML is. XML as compared to SGML and HTML. XML format. XML specifications. XML architecture. Data structure namespaces. Data delivery,

More information

XML for Java Developers G Session 3 - Main Theme XML Information Modeling (Part I) Dr. Jean-Claude Franchitti

XML for Java Developers G Session 3 - Main Theme XML Information Modeling (Part I) Dr. Jean-Claude Franchitti XML for Java Developers G22.3033-002 Session 3 - Main Theme XML Information Modeling (Part I) Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical

More information

2010 Martin v. Löwis. Data-centric XML. Other Schema Languages

2010 Martin v. Löwis. Data-centric XML. Other Schema Languages Data-centric XML Other Schema Languages Problems of XML Schema According to Schematron docs: No support for entities idiomatic or localized data types (date, time) not supported limited support for element

More information

COMP9321 Web Application Engineering

COMP9321 Web Application Engineering COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 http://webapps.cse.unsw.edu.au/webcms2/course/index.php?cid=2411 1 Extensible

More information

XML for Java Developers G Session 8 - Main Theme XML Information Rendering (Part II) Dr. Jean-Claude Franchitti

XML for Java Developers G Session 8 - Main Theme XML Information Rendering (Part II) Dr. Jean-Claude Franchitti XML for Java Developers G22.3033-002 Session 8 - Main Theme XML Information Rendering (Part II) Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical

More information

11. EXTENSIBLE MARKUP LANGUAGE (XML)

11. EXTENSIBLE MARKUP LANGUAGE (XML) 11. EXTENSIBLE MARKUP LANGUAGE (XML) Introduction Extensible Markup Language is a Meta language that describes the contents of the document. So these tags can be called as self-describing data tags. XML

More information

Introduction to XML. M2 MIA, Grenoble Université. François Faure

Introduction to XML. M2 MIA, Grenoble Université. François Faure M2 MIA, Grenoble Université Example tove jani reminder dont forget me this weekend!

More information

CSC Web Technologies, Spring Web Data Exchange Formats

CSC Web Technologies, Spring Web Data Exchange Formats CSC 342 - Web Technologies, Spring 2017 Web Data Exchange Formats Web Data Exchange Data exchange is the process of transforming structured data from one format to another to facilitate data sharing between

More information

Extreme Java G Session 3 - Sub-Topic 5 XML Information Rendering. Dr. Jean-Claude Franchitti

Extreme Java G Session 3 - Sub-Topic 5 XML Information Rendering. Dr. Jean-Claude Franchitti Extreme Java G22.3033-007 Session 3 - Sub-Topic 5 XML Information Rendering Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences 1 Agenda

More information

XML Processing & Web Services. Husni Husni.trunojoyo.ac.id

XML Processing & Web Services. Husni Husni.trunojoyo.ac.id XML Processing & Web Services Husni Husni.trunojoyo.ac.id Based on Randy Connolly and Ricardo Hoar Fundamentals of Web Development, Pearson Education, 2015 Objectives 1 XML Overview 2 XML Processing 3

More information

SOAP, WSDL, HTTP, XML, XSD, DTD, UDDI - what the?

SOAP, WSDL, HTTP, XML, XSD, DTD, UDDI - what the? SOAP, WSDL, HTTP, XML, XSD, DTD, UDDI - what the? By Aaron Bartell Copyright Aaron Bartell 2013 by Aaron Bartell aaron@mowyourlawn.com Agenda Why are we at this point in technology? XML Holding data the

More information

XML. extensible Markup Language. Overview. Overview. Overview XML Components Document Type Definition (DTD) Attributes and Tags An XML schema

XML. extensible Markup Language. Overview. Overview. Overview XML Components Document Type Definition (DTD) Attributes and Tags An XML schema XML extensible Markup Language An introduction in XML and parsing XML Overview XML Components Document Type Definition (DTD) Attributes and Tags An XML schema 3011 Compiler Construction 2 Overview Overview

More information

Part 2: XML and Data Management Chapter 6: Overview of XML

Part 2: XML and Data Management Chapter 6: Overview of XML Part 2: XML and Data Management Chapter 6: Overview of XML Prof. Dr. Stefan Böttcher 6. Overview of the XML standards: XML, DTD, XML Schema 7. Navigation in XML documents: XML axes, DOM, SAX, XPath, Tree

More information

Structured documents

Structured documents Structured documents An overview of XML Structured documents Michael Houghton 15/11/2000 Unstructured documents Broadly speaking, text and multimedia document formats can be structured or unstructured.

More information

World-Wide Wide Web. Netprog HTTP

World-Wide Wide Web. Netprog HTTP Web Services Based partially on Sun Java Tutorial at http://java.sun.com/webservices/ Also, XML, Java and the Future of The Web, Jon Bosak. And WSDL Tutorial at: http://www.w3schools.com/wsdl wsdl/ 1 World-Wide

More information

Introduction to Web Services

Introduction to Web Services Introduction to Web Services SWE 642, Spring 2008 Nick Duan April 9, 2008 1 Overview What are Web Services? A brief history of WS Basic components of WS Advantages of using WS in Web application development

More information

XML Overview, part 1

XML Overview, part 1 XML Overview, part 1 Norman Gray Revision 1.4, 2002/10/30 XML Overview, part 1 p.1/28 Contents The who, what and why XML Syntax Programming with XML Other topics The future http://www.astro.gla.ac.uk/users/norman/docs/

More information

XML. Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior

XML. Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior XML Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior XML INTRODUCTION 2 THE XML LANGUAGE XML: Extensible Markup Language Standard for the presentation and transmission of information.

More information

Week 5 Aim: Description. Source Code

Week 5 Aim: Description. Source Code Week 5 Aim: Write an XML file which will display the Book information which includes the following: 1) Title of the book 2) Author Name 3) ISBN number 4) Publisher name 5) Edition 6) Price Write a Document

More information

DOM Interface subset 1/ 2

DOM Interface subset 1/ 2 DOM Interface subset 1/ 2 Document attributes documentelement methods createelement, createtextnode, Node attributes nodename, nodevalue, nodetype, parentnode, childnodes, firstchild, lastchild, previoussibling,

More information

Introduction Syntax and Usage XML Databases Java Tutorial XML. November 5, 2008 XML

Introduction Syntax and Usage XML Databases Java Tutorial XML. November 5, 2008 XML Introduction Syntax and Usage Databases Java Tutorial November 5, 2008 Introduction Syntax and Usage Databases Java Tutorial Outline 1 Introduction 2 Syntax and Usage Syntax Well Formed and Valid Displaying

More information

The XML Metalanguage

The XML Metalanguage The XML Metalanguage Mika Raento mika.raento@cs.helsinki.fi University of Helsinki Department of Computer Science Mika Raento The XML Metalanguage p.1/442 2003-09-15 Preliminaries Mika Raento The XML Metalanguage

More information

9.3.5 Accessing the Vote Service

9.3.5 Accessing the Vote Service jws1_09_article.fm Page 228 Friday, August 9, 2002 11:45 AM Chapter 9 Java API for XML-Based Remote Procedure Calls (JAX-RPC) 228 9.3.5 Accessing the Vote Service Once a Web service is deployed, a client

More information

XML. XML Namespaces, XML Schema, XSLT

XML. XML Namespaces, XML Schema, XSLT XML XML Namespaces, XML Schema, XSLT Contents XML Namespaces... 2 Namespace Prefixes and Declaration... 3 Multiple Namespace Declarations... 4 Declaring Namespaces in the Root Element... 5 Default Namespaces...

More information

CountryData Technologies for Data Exchange. Introduction to XML

CountryData Technologies for Data Exchange. Introduction to XML CountryData Technologies for Data Exchange Introduction to XML What is XML? EXtensible Markup Language Format is similar to HTML, but XML deals with data structures, while HTML is about presentation Open

More information

Chapter 2 XML, XML Schema, XSLT, and XPath

Chapter 2 XML, XML Schema, XSLT, and XPath Summary Chapter 2 XML, XML Schema, XSLT, and XPath Ryan McAlister XML stands for Extensible Markup Language, meaning it uses tags to denote data much like HTML. Unlike HTML though it was designed to carry

More information

Extensible Markup Language (XML) Hamid Zarrabi-Zadeh Web Programming Fall 2013

Extensible Markup Language (XML) Hamid Zarrabi-Zadeh Web Programming Fall 2013 Extensible Markup Language (XML) Hamid Zarrabi-Zadeh Web Programming Fall 2013 2 Outline Introduction XML Structure Document Type Definition (DTD) XHMTL Formatting XML CSS Formatting XSLT Transformations

More information

Introduction to Semistructured Data and XML. Overview. How the Web is Today. Based on slides by Dan Suciu University of Washington

Introduction to Semistructured Data and XML. Overview. How the Web is Today. Based on slides by Dan Suciu University of Washington Introduction to Semistructured Data and XML Based on slides by Dan Suciu University of Washington CS330 Lecture April 8, 2003 1 Overview From HTML to XML DTDs Querying XML: XPath Transforming XML: XSLT

More information

Extensible Markup Stylesheet Transformation (XSLT)

Extensible Markup Stylesheet Transformation (XSLT) Extensible Markup Stylesheet Transformation (XSLT) Asst. Prof. Dr. Kanda Runapongsa Saikaew (krunapon@kku.ac.th) Dept. of Computer Engineering Khon Kaen University 1 Overview Terms: XSL, XSLT, XSL-FO Value

More information

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 27-1

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 27-1 Slide 27-1 Chapter 27 XML: Extensible Markup Language Chapter Outline Introduction Structured, Semi structured, and Unstructured Data. XML Hierarchical (Tree) Data Model. XML Documents, DTD, and XML Schema.

More information

Exam : Title : XML 1.1 and Related Technologies. Version : DEMO

Exam : Title : XML 1.1 and Related Technologies. Version : DEMO Exam : 000-142 Title : XML 1.1 and Related Technologies Version : DEMO 1. XML data is stored and retrieved within a relational database for a data-centric application by means of mapping XML schema elements

More information

Author: Irena Holubová Lecturer: Martin Svoboda

Author: Irena Holubová Lecturer: Martin Svoboda NPRG036 XML Technologies Lecture 1 Introduction, XML, DTD 19. 2. 2018 Author: Irena Holubová Lecturer: Martin Svoboda http://www.ksi.mff.cuni.cz/~svoboda/courses/172-nprg036/ Lecture Outline Introduction

More information

Document Parser Interfaces. Tasks of a Parser. 3. XML Processor APIs. Document Parser Interfaces. ESIS Example: Input document

Document Parser Interfaces. Tasks of a Parser. 3. XML Processor APIs. Document Parser Interfaces. ESIS Example: Input document 3. XML Processor APIs How applications can manipulate structured documents? An overview of document parser interfaces 3.1 SAX: an event-based interface 3.2 DOM: an object-based interface Document Parser

More information

XML and XSLT. XML and XSLT 10 February

XML and XSLT. XML and XSLT 10 February XML and XSLT XML (Extensible Markup Language) has the following features. Not used to generate layout but to describe data. Uses tags to describe different items just as HTML, No predefined tags, just

More information

SDMX self-learning package XML based technologies used in SDMX-IT TEST

SDMX self-learning package XML based technologies used in SDMX-IT TEST SDMX self-learning package XML based technologies used in SDMX-IT TEST Produced by Eurostat, Directorate B: Statistical Methodologies and Tools Unit B-5: Statistical Information Technologies Last update

More information

Session 23 XML. XML Reading and Reference. Reading. Reference: Session 23 XML. Robert Kelly, 2018

Session 23 XML. XML Reading and Reference. Reading. Reference: Session 23 XML. Robert Kelly, 2018 Session 23 XML Reading XML Reading and Reference https://en.wikipedia.org/wiki/xml Reference: XML in a Nutshell (Ch. 1-3), available in Safari On-line 2 1 Lecture Objectives Understand the goal of application

More information

Web Services. Grid Computing (M) Lecture 6. Olufemi Komolafe 19 January 2007

Web Services. Grid Computing (M) Lecture 6. Olufemi Komolafe 19 January 2007 Web Services Grid Computing (M) Lecture 6 Olufemi Komolafe (femi@dcs.gla.ac.uk) 19 January 2007 UDDI registry retrieved from a DTD WSDL service definition XML schema definition is a describes structure

More information

Markup Languages SGML, HTML, XML, XHTML. CS 431 February 13, 2006 Carl Lagoze Cornell University

Markup Languages SGML, HTML, XML, XHTML. CS 431 February 13, 2006 Carl Lagoze Cornell University Markup Languages SGML, HTML, XML, XHTML CS 431 February 13, 2006 Carl Lagoze Cornell University Problem Richness of text Elements: letters, numbers, symbols, case Structure: words, sentences, paragraphs,

More information

Data Presentation and Markup Languages

Data Presentation and Markup Languages Data Presentation and Markup Languages MIE456 Tutorial Acknowledgements Some contents of this presentation are borrowed from a tutorial given at VLDB 2000, Cairo, Agypte (www.vldb.org) by D. Florescu &.

More information

extensible Markup Language

extensible Markup Language extensible Markup Language XML is rapidly becoming a widespread method of creating, controlling and managing data on the Web. XML Orientation XML is a method for putting structured data in a text file.

More information

XML Introduction 1. XML Stands for EXtensible Mark-up Language (XML). 2. SGML Electronic Publishing challenges -1986 3. HTML Web Presentation challenges -1991 4. XML Data Representation challenges -1996

More information

CHAPTER 2 LITERATURE SURVEY 2. FIRST LOOK ON WEB SERVICES Web Services

CHAPTER 2 LITERATURE SURVEY 2. FIRST LOOK ON WEB SERVICES Web Services CHAPTER 2 LITERATURE SURVEY 2. FIRST LOOK ON WEB SERVICES 2.1. Web Services Usually web service can be understood as a way of message transfer among two devices across a network. The idea behind using

More information

Notes. Submit homework on Blackboard The first homework deadline is the end of Sunday, Feb 11 th. Final slides have 'Spring 2018' in chapter title

Notes. Submit homework on Blackboard The first homework deadline is the end of Sunday, Feb 11 th. Final slides have 'Spring 2018' in chapter title Notes Ask course content questions on Slack (is651-spring-2018.slack.com) Contact me by email to add you to Slack Make sure you checked Additional Links at homework page before you ask In-class discussion

More information

Presentation 19: XML technologies part 2: XSL, XSLT, XSL-FO, XPath & XML Programming

Presentation 19: XML technologies part 2: XSL, XSLT, XSL-FO, XPath & XML Programming Presentation 19: XML technologies part 2: XSL, XSLT, XSL-FO, XPath & XML Programming Outline XML recap Formatting CSS or XSL? XPath XSL/XSLT XSL-FO XML Programming Slide 2 XML markup recap XML based on

More information

extensible Markup Language (XML) Basic Concepts

extensible Markup Language (XML) Basic Concepts (XML) Basic Concepts Giuseppe Della Penna Università degli Studi di L Aquila dellapenna@univaq.it http://www.di.univaq.it/gdellape This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike

More information

XML. Marie Dubremetz Uppsala, April 2014

XML. Marie Dubremetz Uppsala, April 2014 XML Marie Dubremetz marie.dubremetz@lingfil.uu.se Uppsala, April 2014 Presentation Plan 1 Introduction 2 XML Specificities and Motivations 3 XML: Vocabulary and Techniques Uppsala May 2015 2/37 Table of

More information

languages for describing grammar and vocabularies of other languages element: data surrounded by markup that describes it

languages for describing grammar and vocabularies of other languages element: data surrounded by markup that describes it XML and friends history/background GML (1969) SGML (1986) HTML (1992) World Wide Web Consortium (W3C) (1994) XML (1998) core language vocabularies, namespaces: XHTML, RSS, Atom, SVG, MathML, Schema, validation:

More information

IT2353 WEB TECHNOLOGY Question Bank UNIT I 1. What is the difference between node and host? 2. What is the purpose of routers? 3. Define protocol. 4.

IT2353 WEB TECHNOLOGY Question Bank UNIT I 1. What is the difference between node and host? 2. What is the purpose of routers? 3. Define protocol. 4. IT2353 WEB TECHNOLOGY Question Bank UNIT I 1. What is the difference between node and host? 2. What is the purpose of routers? 3. Define protocol. 4. Why are the protocols layered? 5. Define encapsulation.

More information

INLS 760 Web Databases Lecture 12 XML, XPATH, XSLT

INLS 760 Web Databases Lecture 12 XML, XPATH, XSLT INLS 760 Web Databases Lecture 12 XML, XPATH, XSLT Robert Capra Spring 2013 Note: These lecture notes are based on the tutorials on XML, XPath, and XSLT at W3Schools: http://www.w3schools.com/ and from

More information

but XML goes far beyond HTML: it describes data

but XML goes far beyond HTML: it describes data The XML Meta-Language 1 Introduction to XML The father of markup languages: XML = EXtensible Markup Language is a simplified version of SGML Originally created to overcome the limitations of HTML the HTML

More information

IT6801-SERVICE ORIENTED ARCHITECTURE

IT6801-SERVICE ORIENTED ARCHITECTURE ST.JOSEPH COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING IT 6801-SERVICE ORIENTED ARCHITECTURE UNIT I 2 MARKS 1. Define XML. Extensible Markup Language(XML) is a markup language

More information

KINGS COLLEGE OF ENGINEERING 1

KINGS COLLEGE OF ENGINEERING 1 KINGS COLLEGE OF ENGINEERING Department of Computer Science & Engineering Academic Year 2011 2012(Odd Semester) QUESTION BANK Subject Code/Name: CS1401-Internet Computing Year/Sem : IV / VII UNIT I FUNDAMENTALS

More information

1.264 Lecture 14. SOAP, WSDL, UDDI Web services

1.264 Lecture 14. SOAP, WSDL, UDDI Web services 1.264 Lecture 14 SOAP, WSDL, UDDI Web services Front Page Demo File->New Web (must create on CEE server) Choose Web type Add navigation using Format->Shared Borders (frames) Use top and left, include navigation

More information

XML Structures. Web Programming. Uta Priss ZELL, Ostfalia University. XML Introduction Syntax: well-formed Semantics: validity Issues

XML Structures. Web Programming. Uta Priss ZELL, Ostfalia University. XML Introduction Syntax: well-formed Semantics: validity Issues XML Structures Web Programming Uta Priss ZELL, Ostfalia University 2013 Web Programming XML1 Slide 1/32 Outline XML Introduction Syntax: well-formed Semantics: validity Issues Web Programming XML1 Slide

More information

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING SHRI ANGALAMMAN COLLEGE OF ENGINEERING & TECHNOLOGY (An ISO 9001:2008 Certified Institution) SIRUGANOOR,TRICHY-621105. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year/Sem: IV / VII CS1401 INTERNET

More information

Chapter 13 XML: Extensible Markup Language

Chapter 13 XML: Extensible Markup Language Chapter 13 XML: Extensible Markup Language - Internet applications provide Web interfaces to databases (data sources) - Three-tier architecture Client V Application Programs Webserver V Database Server

More information

Display the XML Files for Disclosure to Public by Using User-defined XSL Zhiping Yan, BeiGene, Beijing, China Huadan Li, BeiGene, Beijing, China

Display the XML Files for Disclosure to Public by Using User-defined XSL Zhiping Yan, BeiGene, Beijing, China Huadan Li, BeiGene, Beijing, China PharmaSUG China 2018 Paper CD-72 Display the XML Files for Disclosure to Public by Using User-defined XSL Zhiping Yan, BeiGene, Beijing, China Huadan Li, BeiGene, Beijing, China ABSTRACT US Food and Drug

More information

Xerces Http Apache Org Xml Features Validation Schema Full Checking

Xerces Http Apache Org Xml Features Validation Schema Full Checking Xerces Http Apache Org Xml Features Validation Schema Full Checking Hi, Apache Jena uses a feature of Xerces 2 for validating strings that claim to be setfeature("apache.org/xml/features/validation/schema-full-checking".

More information

XML extensible Markup Language

XML extensible Markup Language extensible Markup Language Eshcar Hillel Sources: http://www.w3schools.com http://java.sun.com/webservices/jaxp/ learning/tutorial/index.html Tutorial Outline What is? syntax rules Schema Document Object

More information

Software Engineering Methods, XML extensible Markup Language. Tutorial Outline. An Example File: Note.xml XML 1

Software Engineering Methods, XML extensible Markup Language. Tutorial Outline. An Example File: Note.xml XML 1 extensible Markup Language Eshcar Hillel Sources: http://www.w3schools.com http://java.sun.com/webservices/jaxp/ learning/tutorial/index.html Tutorial Outline What is? syntax rules Schema Document Object

More information

Style Sheet A. Bellaachia Page: 22

Style Sheet A. Bellaachia Page: 22 Style Sheet How to render the content of an XML document on a page? Two mechanisms: CSS: Cascading Style Sheets XSL (the extensible Style sheet Language) CSS Definitions: CSS: Cascading Style Sheets Simple

More information

Session [2] Information Modeling with XSD and DTD

Session [2] Information Modeling with XSD and DTD Session [2] Information Modeling with XSD and DTD September 12, 2000 Horst Rechner Q&A from Session [1] HTML without XML See Code HDBMS vs. RDBMS What does XDR mean? XML-Data Reduced Utilized in Biztalk

More information

Copyright 2005, by Object Computing, Inc. (OCI). All rights reserved. Database to Web

Copyright 2005, by Object Computing, Inc. (OCI). All rights reserved. Database to Web Database To Web 10-1 The Problem Need to present information in a database on web pages want access from any browser may require at least HTML 4 compatibility Want to separate gathering of data from formatting

More information

XML Technologies. Doc. RNDr. Irena Holubova, Ph.D. Web pages:

XML Technologies. Doc. RNDr. Irena Holubova, Ph.D. Web pages: XML Technologies Doc. RNDr. Irena Holubova, Ph.D. holubova@ksi.mff.cuni.cz Web pages: http://www.ksi.mff.cuni.cz/~holubova/nprg036/ Outline Introduction to XML format, overview of XML technologies DTD

More information