![E-Commerce Technologies](https://data.docslib.org/img/3a60ab92a6e30910dab9bd827208bcff-1.webp)
Name: Homework 2 for CSC 513: E-Commerce Technologies Collaborative Work You may form teams of 1–4 members (of students in Listing 2: XML output for Problem 1.1 this class) to cooperate on this problem set. After dis- <?xml v e r s i o n ="1.0"?> cussing the problem, please write up your answers indi- §<SongList> ¤ vidually. Indicate the names of the other members in your <Song l g =’en’> team, if any. Hotel California <Sgr name=’Eagles’ g e n re =’rock’/> 5 </Song> 1 XSLT <Song l g =’en’> Seven Bridges Road Consider the XML document in Listing 1. <Sgr name=’Eagles’ g e n re =’rock’/> </Song> 10 <Song l g =’cpe’> Listing 1: XML input Day O <?xml v e r s i o n ="1.0"?> <Sgr name=’H Belafonte’ g e n re =’reggae’/> §<!−− Sgr , lg , and ti abbreviate Singer , −−> ¤ </Song> <!−− language , and t i t l e , respectively . −−> <Song l g =’en’> 15 <!−− The standard ( ISO 6 3 9 ) codes f o r −−> Jamaica Farewell <Sgr name=’H Belafonte’ g e n re =’reggae’/> <!−− English and Punjabi are en and pa , −−> 5 <!−− respectively . −−> </Song> <Songs> <Song l g =’him’> <Sgr name=’Eagles’ g e n re =’rock’> Ajahoon Na Bhejiho 20 <Song l g =’en’ t i =’Hotel California’/> <Sgr name=’J Prasad’ g e nr e =’classical’/> </Song> <Song l g =’en’ t i =’Seven Bridges Road’/> 10 </Sgr> <Song l g =’pa’> <Sgr name=’H Belafonte’ g e n re =’reggae’> Mera Dil Darda <Song l g =’cpe’ t i =’Day O’/> <Sgr name=’J Prasad’ g e nr e =’classical’/> 25 <Song l g =’en’ t i =’Jamaica Farewell’/> </Song> <Song l g =’en’> </Sgr> 15 <Sgr name=’J Prasad’ g e n re =’classical’> Never a Result <Song l g =’him’ t i =’Ajahoon Na Bhejiho’/> <Sgr name=’J Prasad’ g e nr e =’classical’/> <Song l g =’pa’ t i =’Mera Dil Darda’/> </Song> 30 <Song l g =’en’ t i =’Never a Result’/> </ SongList> </Sgr> 20 </Songs> ¦ ¥ ¦ ¥ 1.1. (25 points) Write an XSLT stylesheet that reads in Listing 1) and produces a list of songs in which Sgr is a subelement of Song and certain attributes are con- verted to text (see Listing 2). Document your answer. Don’t over-do the use of fancy constructs. You should be able to get a lot done with just xsl:template, xsl:apply-templates, xsl:copy, xsl:value- of, and xsl:copy-of. c February 8, 2005 Munindar P. Singh Name: Homework 2 for CSC 513: E-Commerce Technologies Independent Work You must solve this problem set individually without Listing 3: XML output for Problem 3.1 any assistance from anyone. <?xml v e r s i o n ="1.0"?> §<SongList> ¤ 2 XPath <Song l g =’en’ g e nr e =’rock’> <Sgr name=’Eagles’/> Hotel California 5 2.1. (15 points) Write an XPath expression to find just </Song> the names of singers who sang at least two English <Song l g =’en’ g e nr e =’rock’> songs. <Sgr name=’Eagles’/> Seven Bridges Road 2.2. (15 points) Without using count, write an XPath ex- </Song> 10 pression to find just the names of singers who sang at <Song l g =’cpe’ g e n re =’reggae’>Day O <Sgr name=’H Belafonte’/> least one Punjabi song. </Song> <Song l g =’en’ g e nr e =’reggae’> <Sgr name=’H Belafonte’/> 15 3 XSLT Jamaica Farewell </Song> 3.1. (25 points) Write an XSLT stylesheet that reads in <Song l g =’him’ g e n re =’classical’> Listing 1) and produces a list of songs in which Sgr <Sgr name=’J Prasad’/> is a subelement of Song and the genre attribute of Ajahoon Na Bhejiho 20 </Song> Sgr are placed as an attribute on Song (see Listing 3). <Song l g =’pa’ g e nr e =’classical’> Notice the text is Document your answer. <Sgr name=’J Prasad’/> Don’t over-do the use of fancy constructs. You Mera Dil Darda </Song> 25 should be able to get a lot done with just <Song l g =’en’ g e nr e =’classical’> xsl:template, xsl:apply-templates, xsl:copy, xsl:value- <Sgr name=’J Prasad’/> of, and xsl:copy-of. Never a Result </Song> </ SongList> 30 ¦ ¥ c February 8, 2005 Munindar P. Singh.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages2 Page
-
File Size-