Integrated Model-driven Development Environments for Equation-based Object-oriented Languages




НазваниеIntegrated Model-driven Development Environments for Equation-based Object-oriented Languages
страница8/55
Дата04.10.2012
Размер0.98 Mb.
ТипДокументы
1   ...   4   5   6   7   8   9   10   11   ...   55

2.6The eXtensible Markup Language (XML)


The Extensible Markup Language (XML) (W3C [158]) is a standard recommended by the World Wide Web Consortium (W3C). XML is a simple and flexible text format derived from Standardized Generalized Markup Language (SGML) (W3C [163]). The XML language is widely used for information exchange over the Internet. The tools one can use for parsing, querying, transforming or validating XML documents have reached a mature state. Such tools exist both as open-source projects and commercial software products.

A small example of an XML document is shown below:

"1.0"?>



<persons>

<person job="programmer">

<name>John Doe</name>

<email>

grigore@none.ro

</email>

</person>

...

<person job="manager">

<comment>Classified</comment>

</person>

</persons>

An XML document is simply a text in which the information is marked up using tags. The tags are the names enclosed in angle brackets. For easy identification we show elements in bold face and attribute names in italics throughout the XML example. The information delimited by <persons> and persons> tags is an XML element. As we can see, it can contain other elements called <person> that nests additional elements within itself.

The attributes are specified after the tag as an unordered name/value list of name="value" items. In our example, the attribute job with the value "programmer".

The first line states that this is an XML document. The second line expresses that an XML parser must validate the contents of the elements against the Document Type Definition (DTD) (W3C [158]) file, here named "persons.dtd". The DTD provides constraints for the contents much like grammars used for programming languages.

There are two criteria to be met in order for an XML document to be valid. First, all the elements have to be properly nested and must have a start/end tag. Second, all the contents of all elements must obey their DTD grammar specifications.

We will define a DTD for the above example:



person-job-attribute

"job(programmer|manager) #REQUIRED">

persons (person*)>

person ((name+, email*) | comment+)>

person

project CDATA #IMPLIED

&person-job-attribute;>

name (#PCDATA)>

email (#PCDATA)>

comment (#PCDATA)>

The above DTD defines one entity, four elements, and one attribute list containing two attributes. The entities are underlined, bold is used for elements, and attributes are specified in italics.

The entity (ENTITY) declaration defines person-job-attribute as a text value that can be used anywhere inside the DTD and the XML document. The XML parser will replace the entity with its defined text where it is used. The principal element (ELEMENT) declared in DTD is persons and has zero or more elements person nested inside. The special characters inside the element definitions are "*" meaning: zero or more, "|" meaning: selection – either left side or right side, "+" meaning: one or more.

The attribute (ATTLIST) list defines two attributes for the person element: project and job.

The project attribute can contain character data (CDATA) and is optional (#IMPLIED). The job attribute can only have one of the two values, either "programmer" or "manager".

There is another XML document structure standard, called XML-Schema (W3C [167]), which is similar to DTD but is encoded in XML. This standard reconstructs all the capabilities of the DTD and extends them with: namespaces, context sensitivity, the possibility to define several root elements in the same schema, integrity constraints, regular expressions, sub-typing, etc. Tools for transforming XML-Schema representations from/to a DTD representation are available. We use the DTD variant in this example only because it is clearer than the too verbose XML-Schema.

One can consult the World Wide Web Consortium website (W3C [158], W3C [167]) for more information regarding XML, DTD and XML-Schema.
1   ...   4   5   6   7   8   9   10   11   ...   55

Похожие:

Integrated Model-driven Development Environments for Equation-based Object-oriented Languages iconThe Domain Analysis Integrated in an Object Oriented Development Methodology

Integrated Model-driven Development Environments for Equation-based Object-oriented Languages iconHypergraph-based Object-oriented Model for gis application

Integrated Model-driven Development Environments for Equation-based Object-oriented Languages iconObject-Oriented Object-Oriented Languages

Integrated Model-driven Development Environments for Equation-based Object-oriented Languages iconApplying uml and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development (3rd Edition)

Integrated Model-driven Development Environments for Equation-based Object-oriented Languages iconModel Development of a Total Integrated Maintenance System

Integrated Model-driven Development Environments for Equation-based Object-oriented Languages iconAn integrated framework for model-based flow assurance in deep-water oil and gas production

Integrated Model-driven Development Environments for Equation-based Object-oriented Languages iconThis paper introduces the basic concepts of Agile Database Techniques, and effective ways to go about the Data-Oriented aspects of Object Oriented software

Integrated Model-driven Development Environments for Equation-based Object-oriented Languages iconObject-Oriented Metrics: an Annotated Bibliography

Integrated Model-driven Development Environments for Equation-based Object-oriented Languages iconAn Introduction and Brief Examination of Object-Oriented Data Modeling

Integrated Model-driven Development Environments for Equation-based Object-oriented Languages iconAn Object-Oriented Support Tool for the Design of Casting Procedures

Разместите кнопку на своём сайте:
Библиотека


База данных защищена авторским правом ©lib.znate.ru 2014
обратиться к администрации
Библиотека
Главная страница