Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help formatting XML data into an address block and columns

Status
Not open for further replies.

Evil8

MIS
Mar 3, 2006
313
US
I am trying to post meeting information on an html page by pulling XML data into the page. I've done that, but I'm having issues fomating that into a block.

Joe's
January 15, 2012 - 1:00pm
100 Main St
Mytown, MS 12345

I don't use css much so I'm not sure how, or if, this would work with the datafld="" property.

Also the output table is one long single column, is there a way to force the data into a certain table row length and then into more columns?

Here's my code:
Code:
<table width="80%" datasrc="#myXML" border="1" align="center" bordercolor="#FFFFFF">
  <caption>
  <span><strong><font color="#990000" size="6">Meetings By City</font></strong></span> 
  </caption>

  <tbody>
		<tr> 
      <td><div align="left" valign="top"><font size="2"><strong><span datafld="name"> </span></strong></font></div><br>
      									<font size="2"><span datafld="edate"> </span></font> - <font size="2"><span datafld="etime"> </span></font></div><br>
      									<font size="2"><span datafld="address"> </span></font></div><br>
      									<font size="2"><span datafld="city"> </span></font>, <font size="2"><span datafld="state"> </span>  <font size="2"><span datafld="zip"> </span></div><br>
      									</div></td>
    </tr>
  </tbody>
</table>

All help is appreciated!

 
is the "code" above what is returned from the server or is this the current final output? xml is just data, it can be formatted however you like using XSLT.

I would start with this template
Code:
<div class="event">
<h1>[title]</h1>
<p>
[name]</br>
[date]</br>
[address line 1]</br>
[city], [state], [zip code]</br>
</p>
</div>
it's been awhile since I used XSLT directly, but there are plenty of examples online.

you can then style these elements with
Code:
div.event {}
div.event h1 {}
div.event p {}

Jason Meckley
Senior Programmer

faq855-7190
faq732-7259
My Blog
 
The output is what the user sees on the web page. I'm just now starting to use XML as I've used ms access 2010 to input the meeting information and I can sort and output pages as xml data. I thought this would be a simpler process once all the bugs were worked out, but it's quickly becomming a pain.

I'll look into the XSLT stuff. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top