473,654 Members | 3,108 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with binding xml data with html document

1 New Member
Hi I am having a really hard time binding this xml file with my html file.
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="ISO-8859-1" ?>
  2.  
  3. <?xml-stylesheet type="text/css" href="library.css"?>
  4.  
  5. <LIBRARY>
  6.     <BOOK>
  7.         <TITLE>Harry Potter and the Deathly Hallows</TITLE>
  8.         <AUTHOR>J.K. Rowling</AUTHOR>
  9.         <GENRE>Fantasy</GENRE>
  10.         <PRICE>17.99</PRICE>
  11.         <PUBLISH>Arthur A. Levine Books</PUBLISH>
  12.  
  13.     </BOOK>
  14.     <BOOK>
  15.         <TITLE>A Thousand Splendid Suns</TITLE>
  16.         <AUTHOR>Khaled Hosseini</AUTHOR>
  17.         <GENRE>Fiction</GENRE>
  18.         <PRICE>14.27</PRICE>
  19.         <PUBLISH>Riverhead Hardcover</PUBLISH>
  20.     </BOOK>
  21.     <BOOK>
  22.         <TITLE>The Assault on Reason</TITLE>
  23.         <AUTHOR>Al Gore</AUTHOR>
  24.         <GENRE>Factual</GENRE>
  25.         <PRICE>15.57</PRICE>
  26.         <PUBLISH>Penguin Press HC</PUBLISH>
  27.     </BOOK>
  28.     <BOOK>
  29.         <TITLE>Requiem For An Assassin</TITLE>
  30.         <AUTHOR>Barry Eisler</AUTHOR>
  31.         <GENRE>Thriller</GENRE>
  32.         <PRICE>14.97</PRICE>
  33.         <PUBLISH>Putnam Adult</PUBLISH>
  34.     </BOOK>
  35.     <BOOK>
  36.         <TITLE>The Overlook</TITLE>
  37.         <AUTHOR>Michael Connelly</AUTHOR>
  38.         <GENRE>Mystery</GENRE>
  39.         <PRICE>13.19</PRICE>
  40.         <PUBLISH>Little, Brown and Company</PUBLISH>
  41.     </BOOK>
  42.     <PERIODICAL>
  43.         <TITLE>Sports Illustrated for Kids</TITLE>
  44.         <PUBLISHER>The Time Inc. Magazine Company</PUBLISHER>
  45.         <PRICE>19.95</PRICE>
  46.         <FORMAT>Magazine</FORMAT>
  47.     </PERIODICAL>
  48.     <PERIODICAL>
  49.         <TITLE>Discouver</TITLE>
  50.         <PUBLISHER>Discouver Media LLC</PUBLISHER>
  51.         <PRICE>19.95</PRICE>
  52.         <FORMAT>Magazine</FORMAT>
  53.     </PERIODICAL>
  54.     <PERIODICAL>
  55.         <TITLE>Men's Health</TITLE>
  56.         <PUBLISHER>Rodale Inc</PUBLISHER>
  57.         <PRICE>24.94</PRICE>
  58.         <FORMAT>Magazine</FORMAT>
  59.     </PERIODICAL>
  60.     <CD>
  61.         <TITLE>Never</TITLE>
  62.         <AUTHOR>Paul Oakenfold</AUTHOR>
  63.         <COMPANY>Maverick</COMPANY>
  64.         <PRICE>6.99</PRICE>
  65.         <YEAR>2006</YEAR>
  66.         <FORMAT>CD Single</FORMAT>
  67.     </CD>
  68.     <CD>
  69.         <TITLE>1 in 21: Tupac Shakur Story</TITLE>
  70.         <AUTHOR>Tupac Shakur</AUTHOR>
  71.         <COMPANY>AIM</COMPANY>
  72.         <PRICE>18.99</PRICE>
  73.         <YEAR>2001</YEAR>
  74.         <FORMAT>CD</FORMAT>
  75.     </CD>
  76.     <CD>
  77.         <TITLE>CLUB</TITLE>
  78.         <AUTHOR>Paul Oakenfold</AUTHOR>
  79.         <COMPANY>Perfecto</COMPANY>
  80.         <PRICE>19.99</PRICE>
  81.         <YEAR>2005</YEAR>
  82.         <FORMAT>CD</FORMAT>
  83.     </CD>
  84.     <MOVIE>
  85.         <TITLE>The 40 Year Old Virgin: Unrated</TITLE>
  86.         <STUDIO>Universal Home Entertainment</STUDIO>
  87.         <RATING>Rated R</RATING>
  88.         <GENRE>Comedy</GENRE>
  89.         <PRICE>18.99</PRICE>
  90.         <YEAR>2007</YEAR>
  91.         <FORMAT>DVD</FORMAT>
  92.     </MOVIE>
  93.     <MOVIE>
  94.         <TITLE>Lord of the Rings: Trilogy</TITLE>
  95.         <STUDIO>Alliance</STUDIO>
  96.         <RATING>Rated 14A</RATING>
  97.         <GENRE>Fantasy</GENRE>
  98.         <PRICE>59.99</PRICE>
  99.         <YEAR>2006</YEAR>
  100.         <FORMAT>DVD</FORMAT>
  101.     </MOVIE>
  102.     <MOVIE>
  103.         <TITLE>Pirates of the Caribbean:Dead Man's Chest</TITLE>
  104.         <STUDIO>Disney</STUDIO>
  105.         <RATING>PG 13</RATING>
  106.         <GENRE>Adventure</GENRE>
  107.         <PRICE>26.99</PRICE>
  108.         <YEAR>2006</YEAR>
  109.         <FORMAT>DVD</FORMAT>
  110.     </MOVIE>
  111.     <MOVIE>
  112.         <TITLE>Blood In Blood Out</TITLE>
  113.         <STUDIO>Disney</STUDIO>
  114.         <RATING>Rated R</RATING>
  115.         <GENRE>Drama</GENRE>
  116.         <PRICE>21.99</PRICE>
  117.         <YEAR>2000</YEAR>
  118.         <FORMAT>DVD</FORMAT>
  119.     </MOVIE>
  120. </LIBRARY>
Basically what im trying to do is to separate Book, Periodicals, CDs, and Movies into separate tables. This is the code I currently have for my html file:


Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2.  
  3. <html>
  4. <head>
  5. <xml id="LIBRARY" src="library.xml"></xml>
  6. <title>Personal Library</title>
  7. </head>
  8. <body text="black">
  9. <h1>Welcome to my Personal Library</h1>
  10.  
  11. <h2>Books
  12. <table border = "1" width="100%" summary="Book Details" datasrc="#LIBRARY">
  13.     <thead style="background-color: #CAFF70;">
  14.         <tr>
  15.             <th>Title</th><th>Author</th><th>Genre</th><th>Publisher</th><th>$ Price $</th>
  16.         </tr>
  17.     </thead>
  18.  
  19.     <tbody>
  20.         <tr>
  21.             <td align="left" >
  22.                 <SPAN DATAFLD="TITLE">
  23.                 </SPAN>
  24.             </td>
  25.             <td align="center"><div  datafld="AUTHOR" /></td>
  26.             <td align="center"><div  datafld="GENRE" /></td>
  27.             <td align="center"><div  datafld="PUBLISH" /></td>
  28.             <td align="right"><div  datafld="PRICE" /></td>
  29.         </tr>
  30.     </tbody>
  31. </table>
  32.  
  33. <h2>Periodicals
  34. <table border = "1" width="100%" summary="Periodical Details Details" datasrc="#LIBRARY">
  35. <thead style="background-color: #98FB98;">
  36. <tr>
  37. <th>Title</th><th>Publisher</th><th>Format</th><th>$ Price $</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. <tr>
  42. <td align="left" ><div  datafld="TITLE" /></td>
  43. <td align="center"><div  datafld="PUBLISHER" /></td>
  44. <td align="center"><div  datafld="FORMAT" /></td>
  45. <td align="right"><div  datafld="PRICE" /></td>
  46. </tr>
  47. </tbody>
  48. </table>
  49.  
  50. <h2>CD
  51. <table border = "1" width="100%" summary="CD Details" datasrc="#LIBRARY">
  52. <thead style="background-color: #BBFFFF;">
  53. <tr>
  54. <th>Title</th><th>Author</th><th>Company</th><th>Year</th><th>Format</th><th>$ Price $</th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. <tr>
  59. <td align="left" ><div  datafld="TITLE" /></td>
  60. <td align="center"><div  datafld="AUTHOR" /></td>
  61. <td align="center"><div  datafld="COMPANY" /></td>
  62. <td align="center"><div  datafld="YEAR" /></td>
  63. <td align="center"><div  datafld="FORMAT" /></td>
  64. <td align="right"><div  datafld="PRICE" /></td>
  65. </tr>
  66. </tbody>
  67. </table>
  68.  
  69. <h2>Movie
  70. <table border = "1" width="100%" summary="Movie Details" datasrc="#LIBRARY">
  71. <thead style="background-color: #C6E2FF;">
  72. <tr>
  73. <th>Title</th><th>Studio</th><th>Rating</th><th>Genre</th><th>Year</th><th>Format</th><th>$ Price $</th>
  74. </tr>
  75. </thead>
  76. <tbody>
  77. <tr>
  78. <td align="left" ><div  datafld="TITLE" /></td>
  79. <td align="center"><div  datafld="STUDIO" /></td>
  80. <td align="center"><div  datafld="RATING" /></td>
  81. <td align="center"><div  datafld="GENRE" /></td>
  82. <td align="center"><div  datafld="YEAR" /></td>
  83. <td align="center"><div  datafld="FORMAT" /></td>
  84. <td align="right"><div  datafld="PRICE" /></td>
  85. </tr>
  86. </tbody>
  87. </table>
  88. </body>
  89. </html>
Thank you for your time, :-)
I would really appreciate your help
May 26 '07 #1
3 1711
dorinbogdan
839 Recognized Expert Contributor
Welcome to TheScripts TSDN...

I'm not sure what is the binding problem.
I could not test the code yet, but please give some details about expected result.

Thanks,
Dorin.
May 28 '07 #2
dorinbogdan
839 Recognized Expert Contributor
It seems that you need to use XSL.
Please take a look at this short tutorial, and try to play with XSL.
You will need to output as HTML.
We cannot write code for you (because of site rules), but we'll try to offer suggestions and small snippets.

Dorin.
May 28 '07 #3
drhowarddrfine
7,435 Recognized Expert Expert
Your doctype for the html is incomplete. See the article about doctypes in html/css. In this case, you probably want to use XHTML.

Also, you are using XML attributes in the HTML document that don't exist there.

XML should be written in lower case, too.
May 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2074
by: Ed Blinn | last post by:
Can someone tell me why this script will only work on a Mac with Internet Explorer. Thanks, Ed <html> <head> <script type="text/javascript"> //Square Root
6
2482
by: Stephen Cook | last post by:
Having worked through the problems around enabling the document function using an XmlUrlResolver I started work on building a useful class to hide the intricacies. Trying to generalise the process I've hit a snag. How do I resolve multiple external references? The transform method on a stylesheet only takes one resolver, not an array Stephen
3
4911
by: vinayak | last post by:
Hi I am displaying data in Datagrid in ASP.NET with Edit/Update functionality for each row. On the same page I have 2 Button controls which submits the request to server. These button controls are Web Control & not HTML control. One of these buttons whose title is Delete is added on the aspx page in design view & also I double clicked on this button in design view to get the onclick code for this button in the code behind page. & for...
4
6311
by: JLJ | last post by:
I have a very simple webservice written in Java/Axis. It takes in a complexType with 2 string elements, userid and password. The response is a complexType containing two complexTypes each having 2 strings <wsdl:portType name=SecurityLoginService"> <wsdl:operation name="login"> <wsdl:input message="tns:loginRequest" name="loginRequest"/> <wsdl:output message="tns:loginResponse" name="loginResponse"/> </wsdl:operation> </wsdl:portType>
0
2365
by: ryan | last post by:
I've been tasked with consuming a Perl web service that was written by a person in a different department of my company. The problem is it's the guy's first attempt at web services and he doesn't know how to create the WDSL. I created web service with Visual Studio that mimics his service and after some tweaking of the soapAction in the WSDL I'm able to call his service successfully. When I use SOAPScope to look the messages being sent and...
1
2857
by: louis_la_brocante | last post by:
Dear all, I am having trouble generating a client proxy for a webservice whose methods return a "complex" type. The type is complex in that it is a class whose members are a mix of primitive types and of more elaborate classes implementing IXmlSerializable. The resulting WSDL file for the webservice has two separate schemas in its <types> sections, and the client proxy (generated with wsdl.exe) is missing the definitions of the...
0
2409
by: kencana | last post by:
hi All, I got problem in passing data (more than one) from soap client to the soap server. but if i only passing one data at a time, it works successfully.. The following is the error message i get when i pass more than one data: "SoapFault exception: looks like we got no XML document in C:\Program Files\MapGuideOpenSource\WebServerExtensions\www\phpviewersample\clienttry2.php:24 Stack trace: #0 : SoapClient->__call('getMap', Array) #1...
6
4589
by: Tomasz J | last post by:
Hello developers, I bind my TextBox control specyfying a format stored in my application global ApplicationContext object - it has a static string CurrencyFormat property. The problem - this works fine: Text='<%# Eval("Price", ApplicationContext.CurrencyFormat) %>'
2
6582
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click in the child datagrid and then go to the combobox and choose another vendor. When the new vendor is loaded nothing shows in the datagrid but the itemsource shows the info is there. Know if I click on the child cell and then click back on the...
0
8372
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8706
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7304
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1915
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1592
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.