Download presentation
Presentation is loading. Please wait.
Published byJade King Modified over 9 years ago
1
The One-to-many Relationship A relationship in which one object can reference several instances of another.
2
Learning Objectives Learn different techniques of implementing one- to-many relationships in XML Create custom data types in an XML schema Create empty elements with attributes in an XML document Build XML stylesheets using HTML style tags
3
Implementing a One-to-Many Relationship Containment relationships Example: Bulldogs Mike Vick
4
Implementing a One-to-Many Relationship Intra-document relationships Example: Bulldogs Yellow Jackets Mike Vick
5
Implementing a One-to-Many Relationship Inter-document relationships Different tables may be located in different documents or files Example: Bulldogs Yellow Jackets Mike Vick
6
XML Schema Data Types Basic data types i.e. integer, boolean, string, decimal Additional types i.e. year, month, time, date, anyURI Custom data types Created by the user to define specific fields/values Custom Data Type Example
7
Regular Expression & Element Types Perl’s regular expression language can be used to construct a pattern in defining an XML schemaregular expression Element Types Element content Root element; consists of elements only between tags Mixed content element Consists of text as well as other elements between tags Single content element Consists of only text between tags Empty content element Contains nothing between its opening and closing tags
8
Attributes Same naming structure as elements In single element, attributes’ names must be unique May not contain the “<“ symbol and the character string “<” can be used to represent it Each attribute must have a name and a value http://www.global-travel.co.uk/pook1.htm If quotes are used to enclose to enclose the string, they must differ from the quotes used to enclose the value. John Smith
9
XSL: Stylesheets Using tables for layout Also set background color, font-size, font-weight, and alignment using the style tag in HTML Stylesheet
10
Summary Ways to implement a one-to-many relationship Containment Intra-document Inter-document Custom data types Use built-in data types and apply restrictions, facets, or specific patterns Empty element Contains no text but may contain attributes for better element definition Presentation layout with stylesheets HTML style tags and table layout
11
Exercise: Movie Database Create an XML schema to depict a relationship between movie genres, movies, and actors/actresses Choose two genres (drama, horror, action, etc.), two movies in each, and several actors/actresses from each. Using the schema, create a document and populate it with the chosen information as well as additional actor/actress data including social security number in regex. Create an XML stylesheet to present the data in table form for easier readability
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.