XML Lab 9 - <html>...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
HIT3693 XML Technologies XML LABORATORY – Exercise 9 Document Object Model 1 Objectives covered in this laboratory After this laboratory you should be able to how to access data in an XML document 2 Source XML file The source xml file (catalog.xml) we like to operate with is as follows: <?xml version="1.0" encoding="ISO-8859-1" ?> < CATALOG > < CD > < TITLE > Empire Burlesque </ TITLE > < ARTIST > Bob Dylan </ ARTIST > < COUNTRY > USA </ COUNTRY > < COMPANY > Columbia </ COMPANY > < PRICE > 10.90 </ PRICE > < YEAR > 1985 </ YEAR > </ CD > < CD > < TITLE > Hide your heart </ TITLE > < ARTIST > Bonnie Tyler </ ARTIST > < COUNTRY > UK </ COUNTRY > < COMPANY > CBS Records </ COMPANY > < PRICE > 9.90 </ PRICE > < YEAR > 1988 </ YEAR > </ CD > < CD > < TITLE > Greatest Hits </ TITLE > < ARTIST > Dolly Parton </ ARTIST > < COUNTRY > USA </ COUNTRY > < COMPANY > RCA </ COMPANY > < PRICE > 9.90 </ PRICE > < YEAR > 1982 </ YEAR > </ CD > </CATALOG> 3. Data Access Read the following script and explain what it does:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: &lt;html&gt; &lt;body&gt; &lt;script type=&quot;text/vbscript&quot;&gt; set xmlDoc=CreateObject(&quot;Microsoft.XMLDOM&quot;) xmlDoc.async=&quot;false&quot; HIT3693 XML Technologies Exercise 9 Swinburne University of Technology Faculty of Information and Communication Technologies 2009 2 xmlDoc.load(&quot;catalog.xml&quot;) document.write(&quot;This catalog contains the following titles:&quot; &amp; &quot;&lt;br /&gt;&quot;) for each x in xmlDoc.getElementsByTagName(&quot;TITLE&quot;) document.write(x.text &amp; &quot;&lt;br /&gt;&quot;) next &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; Use the above code as a basis to display the following information: 1. display all the artists names; 2. display the title, the price, and the year of the CD whose artist is Bob Dylan...
View Full Document

Page1 / 2

XML Lab 9 - &amp;amp;lt;html&amp;amp;gt;...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online