You are on page 1of 45

INSTRUCTIONAL MODULE AND ITS COMPONENTS

COURSE IPT Integrative Programming Technologies


DEVELOPER AND THEIR Carlos P. Flores Jr.
BACKGROUND BSIT Faculty
cpfloresjr@tsu.edu.ph

Christian Jose Santos


BSIT Faculty
cjsantos@tsu.edu.ph
COURSE DESCRIPTION This course examines the integration of systems and applications
across global businesses; explores programming interfaces, data
mapping and exchange, scripting, and programming languages to
support the configuration, maintenance, integration, and security of
systems.
COURSE OUTLINE
A. Overview of Programming Languages -
History of programming languages,
Programming paradigms, Effects of
scale
B. Compiled vs. interpretative languages,
Application vs. scripting languages
C. Integrative Coding – Inheritance
D. Integrative Coding – Polymorphism
E. Integrative Coding – Interfaces
F. Integrative Coding - Design Patterns
G. Network Programming
H.
I. Midterm Exam
J. Data Mapping and Exchange -
Metadata Data representation and
encoding HTML
K. Data Mapping and Exchange - XML,
DTD, schemas Parsing XML
documents
L. Data Mapping and Exchange - XSL,
XSLT and XPath
M.
N. Inter-systems Communications -
Architectures for integrating systems
O. Inter-systems Communications - RMI
P. Inter-systems Communications - Virtual
Machines
Q. Inter-systems Communications - Web
Services and Middleware
R. Final Exam

Network Programming 1 of 45
CHAPTER 9
TITLE Data Mapping and Exchange - Metadata Data representation and
encoding HTML
I. RATIONALE Metadata is a new word based on an old concept. Any summary of the
contents of a library or archive, like a card catalog, contains metadata.
It is the preferred term of the technical community to refer to ``card-
catalog'' data, and it will, therefore, become increasingly used as more
technical tools are developed for linguistic research. This purpose of
this module is to provide introduction describing what metadata is, how
metadata presented and how metadata applied in HTML.
INSTRUCTION TO THE USERS Lectures are on this module. PowerPoint materials are on a separate
file.
PRE-TEST Let us first assess your prior knowledge regarding this lesson. You
need to recognize the concepts which you already know and
those which you need to reinforce and enrich so that you would
know how to equip and prepare yourself for the tasks ahead.

From your own understanding what is metadata and where did you find
metadata before?

II. LEARNING At the end of the chapter, students are expected to:
OBJECTIVES a. Understand the principles and practicalities of Metadata

b. Learn the syntax and semantics of Metadata

III. CONTENT

A. DEVELOPMENTA
L ACTIVITIES What is Metadata?

Metadata is structured information that describes, explains locates,


or otherwise makes it easier to retrieve, use, or manage an
information resource. Metadata is often called data about data or
information about information. The term metadata is used differently
in different communities. Some use it to refer to machine
understandable information, while others use it only for records
that describe electronic resources. In the library environment,
metadata is commonly used for any formalscheme of resource
description,applying to any type of object, digitalor non-digital.
Traditional librarycataloging is a form of metadata;MARC 21 and
the rule sets usedwith it, such as AACR2, aremetadata
standards.

There are three main types of metadata:

 Descriptive metadata describes a resource for purposes such

Network Programming 2 of 45
as discovery and identification. It can include elements
such as title, abstract, author, and keywords.

 Structural metadata indicates how compound objects are


put together, for example, how pages are ordered to form
chapters.

 Administrative metadata pro-vides information to help


manage a resource, such as when and how it was created,
filetype and other technical information, and who can
access it. There are several subsets of administrative data;
two that sometimes are listed as separate metadata types are:

− Rights management meta-data, which deals with


intellectual property rights, and

− Preservation metadata, which contains information


needed to archive and preserve are source.

Metadata can describe re-sources at any level of aggregation. It can


describe a collection, a single resource, or a component part of a larger
resource (for example, a photograph in an article). Just as
catalogers make decisions about whether a catalog record should be
created for a whole set of volumes or for each particular volume in the
set, so the metadata creator makes similar decisions.

A citation like the one below, is a form of metadata:

Bloomfield, Leonard. 1933. Language. New York: Holt, Rinehart &


Winston.

The reference above is information about a book--that is, data about


data.

Something important to note about a reference like the one above is


that we understand the information it is trying to convey by convention.
The first element is the author's name, then the year, then the title,
then the city and publisher. Also, our knowledge of the basic structure
of references allows us to be fairly sure this citation refers to a book.

Another way of representing the metadata in the above reference


would be as follows:

Network Programming 3 of 45
Metadata can be embedded in a digital object or it can be stored
separately. Metadata is often embedded in HTML documents and in
the headers of image files. Storing metadata with the object it
describes ensures the metadata will not be lost, obviates problems
of linking between data and metadata ,and helps ensure that the
metadata and object will be updated together. However, it is impossible
to embed metadata in some types of objects(for example, artifacts).
Also, storing metadata separately can simplify the management of
the metadata itself and facilitate search and retrieval. Therefore,
metadata is commonly stored in a database system and linked to
the objects described.

The metadata embedded in websites is critically important to the


success of the site. It includes a description of the website, keywords,
metatags, and more — all of which play a role in search results.

Some common metadata terms used when building a web page


include meta title and meta description. The meta title briefly explains
the topic of the page to help readers understand what they'll get from
the page should they open it. The meta description is further
information, though brief, about the contents of the page.

HTML - encoded metadata accounts for the majority of metadata


embedded within Web resources (and hence available for harvesting).
This approach has the great virtue of simplicity (no additional systems
are necessary—Web infrastructure provides the system in the form of
HTML markup and http protocols), but it limits the structural richness of
the metadata assertions that can be made.

XML markup, while still a small part of the total markup on the Web, is

Network Programming 4 of 45
the idiom of choice for the encoding and exchange of structured data.
The XML namespace facility provides structural capabilities that HTML
lacks, making it easier to achieve the principles of modularity and
extensibility. The XML Schema specification defines a schema
language that allows for the specification of application profiles that will
increase the prospects for interoperability.

HTML lets you specify metadata - additional important information


about a document in a variety of ways. The META elements can be
used to include name/value pairs describing properties of the HTML
document, such as author, expiry date, a list of keywords, document
author etc.

The <meta> tag is used to provide such additional information. This tag
is an empty element and so does not have a closing tag but it carries
information within its attributes.

You can include one or more meta tags in your document based on
what information you want to keep in your document but in general,
meta tags do not impact physical appearance of the document so from
appearance point of view, it does not matter if you include them or not.

Example of metadata in HTML


<!DOCTYPE html>
<html>

<head>
<title>IPT 1</title>
<meta name = "keywords" content = "IPT
METADATA TOPIC" />
<meta name = "description" content =
"Learning about Meta Tags." />
</head>

<body>
<p>I’m a paragraph</p>
</body>

</html>

- The following code will produce the following result

I’m a paragraph

Network Programming 5 of 45
You can add metadata to your web pages by placing <meta> tags
inside the header of the document which is represented by <head> and
</head> tags. A meta tag can have following attributes in addition to
core attributes –

 Name - Name for the property. Can be anything. Examples


include, keywords, description, author, revised, generator etc.

 Content - Specifies the property's value.

 Scheme - Specifies a scheme to interpret the property's value


(as declared in the content attribute).

 http-equiv - Used for http response message headers. For


example, http-equiv can be used to refresh the page or to set a
cookie. Values include content-type, expires, refresh and set-
cookie.

A charset attribute is new in HTML5. The charset is used to provide the


character support. The charset attribute specifies the character
encoding which is in an external script file.

Cookies are data, stored in small text files on your computer and it is
exchanged between web browser and web server to keep track of
various information based on your web application need.

You can use <meta> tag to store cookies on client side and later this
information can be used by the Web Server to track a site visitor.

<!DOCTYPE html>

<html>

<head>

<title>Meta Tags Example</title>

<meta http-equiv = "cookie" content = "userid = ccs; expires =


Sunday, 23-Aug-2020 20:17:04 GMT;" />

</head>

Network Programming 6 of 45
<body>

<p>HTML5 setting cookies</p>

</body>

</html>

Author name

You can set an author name in a web page using meta tag.

<!DOCTYPE html>

<html>

<head>

<title>Meta Tags Example</title>

<meta name = "keywords" content = "HTML, Meta Tags, Metadata"


/>

<meta name = "description" content = "Learning about Meta Tags."


/>

<meta name = "author" content = "TSU-CCS" />

</head>

<body>

<p>HTML5 with metadata</p>

</body>

</html>

There are various ways to associate metadata with resources:

Embedded metadata resides within the markup of the resource. This

Network Programming 7 of 45
implies that the metadata is created at the time that the resource is
created, often by the author. Experts differ concerning whether author-
created metadata is best or whether it is better to have trained
practitioners evaluate and describe resources. As a practical matter,
resource description expertise is a scarce and costly commodity, and
thus any investment by authors in the description of their intellectual
products is likely to be of value.

Embedded metadata can also be harvested, and the presumptive


increase in visibility that might result is an incentive for creators to
assign metadata. Early studies of the efficacy of such metadata are
only recently becoming available.

Associated metadata is maintained in files tightly coupled to the


resources they describe. Such metadata may or may not be
harvestable. The advantage of associated metadata derives from the
relative ease of managing the metadata without altering the content of
the resource itself, but this benefit is purchased at the cost of simplicity,
necessitating the co-management of resource files and metadata files.

Third-Party metadata is maintained in a separate repository by an


organization that may or may not have direct control over or access to
the content of the resource. Typically such metadata is maintained in a
database that is not accessible to harvesters, though the emerging
Open Archives Initiative Metadata Harvesting Protocol proposes a
system that encourages the disclosure of metadata repositories among
federated OAI servers.

B. CLOSURE As a closing activity, on a piece of paper summarize what you have


ACTIVTIES learned in your own words.
IV. SYNTHESIS /
GENERALIZATION Metadata is a key part of the information infrastructure necessary to
help create order in the chaos of the Web, infusing description,
classification, and organization to help create more useful stores of
information. Sources of metadata, like the sources of the resources
themselves, will be of different quality and organized around different
purposes to reflect the different objectives and business models of
information providers. The social policies, organizational priorities, and
market forces that shape the information spaces of the Web will
undoubtedly create unforeseen opportunities and niches.

Network Programming 8 of 45
V. EVALUATION Instructions: Select the best answer to the following multiple choice
questions about metadata.

1. The following is about metadata.


a. It is corrupted data
b. It significantly increases file size
c. It compressed the file
d. It is data about data

2. Metadata is used in following files


a. All of these
b. MP3
c. Images
d. Webpages

3. In which part of the HTML metadata is contained?


a. body tag
b. html tag
c. head tag
d. title tag

4. Which of the following is not supported in HTML5?


a. scheme
b. content
c. http-equiv
d. name

5. Metadata store information about the web page that is not


necessarily visible to end users.
a. True
b. False

6. What is the role of charset attribute? It specifies


a. a scheme to be used to interpret the value of the content
attribute
b. a name for the metadata
c. the character encoding for the HTML document
d. the character decoding for the HTML document

7. Can also be harvested, and the presumptive increase in


visibility that might result is an incentive for creators to assign
metadata.
a. External metadata
b. Embedded metadata
c. Associated metadata
d. Third-party metadata
8. This attribute of meta tag specifies the property's value.
Network Programming 9 of 45
a. http-equiv
b. name
c. content
d. scheme
9. HTML elements can be used to include name/value pairs
describing properties of the HTML document, such as author,
expiry date, a list of keywords, document author etc. .
a. head
b. title
c. meta
d. body
10. Type of metadata that describes a resource for purposes such
as discovery and identification. It can include elements
such as title, abstract, author, and keywords.
a. Preservation
b. Administrative
c. Structural
d. Descriptive

VI. ASSIGNMENT /
AGREEMENT It was mentioned earlier that in some cases, servers themselves may
become clients at various times. Give examples of cases that servers
also function as clients.

REFERENCES https://www.lter.uaf.edu/metadata_files/UnderstandingMetadata.pdf
http://www.dlib.org/dlib/april02/weibel/04weibel.html
http://csapp.cs.cmu.edu/2e/ch11-preview.pdf
https://www.tutorialspoint.com/html/html_meta_tags.htm
http://www.language-archives.org/documents/gentle-intro.html

INSTRUCTIONAL MODULE AND ITS COMPONENTS

COURSE IPT Integrative Programming Technologies


DEVELOPER AND THEIR Carlos P. Flores Jr.
BACKGROUND BSIT Faculty
cpfloresjr@tsu.edu.ph

Christian Jose Santos


BSIT Faculty
cjsantos@tsu.edu.ph
COURSE DESCRIPTION This course examines the integration of systems and applications
across global businesses; explores programming interfaces, data
mapping and exchange, scripting, and programming languages to
support the configuration, maintenance, integration, and security of

Network Programming 10 of 45
systems.
COURSE OUTLINE
S. Overview of Programming Languages -
History of programming languages,
Programming paradigms, Effects of
scale
T. Compiled vs. interpretative languages,
Application vs. scripting languages
U. Integrative Coding – Inheritance
V. Integrative Coding – Polymorphism
W. Integrative Coding – Interfaces
X. Integrative Coding - Design Patterns
Y. Network Programming
Z.
AA. Midterm Exam
BB. Data Mapping and Exchange -
Metadata Data representation and
encoding HTML
CC. Data Mapping and Exchange - XML,
DTD, schemas Parsing XML
documents
DD. Data Mapping and Exchange - XSL,
XSLT and XPath
EE.
FF. Inter-systems Communications -
Architectures for integrating systems
GG. Inter-systems
Communications - RMI
HH. Inter-systems Communications - Virtual
Machines
II. Inter-systems Communications - Web
Services and Middleware
JJ. Final Exam
CHAPTER 10
TITLE Data Mapping and Exchange - XML, DTD, schemas Parsing XML
documents
VII. RATIONALE XML data is known as self-describing or self-defining, meaning that
the structure of the data is embedded with the data, thus when the
data arrives there is no need to pre-build the structure to store the
data; it is dynamically understood within the XML. The XML format
can be used by any individual or group of individuals or companies
that want to share information in a consistent way.
INSTRUCTION TO THE Lectures are on this module. PowerPoint materials are on a separate
USERS file.
PRE-TEST Let us first assess your prior knowledge regarding this lesson.
You need to recognize the concepts which you already know
and those which you need to reinforce and enrich so that you

Network Programming 11 of 45
would know how to equip and prepare yourself for the tasks
ahead.

From your own understanding what is XML and can you create a
web page using XML alone?
VIII. LEARNING At the end of the chapter, students are expected to:
OBJECTIVES c. Understand the importance of XML validators

d. Apply DTDs in XML documents

e. Describe how to validate XML documents using XML schemas

f. Discuss ways on how to parse XML documents

IX. CONTENT

C. DEVELOPMEN
TAL What is XML?
ACTIVITIES
 XML stands for EXtensible Markup Language

 XML is a markup language much like HTML

 XML was designed to describe data, not to display


data

 XML tags are not predefined. You must define your


own tags

 XML is designed to be self-descriptive

 XML is a W3C Recommendation

The Difference Between XML and HTML

XML is not a replacement for HTML.XML and HTML were designed


with different goals:

XML was designed to describe data, with focus on what data is.

HTML was designed to display data, with focus on how data looks

HTML is about displaying information, while XML is about carrying


information.

XML Does Not DO Anything

Network Programming 12 of 45
Maybe it is a little hard to understand, but XML does not DO
anything. The following example is a note to IPT students from CCS
as XML:

<note>

<to> IPT Students </to>

<from> CCS </from>

<heading> Reminder </heading>

<body> Don’t forget your activity this week </body>

</note>

The note above is quite self descriptive. It has sender and receiver
information, it also has a heading and a message body. But still, this
XML document does not DO anything. It is just information wrapped
in tags. Someone must write a piece of software to send, receive or
display it.

With XML You Invent Your Own Tags

The tags in the example above (like <to> and <from>) are not
defined in any XML standard. These tags are "invented" by the
author of the XML document. That is because the XML language
has no predefined tags.

The tags used in HTML are predefined. HTML documents can only
use tags defined in the HTML standard (like <p>, <h1>, etc.).XML
allows the author to define his/her own tags and his/her own
document structure.

There are nine basic rules for building good XML:

1. All XML must have a root element.

A root element is simply a set of tags that contains your


XML content.

2. All tags must be closed.

When a tag is declared (opened), it must also be closed.


Any unclosed tags will break the code. Even tags that don’t
need to be closed in HTML must be closed in XML or
XHTML.

Network Programming 13 of 45
3. All tags must be properly nested.

When you insert (nest) one tag within another, pay attention
to the order in which you open each tag, and then close the
tags in the reverse order. If you open element A and then
element B, you must first close B before closing A. Even
HTML tags that usually will work without a strict structure
must follow the stricter XML rules when they’re used within
an XML file.

4. Tag names have strict limits.

Tag names can’t start with the letters xml, a number, or


punctuation, except for the underscore character (_).

5. Tag names are case sensitive.

Uppercase and lowercase matter in XML. Opening and


closing tags must match exactly. For example, <IPT>, <IPt>,
and <ipt> are three different tags.

6. Tag names cannot contain spaces.

Spaces in tag names can cause all sorts of problems with


data-intensive applications, so they’re prohibited in XML.

7. Attribute values must appear within quotes ("").

Attribute values modify a tag or help identify the type of


information being tagged. If you’re a web designer, you may
be used to the flexibility of HTML, in which some attributes
don’t require quotes. In XML, all attribute values must
appear within quotes. For example:

<chapter number="1">

<artist title="author" nationality="USA">

8. White space is preserved.

If you’re in the habit of adding extra spaces and hard returns


in your HTML code, watch out! Such spacing is honored by
XML and can play havoc with your applications. Use extra
spacing judiciously.

9. HTML tags should be avoided (optional).

Because you can name tags anything you want, you could
Network Programming 14 of 45
use tags reserved for HTML markup, such as <h1>, <p>,
<li>, and so on. Although permissible in XML, avoid using
such tag names unless you want the data to be formatted
that way when it’s viewed in a browser window.

XML is Not a Replacement for HTML

XML is a complement to HTML .It is important to understand that


XML is not a replacement for HTML. In most web applications, XML
is used to describe data, while HTML is used to format and display
the data.

An example of XML Document

<?xml version =”1.0” encoding =”UTF-8”?>

<note>

<to> IPT Students </to>

<from> CCS </from>

<heading> Reminder </heading>

<body> Don’t forget your activity this week </body>

</note>

The first line is the XML declaration. It defines the XML version (1.0).

The next line describes the root element of the document (like
saying: "this document is a note"):

</note>

The next 4 lines describe 4 child elementsofthe root (to, from,


heading, and body):

<to> IPT Students </to>

<from> CCS </from>

<heading> Reminder </heading>

Network Programming 15 of 45
<body> Don’t forget your activity this week </body>

And finally the last line defines the end of the root element:

</note>

You can assume, from this example, that the XML document
contains a note to IPT Students from CCS.

XML Documents Form a Tree Structure

XML documents must contain a root element. This element is "the


parent" of all other elements. The elements in an XML document
form a document tree. The tree starts at the root and branches to the
lowest level of the tree.

All elements can have sub elements (child elements):


<root>

<child>

<subchild>.....</subchild>

</child>

</root>

The terms parent, child, and sibling are used to describe the
relationships between elements. Parent elements have children.
Children on the same level are called siblings (brothers or sisters).All
elements can have text content and attributes (just like in HTML).

Entity References

Some characters have a special meaning in XML. If you place a


character like "<" inside an XML element, it will generate an error
because the parser interprets it as the start of a new element.

This will generate an XML error:

<message>if salary < 1000 then</message>

To avoid this error, replace the "<" character with an entity reference:

<message>if salary &lt; 1000 then</message>

There are 5 pre-defined entity references in XML:

Network Programming 16 of 45
Predefined Entity Symbol Meaning
References

&lt; < less than

&gt; > greater than

&amp; & ampersand

&apos; ‘ apostrophe

'&quot; “ quotation mark

Note: Only the characters "<" and "&" are strictly illegal in XML. The
greater than character is legal, but it is a good habit to replace it.

Comments in XML

The syntax for writing comments in XML is similar to that of HTML.

<!--This is a comment -->

What is an XML Element?

An XML element is everything from (including) the element's start


tag to (including) the element's end tag.

An element can contain:

 other elements

 text

 attributes

 or a mix of all of the above...

Empty XML Elements

An element with no content is said to be empty. In XML, you can

Network Programming 17 of 45
indicate an empty element like this:

<element></element>

or you can use an empty tag, like this (this sort of element syntax is
called self-closing):

<element/>

The two forms above produce identical results in an XML parser.

Note: Empty elements do not have any content, but they can have
attributes!

Valid XML Documents

A "valid" XML document is not the same as a "well formed" XML


document. A "valid" XML document must be well formed. In addition
it must conform to a document type definition.

Rules that defines the legal elements and attributes for XML
documents are called Document Type Definitions (DTD)or XML
Schemas.

There are two different document type definitions that can be used
with XML:

 DTD -The original Document Type Definition

 XML Schema -An XML-based alternative to DTD

When to Use a DTD/Schema?

With a DTD, independent groups of people can agree to use a


standard DTD for interchanging data. Your application can use a
standard DTD to verify that the data you receive from the outside
world is valid. You can also use a DTD to verify your own data.

What is a DTD?

A DTD is a Document Type Definition.

A DTD defines the structure and the legal elements and attributes of

Network Programming 18 of 45
an XML document.

Why Use a DTD?

With a DTD, independent groups of people can agree on a standard


DTD for interchanging data.

An application can use a DTD to verify that XML data is valid.

XML document with an internal DTD

<?xml version="1.0"?>

<!DOCTYPE note [

<!ELEMENT note (to,from,heading,body)>

<!ELEMENT to (#PCDATA)>

<!ELEMENT from (#PCDATA)>

<!ELEMENT heading (#PCDATA)>

<!ELEMENT body (#PCDATA)>

]>

<note>

<to>Tove</to>

<from>Jani</from>

<heading>Reminder</heading>

<body>Don't forget me this weekend</body>

</note>

The DTD above is interpreted like this:

 !DOCTYPE note defines that the root element of this


document is note

Network Programming 19 of 45
 !ELEMENT note defines that the note element must
contain four elements: "to,from,heading,body"

 !ELEMENT to defines the to element to be of type


"#PCDATA"

 !ELEMENT from defines the from element to be of type


"#PCDATA"

 !ELEMENT heading defines the heading element to be of


type "#PCDATA"

 !ELEMENT body defines the body element to be of type


"#PCDATA"

If the DTD is declared in an external file, the <!DOCTYPE> definition


must contain a reference to the DTD file:

XML document with a reference to an external DTD

<?xml version="1.0"?>

<!DOCTYPE note SYSTEM "note.dtd">

<note>

<to>Tove</to>

<from>Jani</from>

<heading>Reminder</heading>

<body>Don't forget me this weekend!</body>

</note>

And here is the file "note.dtd", which contains the DTD:

<!ELEMENT note (to,from,heading,body)>

<!ELEMENT to (#PCDATA)>

<!ELEMENT from (#PCDATA)>

<!ELEMENT heading (#PCDATA)>

Network Programming 20 of 45
<!ELEMENT body (#PCDATA)>

When to NOT to Use a DTD/Schema?

XML does not require a DTD/Schema.

When you are experimenting with XML, or when you are working
with small XML files, creating DTDs may be a waste of time. If you
develop applications, wait until the specification is stable before you
add a document definition. Otherwise, your software might stop
working because of validation errors.

XML Validator

To help you check your xml files, you can go to this URL and paste
your code

https://www.xmlvalidation.com/

XML Schema

An XML Schema describes the structure of an XML document, just


like a DTD.

An XML document with correct syntax is called "Well Formed".

An XML document validated against an XML Schema is both "Well


Formed" and "Valid".

XML Schema is an XML-based alternative to DTD:

<xs:element name="note">

<xs:complexType>

<xs:sequence>

<xs:element name=”to” type=”xs:string”/>

<xs:element name=”from” type=”xs:string”/>

<xs:element name=”heading” type=”xs:string”/>

<xs:element name=”body” type=”xs:string”/>

Network Programming 21 of 45
</xs:sequence>

</xs:complexType>

</xs:element>

The Schema above is interpreted like this:

 <xs:element name="note"> defines the element called


"note"

 <xs:complexType> the "note" element is a complex type

 <xs:sequence> the complex type is a sequence of elements

 <xs:element name="to"type="xs:string"> the element "to" is


of type string (text)

 <xs:element name="from"type="xs:string"> the element


"from" is of type string

 <xs:element name="heading"type="xs:string"> the element


"heading" is of type string

 <xs:element name="body"type="xs:string"> the element


"body" is of type string

Everything is wrapped in "Well Formed" XML.

Why Use an XML Schema?

With XML Schema, your XML files can carry a description of its own
format.

With XML Schema, independent groups of people can agree on a


standard for interchanging data.

With XML Schema, you can verify data.

XML Schemas Support Data Types

One of the greatest strength of XML Schemas is the support for data
types:

 It is easier to describe document content

 It is easier to define restrictions on data

Network Programming 22 of 45
 It is easier to validate the correctness of data

 It is easier to convert data between different data types

XML Schemas use XML Syntax

Another great strength about XML Schemas is that they are written
in XML:

 You don't have to learn a new language

 You can use your XML editor to edit your Schema files

 You can use your XML parser to parse your Schema files

 You can manipulate your Schemas with the XML DOM

 You can transform your Schemas with XSLT

D. CLOSURE As a closing activity, look for new or old sales invoice or official
ACTIVTIES receipt from any store. Open a text editor in your computer then
create a XML document about the sales invoice or official receipt.
X. SYNTHESIS /
GENERALIZATIO XML data is quickly and easily built, does not in itself require
N programming skills and is readily transferred between applications –
which is possible because of the shared set of structural rules that
are understood in each different context. All of this combined with
the ability to define your own structures in XML makes a data
storage and transfer model that is useful for a wide range of projects.

XI. EVALUATION Instructions: Select the best answer to the following multiple choice
questions about XML,DTD and XML Schema.

1. What is the correct declation syntax for the version of an


XML document?
a. </xml version="1.0"/>
b. <?xml version="1.0"/?>
c. <xml version="1.0">
d. none of the above
2. How is an empty XML element defined?
a. <sample></sample>
b. <sample/>
c. All of the above
d. None of the above
3. Which syntax is used to insert comments into an XML

Network Programming 23 of 45
document?
a. <comment>This is a comment</comment>
b. <?-This is a comment->
c. <!-This is a comment->
d. None of the above
4. Which statement is true?
a. All XML documents must have a DTD
b. All XML elements must be lower case
c. All XML elements must be properly closed
d. All of the above
5. Which statement is true?
a. XML tags are case sensitive
b. XML documents must have a root tag
c. XML elements must be properly closed
d. All of the above
6. Which is not a correct name for an XML documents?
a. <Note>
b. <h1>
c. <1dollar>
d. All 3 names are incorrect
7. Which is not a correct name for an XML element?
a. <age>
b. <NAME>
c. <first name>
d. All three names are incorrect
8. XML is a _______ Recommendation
a. Microsoft
b. Sun
c. W3C
d. None of the above
9. XML is?
a. Free and Extensible
b. Not Extensible
c. A stylesheet
d. None of these
10. XML Schema is designed to
a. be self-descriptive
b. display only useful data
c. carrying request
d. giving response

XII. ASSIGNMENT /
AGREEMENT It was mentioned earlier that in some cases, servers themselves
may become clients at various times. Give examples of cases that
servers also function as clients.

Network Programming 24 of 45
REFERENCES https://www2.cs.duke.edu/courses/fall14/compsci316/lectures/12-
xml-notes.pdf
https://web.csulb.edu/~pnguyen/cecs475/pdf/Introduction%20to
%20XML.pdf

INSTRUCTIONAL MODULE AND ITS COMPONENTS

COURSE IPT Integrative Programming Technologies


DEVELOPER AND THEIR Carlos P. Flores Jr.
BACKGROUND BSIT Faculty
cpfloresjr@tsu.edu.ph

Christian Jose Santos


BSIT Faculty
cjsantos@tsu.edu.ph
COURSE DESCRIPTION This course examines the integration of systems and applications
across global businesses; explores programming interfaces, data
mapping and exchange, scripting, and programming languages to
support the configuration, maintenance, integration, and security of
systems.
COURSE OUTLINE
KK. Overview of Programming Languages -
History of programming languages,
Programming paradigms, Effects of
scale
LL. Compiled vs. interpretative languages,
Application vs. scripting languages
MM. Integrative Coding –
Inheritance
NN. Integrative Coding – Polymorphism
OO. Integrative Coding –
Interfaces
PP. Integrative Coding - Design Patterns
QQ. Network Programming
RR.
SS. Midterm Exam
TT. Data Mapping and Exchange -
Metadata Data representation and
encoding HTML
UU. Data Mapping and Exchange - XML,
DTD, schemas Parsing XML
documents
VV. Data Mapping and Exchange - XSL,
XSLT and XPath
WW.
Network Programming 25 of 45
XX. Inter-systems Communications -
Architectures for integrating systems
YY. Inter-systems Communications - RMI
ZZ. Inter-systems Communications - Virtual
Machines
AAA. Inter-systems
Communications - Web Services and
Middleware
BBB. Final Exam
CHAPTER 11
TITLE Data Mapping and Exchange - XSL, XSLT and XPath
XIII. RATIONALE In a nutshell: XSL is a W3Cspecificationthat describes a method for
visually presenting XML documents. XSL is an alternative to CSS
that allows greater control over the presentation of the XML data.
INSTRUCTION TO THE Lectures are on this module. PowerPoint materials are on a separate
USERS file.
PRE-TEST Let us first assess your prior knowledge regarding this lesson.
You need to recognize the concepts which you already know
and those which you need to reinforce and enrich so that you
would know how to equip and prepare yourself for the tasks ahead.

RETURN HERE
XIV. LEARNING At the end of the chapter, students are expected to:
OBJECTIVES g. Understanding the eXtensible Stylesheet Language (XSL) and
how it provides a means to transform and format the contents of
XML documents.

h. Discuss Xpath functions and discover how XPath and XSLT can
significantly reduce the complexity of Java code when handling
XML documents

XV. CONTENT

E. DEVELOPMEN
TAL XSL
ACTIVITIES
XSL is an alternative to CSS that allows greater control over the
presentation of the XML data.

What can it do?

- [like CSS] allow changing presentation without changing the


XML source, and display documents on various media,

- also: I18N features (writing modes, text alignment,

Network Programming 26 of 45
hyphenation), complex page layout, footnotes, automatic
generation of content (index)

Who is it for?

Applications that require high-level quality formatting:

- Publishing industry (books, technical documentation)

- Publication on different media: paper, web, mobile devices .

But is it not meant to be used where presentation is deeply tied to


the contents (like graphic design).

Example I: Hamlet

<ACT>

<SCENE>

<TITLE>A room in the castle.</TITLE>

<STAGEDIR>Enter KING CLAUDIUS, QUEEN


GERTRUDE,POLONIUS, OPHELIA, ROSENCRANTZ, and
GUILDENSTERN
</STAGEDIR>

<SPEECH speaker="King Claudius">

<LINE>And can you, by no drift of circumstance,</LINE>

<LINE>Get from him why he puts on this confusion,</LINE>

<LINE>Grating so harshly all his days of quiet</LINE>

<LINE>With turbulent and dangerous lunacy?</LINE>

</SPEECH>

</ACT>

Formatted for paper output(PDF), formatted for the Web(XHTML)

Example II: Database

Network Programming 27 of 45
...

<record year="1992">

<artist>Sundays, The</artist>

<title>Blind</title>

</record>

<record year="1994">

<artist>(Various)</artist>

<title>The Glory of Gershwin</title>

<note>Compilation</note>

</record>

<record type="soundtrack" year="1992">

<artist>Kamen, Michael</artist>

<title>Brazil</title>

<location folder="3" page="20"/>

</record>

...

 An XSL stylesheet is an XML File

 It is associated to an XML document with a Stylesheet


Processing Instruction(like CSS)

 The actual formatting is performed either off-line or on the


browser

Network Programming 28 of 45
The XSL Process

The result tree is an XML document in which the markup has


information about how to display the document: what font to use, the
size of a page, etc. This markup is called Formatting Objects
(elements) and Properties (attributes).

For example:

Generated from:

XSL uses CSS properties to express formatting information, and


uses the CSS inheritance model.

Network Programming 29 of 45
 XSL can import images and other types of known XML
documents: SVG and MathML.

 Up to the renderer to handle other namespaces

Transformations: XSLT

XSLT is a transformation language originally designed to transform


any XML document into another XML document containing
formatting objects: pages, blocks, graphics, text, etc.

General-purpose XSLT

XSLT has evolved to become a general-purpose transformation


language from XML to XML.

Many users use it to transform their own XML document type to


HTML for viewing within a browser

Network Programming 30 of 45
 XSLT stylesheets use XML syntax

 A stylesheet is a list of templates

Templates

 Each template applies to a type of nodes in the input


document.

 When matches are made, the templates contains desired


output.

So this will transform:

<TITLE>Hamlet</TITLE>
into

HTML can also be generated very simply in the template, using for
instance<h1>instead of<fo:block>

<xsl:apply-templates/>means: apply other templates to contents.

Implicit rule: text is copied from input to output: a style sheet with no
rules will only return the character data of the input.

XSLT statements

Allow navigation and iteration within the input document tree

 <xsl:value-of select="..."/>Gets a value (node contents or


attribute) from the input tree.

 <xsl:for-each select="...">Loops over the nodes in the select

Network Programming 31 of 45
expression

 <xsl:if test="...">...</xsl:if>Conditional

XPath

 ... is anotherW3C specification;

 an expression language to selects parts of an XML


document tree;

 is used in<xsl:template match="...">or<xsl:value-of


select="...">, etc.;

 and can be as simple as TITLE, or as complex as

/ACT[3]/SCENE[position() &lt; 5 and position() &gt;

2]/SPEAKER[@name="Hamlet"]/

LINE[contains(.,"shoe box")]

Formatting Objects basics

 the FO vocabulary is one special type of output from XSLT

 FOs are organized as an XML tree:

 Each node has associated properties, either directly


specified (by attributes) or inherited

Pages

 A page is divided in 5 regions: body, before, after, start and


end

Network Programming 32 of 45
The area model

 On the page will be layed out areas, that contain text,


images and other areas. An area is a rectangle, with
padding and border:

Block/inline areas

The concept of relative orientation and writing-modes. Where


CSS defines top, bottom, left, right, XSL adds before, after, start
and end. Areas can be of type: block or inline. Blocks are
stacked from the 'before' side to the 'after' side, inlines are

Network Programming 33 of 45
stacked orthogonally.

Formatting Objects:

Define the layout

fo:layout-master-set

fo:page-master

fo:page-sequencel

Generate areas

fo:block

fo:inline

fo:character

Other

fo:page-number

fo:external-graphics

Properties

Network Programming 34 of 45
 Each area has a set of traits: color, background, font-size,
etc.

 Areas are inherited down the FO tree using the CSS


inheritance model

 They are specified in the source as attributes associated to


Formatting Objects.

Status of the specifications

 XSLT 1.0 and XPath 1.0 are W3C recommendations

 Requirement documents for XSLT2.0 and XPath2.0


areavailablelXPath2.0 is now being developed (with XML
Query)

 XSL 1.0 (FO) is a Candidate Recommendation

Implementations

 Many implementations of XSLT1.0 exist: xt, Saxon, Oracle,


Sun, Mozilla, (client side), MSXML (client side), Lotus,
Unicorn, libxml, most of them free

 XSL 1.0: 7+ implementations: RenderX, Antenna House,


FOP (does SVG), PassiveTeX (does MathML), etc.

The Future

 XSL 1.0 will move to Recommendation

 Interoperability: include SVG and MathML in XSL.

 Applications: publishers will be able to put publications on


the web as easily as printing them

F. CLOSURE As a closing activity, apply XSL and XSLT on your previous activity
ACTIVTIES in XML.
XVI. SYNTHESIS /
GENERALIZATIO XSL is a family of recommendations for defining XML document

Network Programming 35 of 45
N
transformation and presentation. An XSLT stylesheet specifies the
presentation of a class of XML documents by describing how an
instance of the class is transformed into an XML document that uses
a formatting vocabulary, such as (X)HTML or XSL-FO.

XVII. EVALUATION Instructions: Select the best answer to the following multiple choice
questions about XSL, XSLT and XPath.

11. What is the correct declation syntax for the version of an


XML document?
a. </xml version="1.0"/>
b. <?xml version="1.0"/?>
c. <xml version="1.0">
d. none of the above

XVIII. ASSIGNMENT /
AGREEMENT It was mentioned earlier that in some cases, servers themselves
may become clients at various times. Give examples of cases that
servers also function as clients.

REFERENCES https://www.w3.org/People/maxf/XSLideMaker/tut.pdf
https://web.csulb.edu/~pnguyen/cecs475/pdf/Introduction%20to
%20XML.pdf

INSTRUCTIONAL MODULE AND ITS COMPONENTS

COURSE IPT Integrative Programming Technologies


DEVELOPER AND THEIR Carlos P. Flores Jr.
BACKGROUND BSIT Faculty
cpfloresjr@tsu.edu.ph

Christian Jose Santos


BSIT Faculty
cjsantos@tsu.edu.ph
COURSE DESCRIPTION This course examines the integration of systems and applications
across global businesses; explores programming interfaces, data
mapping and exchange, scripting, and programming languages to
support the configuration, maintenance, integration, and security of
systems.
COURSE OUTLINE
CCC. Overview of Programming

Network Programming 36 of 45
Languages - History of programming
languages, Programming paradigms,
Effects of scale
DDD. Compiled vs. interpretative
languages, Application vs. scripting
languages
EEE. Integrative Coding –
Inheritance
FFF. Integrative Coding –
Polymorphism
GGG. Integrative Coding –
Interfaces
HHH. Integrative Coding - Design
Patterns
III. Network Programming
JJJ.
KKK. Midterm Exam
LLL. Data Mapping and Exchange -
Metadata Data representation and
encoding HTML
MMM. Data Mapping and Exchange -
XML, DTD, schemas Parsing XML
documents
NNN. Data Mapping and Exchange -
XSL, XSLT and XPath
OOO.
PPP. Inter-systems
Communications - Architectures for
integrating systems
QQQ. Inter-systems
Communications - RMI
RRR. Inter-systems
Communications - Virtual Machines
SSS. Inter-systems
Communications - Web Services and
Middleware
TTT. Final Exam
CHAPTER 12
TITLE Inter-systems Communications - Architectures for integrating systems
XIX. RATIONALE The wave of recent corporate mergers and growth of business on
the Internet have boosted enterprise systems integration's profile in
both IT and business. All these factors have contributed to enterprise
integration's importance, but the marketplace conditions of today's
open, collaborative-based economy are still the major reasons why
companies choose an integrated solution. Companies that can
provide information when it is needed, or that can quickly devise and
roll out new products and services, are today's leading

Network Programming 37 of 45
organizations.
INSTRUCTION TO THE Lectures are on this module. PowerPoint materials are on a separate
USERS file.
PRE-TEST Let us first assess your prior knowledge regarding this lesson.
You need to recognize the concepts which you already know
and those which you need to reinforce and enrich so that you
would know how to equip and prepare yourself for the tasks
ahead.

RETURN HERE
XX. LEARNING At the end of the chapter, students are expected to:
OBJECTIVES i. Understand how system integration works to make two
systems communicate.

j. Discuss the different types or architectures of system


integration.

XXI. CONTENT

G. DEVELOPMEN
TAL Introduction
ACTIVITIES
Many systems are built to easy, improve and transform
organizations. Some organizations have many departments which
run systems which are independent of each other. And systems built
sometimes, may not have an abstract view (architecture) which
leads to failure of system interoperability. There is need to have
architectural view of the system as a priority to help in the design to
avoid the likeliness of system failure. Besides after the system has
been designed and developed in consideration of the size of the
organization, i.e. most especially when the organization is large,
need is required to integrate such systems to ensure flexibility,
Speed, Cost , Standardization, Data integrity, reliability and
robustness. This can help Information Technology (IT), energy, and
financial services industry among others to have an easy-to-use
integrated system.

What you need to know

Systems Integration (SI) process, approaches, drivers, tools and


techniques required for successful SI, critical success factors, and
best practices.

What students need to learn

Network Programming 38 of 45
The theory and practice of business process integration, legacy
integration, new systems integration, business-to-business
integration, integration of commercial-off-the-shelf (COTS) products,
interface control and management, testing, integrated program
management, integrated Business Continuity Planning (BCP).

System

An array of components designed to accomplish a particular


objective according to plan. Many sub-systems many be designed
which later on are combined together to form a system which is
intended to achieve a specific objective which may be set by the
Project manager.

System Thinking

Is a way of understanding an entity in terms of its purpose, as three


steps The three major steps followed in systems thinking

1. Identify a containing whole (system), of which the thing to be


explained is a part.

2. Explain the behavior or properties of the containing whole.

3. Explain the behavior or properties of the thing to be explained in


terms of its role(s)or function(s) within its containing whole (Ackoff,
1981)

System Integration

Is the combination of inter-related elements to achieve a common


objective (s).

System Architecture

The architecture of a system defines its high-level structure,


exposing its gross organization as a collection of interacting
components. Elements needed to model a software architecture
include: Components, Connectors, Systems, Properties and Styles.

What is a project?

Network Programming 39 of 45
From the key terms described above, a system developer and
architects cannot do anything without first establishing various
projects. These projects may be new or existing. So it is inevitable to
first understand what a project is, factors that influence the project,
who the owners are and many more as discussed below.

A project is a temporary endeavor undertaken to accomplish a


unique product or service Attributes of projects unique purpose
temporary require resources, often from various areas should have a
primary sponsor and/or customer involve uncertainty.

Where do Information Systems Projects Originate (Source of


Projects)?

New or changed IS development projects come from problems,


opportunities, and directives and are always subject to one or more
constraints. Problems – may either be current, suspected, or
anticipated. Problems are undesirable situations that prevent the
business from fully achieving its purpose, goals, and objectives
(users discovering real problems with existing IS). An Opportunity –
is a chance to improve the business even in the absence of specific
problems. This means that the business is hoping to create a system
that will help it with increasing its revenue, profit, or services, or
decreasing its costs. A Directive – is a new requirement that is
imposed by management, government, or some external influence
i.e. are mandates that come from either an internal or external
source of the business.

Projects cannot be run in isolation

Projects must operate in a broad organizational environment Project


managers need to take a holistic or systems view of a project and
understand how it is situated within the larger organization.

Stakeholders

Stakeholders are the people involved in or affected by project


activities Stakeholders include the project sponsor and project team
support staff customers users suppliers opponents to the project.

Importance of Stakeholders

Stakeholders are the people involved in or affected by project

Network Programming 40 of 45
activities Stakeholders include the project sponsor and project team
support staff customers users suppliers opponents to the project.
Project managers must take time to identify, understand, and
manage relationships with all project stakeholders Using the four
frames of organizations can help meet stakeholder needs and
expectations Senior executives are very important stakeholders.

What Helps Projects Succeed?

According to the Standish Group’s report “CHAOS 2001: A Recipe


for Success,” the following items help IT projects succeed, in order
of importance:

 Executive support

 User involvement

 Experienced project manager

 Clear business objectives

 Minimized scope

 Standard software infrastructure

 Firm basic requirements

 Formal methodology

 Reliable estimates

Understanding Organizations We can analyze a formal organization


using the following 4 (four) frames;

Structural frame: Focuses on roles and responsibilities, coordination


and control. Organizational charts help define this frame.

Human resources frame: Focuses on providing harmony between


needs of the organization and needs of people. System Integration &
Architecture

Political frame: Assumes organizations are coalitions composed of


varied individuals and interest groups. Conflict and power are key
issues.

Symbolic frame: Focuses on symbols and meanings related to

Network Programming 41 of 45
events. Culture is important.

Basic Organizational Structures

Organizational structure depends on the company and/or the


project. The structure helps define the roles and
responsibilities of the members of the department, work
group, or organization. It is generally a system of tasks and
reporting policies in place to give members of the group a
direction when completing projects. A good organizational
structure will allow people and groups to work effectively
together while developing hard work ethics and attitudes. The
four general types of organizational structure are functional,
divisional, matrix and project-based.

Functional Structure - People who do similar tasks, have


similar skills and/or jobs in an organization are grouped into a
functional structure. The advantages of this kind of structure
include quick decision making because the group members
are able to communicate easily with each other. People in
functional structures can learn from each other easier because
they already possess similar skill sets and interests.

Divisional Structure - In a divisional structure, the company


will coordinate inter-group relationships to create a work team
that can readily meet the needs of a certain customer or group
of customers. The division of labor in this kind of structure
will ensure greater output of varieties of similar products. An
example of a divisional structure is geographical, where
divisions are set up in regions to work with each other to
produce similar products that meet the needs of the individual
regions.

Matrix Structure - Matrix structures are more complex in that


they group people in two different ways: by the function they
perform and by the product team they are working with. In a
matrix structure the team members are given more autonomy
and expected to take more responsibility for their work. This
increases the productivity of the team, fosters greater
innovation and creativity, and allows managers to
cooperatively solve decision-making problems through group
interaction.

Project Organization Structure - In a project-organizational

Network Programming 42 of 45
structure, the teams are put together based on the number of
members needed to produce the product or complete the
project. The number of significantly different kinds of tasks
are taken into account when structuring a project in this
manner, assuring that the right members are chosen to
participate in the project.

Project Phases and the Project Life Cycle

A project life cycle is a collection of project phases Project


phases vary by project or industry, but some general phases
include concept development implementation support

Product Life Cycles Products also have life cycles

Products also have life cycles The Systems Development Life


Cycle (SDLC) is a framework for describing the phases
involved in developing and maintaining information systems
Systems development projects can follow Predictive models:
The scope of the project can be clearly articulated and the
schedule and cost can be predicted. Adaptive models: Projects
are mission driven and component based, using time-based
cycles to meet target dates.

Predictive Life Cycle Models

The waterfall model has well-defined, linear stages of systems


development and support.

The spiral model shows that software is developed using an


iterative or spiral approach rather than a linear approach.

The incremental release model provides for progressive


development of operational software.

The prototyping model is used for developing prototypes to


clarify user requirements.

The RAD model is used to produce systems quickly without

Network Programming 43 of 45
sacrificing quality.

Adaptive Life Cycle Models

Extreme Programming (XP): Developers program in pairs and


must write the tests for their own code. XP teams include
developers, managers, and users.

Scrum: Repetitions of iterative development are referred to as


sprints, which normally last thirty days. Teams often meet
every day for a short meeting, called a scrum, to decide what
to accomplish that day. Works best for object-oriented
technology projects and requires strong leadership to
coordinate the work

H. CLOSURE As a closing activity, apply XSL and XSLT on your previous activity
ACTIVTIES in XML.
XXII. SYNTHESIS /
GENERALIZATIO XSL is a family of recommendations for defining XML document
N transformation and presentation. An XSLT stylesheet specifies the
presentation of a class of XML documents by describing how an
instance of the class is transformed into an XML document that uses
a formatting vocabulary, such as (X)HTML or XSL-FO.

XXIII. EVALUATION Instructions: Select the best answer to the following multiple choice
questions about XSL, XSLT and XPath.

12. What is the correct declation syntax for the version of an


XML document?
a. </xml version="1.0"/>
b. <?xml version="1.0"/?>
c. <xml version="1.0">
d. none of the above

XXIV. ASSIGNMENT /
AGREEMENT It was mentioned earlier that in some cases, servers themselves
may become clients at various times. Give examples of cases that
servers also function as clients.

REFERENCES https://www.w3.org/People/maxf/XSLideMaker/tut.pdf
https://web.csulb.edu/~pnguyen/cecs475/pdf/Introduction%20to

Network Programming 44 of 45
%20XML.pdf

Network Programming 45 of 45

You might also like