Skip to main content
IBM  
Shop Support Downloads
IBM Home Products Consulting Industries News About IBM
IBM developerWorks : XML : Education - Tutorials
XML Schema Infoset Model, Part 1
ZIPPDF (letter)PDF (A4)e-mail
Main menuSection menuFeedbackPreviousNext
4. Using XML Schema Infoset Model classes
  


Concrete containment page 6 of 9


The XML Schema Infoset model's concrete containment relationships are represented by the following diagram:
Concrete Containment

In the figure above, most of the relationships are black diamond relationships, which are the containment relationships. These form the basis for the majority of classes within the XML Schema Infoset model. Below is a short description of some of the more interesting relationships from different classes in the above diagram.

XSDSchema
The root XSDSchema object can contain (0..*) XSDSchemaContent objects. Each of these XSDSchemaContent objects will show up as xml elements under the root xml schema element.


<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
 targetNamespace="http://www.example.com/IPO"
 xmlns:ipo="http://www.example.com/IPO">
    <annotation>
        <documentation>
            Addresses for International Purchase Order Schema
        </documentation>
    </annotation>

    <complexType name="Address">
        ...
    </complexType>

    <simpleType name="USState">
        ...
    </simpleType>

    <element name="order" type="ipo:Address">

    <attribute name="order" type="ipo:USState">

...
</schema>

In the above code snippet, you can see that the root schema element contains an annotation, complexType, simpleType, element, and attribute.

The root XSDSchema object can contain any of the following model objects as children within the concrete tree structure of the XML Schema Infoset model:

  • XSDImport
  • XSDInclude
  • XSDRedefine
  • XSDAnnotation
  • XSDElementDeclaration
  • XSDAttributeDeclaration
  • XSDComplexTypeDefinition
  • XSDSimpleTypeDefinition
  • XSDModelGroupDefinition
  • XSDAttributeGroupDefinition
  • XSDNotationDeclaration

XSDModelGroupDefinition
Model group definitions can either be global or references to global model group definitions. A global XSDModelGroupDefinition can contain a single XSDModelGroup.

XSDModelGroup
Model groups are also known as local groups, which have of one of the following compositions: sequence, choice, or all. An XSDModelGroup contains (0..*) XSDParticle objects.

XSDParticle
Particles contain the maxOccurs and minOccurs values for the content of the XSDParticle, which is known as the XSDParticleContent.

An XSDParticle contains a single XSDParticleContent, which can be one of the following objects:

  • XSDModelGroup
  • XSDWildCard
  • XSDElementDeclaration
  • XSDModelGroupDefinition

XSDComplexTypeDefinition
Complex type definitions can either be global or anonymous. If you are unfamiliar with the term anonymous, you can think of this as being local.

An XSDComplexTypeDefinition can contain a single attribute wildcard, (0..*) XSDAttributeGroupContent and a single XSDComplexTypeContent.

The XSDComplexTypeContent can either be an XSDParticle with an XSDModelGroup or XSDModelGroupDefinition as the particle's content or an XSDSimpleTypeDefinition, which means this complex type has simple content. If the XSDParticle's content is an XSDModelGroupDefinition, it will be a group reference to a global group.


Main menuSection menuFeedbackPreviousNext
About IBM | Privacy | Legal | Contact