www.webdeveloper.com
Results 1 to 7 of 7

Thread: [RESOLVED] Data binding

Threaded View

  1. #1
    Join Date
    Nov 2009
    Posts
    65

    resolved [RESOLVED] Data binding

    Hey

    XML:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <photobook_cat>
    	<BOOK>
    		<title>LASZLO MOHOLY-NAGY</title>
    		<publisher>Phaidon</publisher>
    		<year>2001</year>
    	</BOOK>
    	<BOOK>
    		<title>EADWEARD MUYBRIDGE</title>
    		<publisher>Phaidon</publisher>
    		<year>2001</year>
    	</BOOK>
    	<BOOK>
    		<title>THE AMERICANS - Robert Frank</title>
    		<publisher>Steidl</publisher>
    		<year>2008</year>
    	</BOOK>
    	<BOOK>
    		<title>DOG DAYS BOGOTA - Alec Soth</title>
    		<publisher>Steidl</publisher>
    		<year>2007</year>
    	</BOOK>
    </photobook_cat>
    HTML:
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1-strict.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Databinding via xml & data-isles</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
    <body>
    
    <xml id="photobook_cat" src="photobook_cat.xml"></xml>
    
    <table border="1" datasrc="#photobook_cat">
    
    <thead>
    <tr>
    	<th>Title</th>
    	<th>Publisher</th>
    	<th>Year</th>
    </tr>
    </thead>
    
    <tfoot>
    	<tr>
    		<th colspan="3">This is a concised outtake of my photobook collection</th>
    	</tr>
    </tfoot>
    
    <tbody>
    	<tr>
    		<td><span datafld="title"></span></td>
    		<td><span datafld="publisher"></span></td>
    		<td><span datafld="year"></span></td>
    	</tr>
    </tbody>
    </table>
    </body>
    </html>
    I do not succeed in retrieving data from the xml file. Any idea why it doesn't work?

    Also I tried using several doctypes(strict/tranistional/frameset) and they all failed at validation. Is there a way to have a valide document when you want to include xml data into the html document?
    Last edited by ajajajak; 01-14-2010 at 07:30 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles