Jump to content

XML into HTML


Guest equintiy

Recommended Posts

Guest equintiy

I am trying to load a xml document into a table in an html file. I finally got the data set to load and it will display the first line of the XML in the table but it will not continue to populate as if i were to write a XSL for the XML. Due to limitations and business requirements I cannot use a XSL to render the table. What am I doing wrong? My codes is as follows: <xml src="products.xml" id="xmldso" async="false"></xml><table datasrc="#xmldso" width="894" border="1" bordercolor="#605331" bordercolorlight="#605331" bordercolordark="#605331" bgcolor="#f5f1e6" frame="box"> <thead> <tr class="style2"><th align="center">Item No.</th> <th align="center">Vintage</th> <th align="center">Size</th> <th align="left">Wine Name</th> <th align="center">Avail</th> <th align="center">Out State</th> <th align="center">In State</th> <th align="center">Appellation</th> <tr align="left" class="style2"> <td><div align="left"><span datasrc="#xmldso" datafld="ITEM_NUMBER"></span></div></td> <td><div align="center"><span datasrc="#xmldso" datafld="YEAR"></span></div></td> <td><div align="center"><span datasrc="#xmldso" datafld="SIZE"></span></div></td> <td><div align="left"><span datasrc="#xmldso" datafld="WINE"></span></div></td> <td><div align="center"><span datasrc="#xmldso" datafld="AVAIL"></span></div></td> <td><div align="right">$<span datasrc="#xmldso" datafld="OS_PRICE"></span></div></td> <td><div align="right">$<span datasrc="#xmldso" datafld="IS_PRICE"></span></div></td> <td><div align="left"><span datasrc="#xmldso" datafld="APPELLATION"></span></div></td> </tr></table>Why doesn't this produce more than one line, or what do I need to do to produce the next lines of the XML? I have tried to copy the non-header lines, but it just produces two duplicate lines. Please help. Thank you.

Link to comment
Share on other sites

What sort of limitations could forbid XSLT usage? It could be done on the client side and embed with JavaScript after all. No one is forcing you to make a whole XSLT page or use a server side scripting processor, though that are better options.Anyway, let's see what can we do. Now, how does your XML look like? It should be something like:

<rootElement>  <item>	<ITEM_NUMBER>1</ITEM_NUMBER>	<YEAR>2005</YEAR>	<SIZE>10</SIZE>	<WINE>yes</WINE>	<AVAIL>yes</AVAIL>	<OS_PRICE>50</OS_PRICE>	<IS_PRICE>60</IS_PRICE>	<APPELLATION>5</APPELLATION>  </item>  <item>	<ITEM_NUMBER>2</ITEM_NUMBER>	<YEAR>2006</YEAR>	<SIZE>20</SIZE>	<WINE>no</WINE>	<AVAIL>no</AVAIL>	<OS_PRICE>30</OS_PRICE>	<IS_PRICE>40</IS_PRICE>	<APPELLATION>6</APPELLATION>  </item></rootElement>

Any other type of structure is not going to work with Data Islands.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...