« Home « Kết quả tìm kiếm

UML for XML Schema Mapping Specification


Tóm tắt Xem thử

- 1.1 XML Schema and UML.
- 1.9 The XML Schema.
- XML Schema is an emerging standard from W3C.
- XML Schema is a language for defining the structure of XML document instances that belong to a specific document type.
- XML Schema can be seen as replacing the XML DTD syntax.
- XML Schema provides strong data typing, modularization and reuse mechanisms not available in XML DTDs.
- This paper itself does not provide all the information for an end-to-end mapping from UML to XML Schema to programming language-specific data structures, but but such a mapping can be built on the information presented here..
- Although we refer to XML Schema in the paper, we are designing the mapping specifically to SOX until a W3C XML Schema recommendation becomes available..
- In developing the mapping between XML Schema and UML we have used the UML extension mechanisms (stereotypes and tagged values) to create new classes of UML objects to explicitly represent XML artifacts.
- The alternative approach would have been to specify a general mapping from UML classes to XML Schema.
- The extension approach allows users to directly model XML Schema in UML in an unambiguous way..
- Having a set of stereotypes specifically for XML Schema allows for a two-pass mapping, with the first pass applying a straightforward mapping, and the second allowing for a user to edit the results..
- The first bullet includes XML Schema document type characteristics such as required and implied attributes, etc.
- In summary, we map all element and data types in XML Schema to classes annotated with stereotypes..
- The stereotypes reflect the semantics of the related XML Schema concept.
- The table below lays out the stereotypes being added to the UML to express XML Schema constructs..
- <<sox>>.
- <<elementtype>>.
- <<sequence>>.
- <<choice>>.
- <<enumeration>>.
- <<scalar>>.
- <<varchar>>.
- <<implied>>.
- <<required>>.
- <<default>>.
- <<fixed>>.
- <<content>>.
- We will use a small example to explaining our XML Schema to UML mapping.
- The XML Schema for this example is found in section 4, while the corresponding UML diagram is found in section 5.
- This includes only the <<elementtype>>.
- These are the <<sequence>>.
- and <<choice>>.
- Various datatype constructors corresponding to the datatype constructors found in XML Schema.
- These are the <<enumeration>>.
- and <<varchar>>.
- Stereotypes associated with XML attributes ( <<implied>>, <<required>>,.
- <<default>>, <<fixed>>) and content models ( <<content>>.
- A <<sox>>.
- stereotype to declare a Package to be a XML SCHEMA schema..
- The <<content>>.
- stereotype applies to aggregation associations for parts of XML Schema content models..
- Each of these constructor has a corresponding stereotype: <<scalar>>.
- An example of this is price in the diagram.
- We assume the existing XML Schema datatypes (see [SOX2.0]) already exist and can be referenced..
- Element types are defined with the <<elementtype>>.
- In the diagram, InternatAddress is a generalization of Address.
- It also optionally has a stereotype of <<required>>.
- or <<fixed>>.
- If the <<required>>.
- If the <<fixed>>.
- Note that <<implied>>.
- and <<default>>.
- <<stereotype>>.
- attributes with a <<content>>.
- A cardinality to correspond to the occurs attribute in XML Schema.
- These consist of classes with stereotypes of <<sequence>>.
- or <<choice>>.
- In the diagram,.
- The mechanism provided by XML Schema to group sets of definitions together is the schema itself..
- In the mapping this becomes explicit.
- the XML Schema itself is mapped to a UML package.
- The resulting package will also have the <<sox>>.
- stereotype to indicate it is based on an XML Schema..
- As XML Schema has not defined any visibility constraints on definitions, all definitions in a Schema are required to be public.
- This will change if visibility constraints are every provided by XML Schema..
- XML Schema provides an import mechanism for a schema to refer to definitions in another schema.
- These references will be represented in the UML with associations using the <<import>>.
- In this section we will describe a non-trivial example and how it is represented in XML Schema as well as in UML.
- The XML Schema definition below describes the XML document types used to for XML purchase order instances..
- <schema uri = “urn:document:po.sox”>.
- <datatype name = “DocStates”>.
- <enumeration datatype = “NMTOKEN”>.
- <datatype name = “CountryCode”>.
- <datatype name = “Price”>.
- <scalar digits = “5” decimals = “4”/>.
- <elementtype name = “DocProcess”>.
- <string datatype = “DocStates”/>.
- <elementtype name = “Address”>.
- <element name = “name” type = “string”/>.
- <element name = “quantity” type = “int”/>.
- <element name = “cost” type = “Price”/>.
- <elementtype>.
- <elementtype name = “InternatAddress”>.
- <extends type = “address>.
- <element name = “country” type = “CountryCode”/>.
- <attrdef name = “language” type = “LanguageCode”>.
- </elementtype>.
- <elementtype name = “PurchaseOrder”>.
- <element name = “shipTo” type = “Address”/>.
- <element name = “billTo” type = “Address”/>.
- <sequence name = “lineItem” occurs = “+”>.
- <element type = “DocProcess”/>.
- <<elementtype>>.
- <<datatype>>.
- <<scalar>>.
- <<sequence>>.
- <<enumeration>>.
- See http://www.w3.org/..
- [XSDL] XML Schema Part 1: Structures, David Beech et al

Xem thử không khả dụng, vui lòng xem tại trang nguồn
hoặc xem Tóm tắt