0% found this document useful (0 votes)
97 views

This Study Resource Was

The document contains XML code defining the structure of racing teams, cars, and a summary. It includes three XML files - teams.xml defining racing teams, cars.xml defining the cars, and south.xml combining the information with an internal DTD. The files use namespaces to group the elements and define attributes for the teams and cars. The south.xml DTD specifies the element structure and relationships between teams, cars, titles, descriptions and series.

Uploaded by

jean diallo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views

This Study Resource Was

The document contains XML code defining the structure of racing teams, cars, and a summary. It includes three XML files - teams.xml defining racing teams, cars.xml defining the cars, and south.xml combining the information with an internal DTD. The files use namespaces to group the elements and define attributes for the teams and cars. The south.xml DTD specifies the element structure and relationships between teams, cars, titles, descriptions and series.

Uploaded by

jean diallo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

FOR MORE OF THIS COURSE AND ANY

OTHER COURSES, TEST BANKS,


FINAL EXAMS, AND SOLUTION
MANUALS
CONTACT US
AT [email protected]
carstxt.xml, southtxt.xml, and
<!-- teamstxt.xml files are saved as cars.xml,

m
New Perspectives on XML south.xml, and teams.xml, respectively

er as
Tutorial 2 and student’s name and today’s date is in

co
Case Problem 4

eH w
the comment section of each file

o.
South Racing teams list
Author: Danika Francis rs e
ou urc
Date: 3/1/2017

Filename: teams.xml
o

Supporting Files: cars.xml, south.xml


In the teams.xml file, all the
aC s

-->
vi y re

elements are in the namespace


<t:teams xmlns:t="http://example.com/southracing/teams"> http://example.com/southracing/t
eams with the namespace prefix t
<t:team tid="t205"
ed d

cars="nes201 gda100-5 gma005-2 sob-450V4 hen01-53">


ar stu

<t:title>Rodas Motorsports</t:title>
<t:description>#1 Team in racing</t:description>
<t:series>Indy</t:series>
is

</t:team>
Th

<t:team tid="t105"
cars="nes201 gda100-5 gma005-2 sob-450V4 dej01-003">
<t:title>SAM Racing</t:title>
<t:description>Top 10 over last 5 years</t:description>
sh

<t:series>Nascar</t:series>
</t:team>

</t:teams>

This study source was downloaded by 100000826614564 from CourseHero.com on 05-23-2021 07:17:35 GMT -05:00

https://www.coursehero.com/file/18422240/Solution-Manual-for-New-Perspectives-on-XML-Comprehensive-3rd-Edition-by-Carey-2/
<!--
New Perspectives on XML
Tutorial 2
Case Problem 4

South Racing cars list


Author: Danika Francis
Date: 3/1/2017

Filename: cars.xml In the cars.xml file, all the elements


Supporting Files: south.xml, teams.xml are in the namespace
--> http://example.com/southracing/cars
with the namespace prefix c
<c:cars xmlns:c="http://example.com/southracing/cars">
<c:car cid="nes201" team="t205 t105">

m
<c:title>Straight Away</c:title>

er as
<c:model>Nissan</c:model>

co
<c:driver>indy</c:driver>

eH w
</c:car>

o.
rs e
<c:car cid="gda100-5" team="t205 t105">
ou urc
<c:title>Quick Start</c:title>
<c:model>General Motors</c:model>
<c:driver>indy</c:driver>
o

</c:car>
aC s
vi y re

<c:car cid="gma005-2" team="t205 t105">


<c:title>Stop Blocks Laps</c:title>
<c:model>Ford</c:model>
<c:driver>indy</c:driver>
ed d

</c:car>
ar stu

<c:car cid="sob-450V4" team="t205">


<c:title>Bendwinder</c:title>
is

<c:model>Ford</c:model>
<c:driver>412</c:driver>
Th

</c:car>

<c:car cid="hen01-53" team="t205">


<c:title>Turn Twister</c:title>
sh

<c:model>Nissan</c:model>
<c:driver>indy</c:driver>
</c:car>

<c:car cid="stu-050V4" team="t105">


<c:title>Sleeker</c:title>

This study source was downloaded by 100000826614564 from CourseHero.com on 05-23-2021 07:17:35 GMT -05:00

https://www.coursehero.com/file/18422240/Solution-Manual-for-New-Perspectives-on-XML-Comprehensive-3rd-Edition-by-Carey-2/
<c:model>General Motors</c:model>
<c:driver>278</c:driver>
</c:car>

<c:car cid="dej01-003" team="t105">


<c:title>84 Racer</c:title>
<c:model>General Motors</c:model>
<c:driver>198</c:driver>
</c:car>
</c:cars>

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

m
<!--

er as
New Perspectives on XML

co
Tutorial 2

eH w
Case Problem 4

o.
South Racing summary rs e
ou urc
Author: Danika Francis
Date: 3/1/2017
o

Filename: south.xml
aC s

Supporting Files: cars.xml, teams.xml


vi y re

--> In the south.xml file, an internal DTD


subset has been added.

<!DOCTYPE racing The teams element has been added,


ed d

[ containing at least one child element


ar stu

<!ELEMENT t:teams (t:team+)> named team.


<!ATTLIST t:teams xmlns:t CDATA #FIXED "http://example.com/southracing/teams">

<!ELEMENT t:team (t:title, t:description, t:series)> The team element has been added,
is

containing the sequence of child


<!ATTLIST t:team tid ID #REQUIRED>
elements: title, description, and
Th

<!ATTLIST t:team cars IDREFS #REQUIRED>


series.
<!ELEMENT t:title (#PCDATA)> The title, description, and series elements
<!ELEMENT t:description (#PCDATA)>
sh

have been added, containing parsed


An ID <!ELEMENT t:series (#PCDATA)> character data.
attribute
named cid <!ELEMENT c:cars (c:car+)>
has been <!ATTLIST c:cars xmlns:c CDATA #FIXED "http://example.com/southracing/cars">
added to
the car <!ELEMENT c:car (c:title, c:model, c:driver)> An attribute declaration has been added to the
element. cars element to declare the
http://example.com/southracing/cars
namespace
This study source was downloaded by 100000826614564 from CourseHero.com on 05-23-2021 07:17:35 GMT -05:00 as a fixed value.

https://www.coursehero.com/file/18422240/Solution-Manual-for-New-Perspectives-on-XML-Comprehensive-3rd-Edition-by-Carey-2/
<!ATTLIST c:car cid ID #REQUIRED>
<!ATTLIST c:car team IDREFS #REQUIRED>

<!ELEMENT c:title (#PCDATA)>


<!ELEMENT c:model (#PCDATA)> A team attribute containing a list of ID
<!ELEMENT c:driver (#PCDATA)> references has been added to the car
element.
<!ELEMENT racing (t:teams, c:cars)>
<!ATTLIST racing xmlns CDATA #FIXED "http://example.com/southracing">

<!ENTITY teamsList SYSTEM "teams.xml"> A fixed attribute of the racing element


<!ENTITY carsList SYSTEM "cars.xml"> declaring the
]> http://example.com/southracing
namespace is added.
<racing xmlns="http://example.com/southracing">
References toThe
theroot element
teamsList andracing has been
carsList

m
&teamsList; addedtotothe
entities are added theracing
document, belonging to
element.

er as
&carsList; the default namespace

co
http://example.com/southracing.

eH w
</racing>

o.
rs e
Following is a second copy of lines containing the internal DTD to prevent callouts from
ou urc
crowding excessively
<!DOCTYPE racing
o

[
aC s

<!ELEMENT t:teams (t:team+)>


An ID
vi y re

<!ATTLIST t:teams xmlns:t CDATA #FIXED "http://example.com/southracing/teams">


attribute
named tid An attribute has been added to the teams
is added. <!ELEMENT t:team (t:title, t:description, t:series)>
element to declare the
<!ATTLIST t:team tid ID #REQUIRED> In the south.xml file, an internal DTD
ed d

http://example.com/southracing/teams
<!ATTLIST t:team cars IDREFS #REQUIRED> subset has been added.
ar stu

namespace as a fixed value


<!ELEMENT t:title (#PCDATA)> An attribute named cars is added,
<!ELEMENT t:description (#PCDATA)> containing a list of ID references.
is

<!ELEMENT t:series (#PCDATA)>


Th

<!ELEMENT c:cars (c:car+)>


<!ATTLIST c:cars xmlns:c CDATA #FIXED "http://example.com/southracing/cars">

<!ELEMENT c:car (c:title, c:model, c:driver)> The cars element is added, containing
sh

<!ATTLIST c:car cid ID #REQUIRED> at least one child element named car.
<!ATTLIST c:car team IDREFS #REQUIRED>
The car element is added, containing
<!ELEMENT c:title (#PCDATA)> the sequence of child elements: title,
<!ELEMENT c:model (#PCDATA)> model, and driver.
<!ELEMENT c:driver (#PCDATA)>

This study source was downloaded by 100000826614564 from CourseHero.com on 05-23-2021 07:17:35 GMT -05:00

https://www.coursehero.com/file/18422240/Solution-Manual-for-New-Perspectives-on-XML-Comprehensive-3rd-Edition-by-Carey-2/
<!ELEMENT racing (t:teams, c:cars)> The title, model, and driver elements
<!ATTLIST racing xmlns CDATA #FIXED "http://example.com/southracing">
are added, containing parsed
character data.
<!ENTITY teamsList SYSTEM "teams.xml">
<!ENTITY carsList SYSTEM "cars.xml">
]>
The racing element containing two
An external entity is added child elements t:teams and c:cars, is
named teamsList pointing to added.
the teams.xml file.
An external entity is added named
carsList pointing to the cars.xml file.

m
er as
co
eH w
o.
rs e
ou urc
o
aC s
vi y re
ed d
ar stu
is
Th
sh

A team attribute containing a list of ID


references has been added to the car
element.

This study source was downloaded by 100000826614564 from CourseHero.com on 05-23-2021 07:17:35 GMT -05:00

https://www.coursehero.com/file/18422240/Solution-Manual-for-New-Perspectives-on-XML-Comprehensive-3rd-Edition-by-Carey-2/
Powered by TCPDF (www.tcpdf.org)

You might also like