• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Can someone give me some XML help????? PLease!

trmiv

Lifer
I have an assignment due in my database class on thursday in XML. Problem is, XML is barely mentioned in our book, so I don't have a good grasp on it. Keep in mind I have absolutely NO experience in XML, just what I have read in this book. Here's what the teach assigned:



<< Please do problems # 5, 6, and 7 on page 305 of the Kroenke textbook. Consider these three problems as one single XML assignment that requires you to develop a DTD along with sample data and a stylesheet for apartments in a building. A building may contain many apartments. You may include any appropriate attributes for the apartments - here are a few of them: apartment number or address, occupant name, number of bedrooms, etc. Include sample data for two or three apartments only.

Create two separate files using a text editor such as Notepad. Save these files as Apartments.xml (to include DTD and data) and Apartments.xsl (to include the stylesheet) on your disk. As demonstrated in class and as shown in an example given below, test your XML application by opening the Apartments.xml file in Internet Explorer. Correct any errors.

Please submit the disk labeled with your name and containing (only) the two files. Also submit a printout of the two files with your name typed on the printout.
>>



And here's problems 5, 6, 7 mentioned above



<<
5. Design a database view of the Apartments in a Building. Using figure 11-15 as a guide, develop a DTD of an XML document that defines your view. Show two sample Apartment XML documents.

6) Using the XSL in figure 11-18 as a guide, develop an XSL document for materializing you view

7)If you can gain access to Internet Explorer 5.0, materialize your Apartment XML views using your XSL document
>>



OK, my questions.

1)I'm not sure how the database relates to XML on this. The professor says &quot;A building may contain many apartments&quot; but where do I define this relation?
2) I know that you define the objects (is that correct? I'm thinking like Java here) in the DTD with the word DOCTYPE, but can you define more than one object per page? For expample, I'm assuming that I need a &quot;Building&quot; object, and an &quot;Apartment&quot; object. So far I have this:



<< <?xml version='1.0'?>
<!DOCTYPE apartment [
<!ELEMENT apartmentnumber (#PCDATA)>
<!ELEMENT occupantname (firstname, lastname)>
<!ELEMENT firstname (#PCDATA)>
<!ELEMENT lastname (#PCDATA)>
]>
>>



Can I do the same right under that and define &quot;Building&quot;? Say with something like this:



<< <!DOCTYPE building [
<!ELEMENT buildingaddress (street*, city, state, zip*)>
<!ELEMENT street (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT state (#PCDATA)>
<!ELEMENT zip (#PCDATA)>
]>
>>



Then under that define the isntances of building and Apartment? Or should I just include the address data for the building in the Apartment declaration? Am I on the right track here?

Thanks
 
Back
Top