CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 xml word wrap assistance

Print topic Send  topic

Author Message
satellitejack

Posts: 1
Posted: 07/12/2007, 9:40 AM

Hi there

Can anyone help me with a code to incorporate a word wrap with xml files I want to display on my website. As it is now ..the text display from the xml is all grouped together without paragraph separation. Any help would be greatly appreciated ..thanks Rob

Here is the .php I've created

<?

function xml_roadreport(){
global $Headline;
global $Content;
global $file;


$Headline=array();
$Content=array();
$file = "DNR_KPQX_ROADREPORT.xml";
do_xml_parse();

echo "<table width=100% cellpadding=5 cellspacing=0>";

for($i=0;$i<count($Headline);$i++){
?>

<tr>
<td align=left valign=top>
<span style="font-size:10pt"><b><?= $Headline[$i] ?></b></span>
</td>
</tr>
<tr>
<td align=left valign=top>
<span style="font-size:10pt"><?= $Content[$i] ?></span>
</td>

</tr>
<tr>
<td height=2 bgcolor=#dddddd>
</td>
</tr>


<?
}
echo "</table>";


}
require_once "xml_common.php";

?>

Here's the xml file I am using and I am capturing the content in the <headline> and <text> fields.


<?xml version="1.0" encoding="iso-8859-1"?>
<ROADREPORT>
<station>KPQX</station>
<lastupdate>2007/07/09 11:18:06</lastupdate>
<category>DNR</category>
<webpage>ROADREPORT</webpage>
<headline>Montana Road Constuction Projects Report - (Update)</headline>
<ClassCode></ClassCode>
<UserURL></UserURL>
<UserEMail></UserEMail>
<UserLogo></UserLogo>
<UserAudio></UserAudio>
<Slug>These are the road construction projects that are schedule in the Havre Division of the Montana Depart of ...more...</Slug>
<Text>These are the road construction projects that are schedule in the Havre Division of the Montana Depart of Transportation. Some of these projects may be INACTIVE at this time.

Road construction or paving projects scheduled in the area:
I-15 North and South of Brady road milling is in progress. Expect 15 minute delays, reduced speeds and single lane traffic.
US-2 West of East Glacier
Reconstruction grading is in
progress with reduced speeds and
gravel trucks on the road.

US-2 West of Cut Bank
Reconstruction work in progress.
Expect Detour, Reduced speeds to 35
MPH. Pilot Cars, Single-Lane
closures. Short Detour on Asphalt.

US-2 East of Shelby
A maintenance crack seal project is
taking place. Watch for pilot cars
And reduced speeds. Expect a 5 to 10
minute delay.

S-233 3 Miles North of Havre to the Canadian border crack sealing is in progress.
S-365 from 14 to 18 miles east of Brady an overlay project is underway. Expect 15 minute delays, a reduced speed limit, pilot cars and single lane traffic.

Travelers are reminded to obey all traffic speeds in the work zones, as traffic fines double in those areas. Also watch for workers, flaggers and equipment in those areas.and please be patient and give yourself extra time to reach your destination. And please remember to Buckle-Up!
And those are the work projects scheduled in the Havre Division of the Montanas Department of Transportation.
</Text>
<copytext>
<![CDATA[
<font face="Times New Roman" size=3>These are the road construction projects that are schedule in the Havre Division of the Montana Depart of Transportation. Some of these projects may be INACTIVE at this time. <br><br>Road construction or paving projects scheduled in the area:<br>I-15 North and South of Brady road milling is in progress. Expect 15 minute delays, reduced speeds and single lane traffic.<br>US-2 West of East Glacier<br>Reconstruction grading is in <br>progress with reduced speeds and<br>gravel trucks on the road.<br><br>US-2 West of Cut Bank <br>Reconstruction work in progress.<br>Expect Detour, Reduced speeds to 35<br>MPH. Pilot Cars, Single-Lane <br>closures. Short Detour on Asphalt.<br><br>US-2 East of Shelby<br>A maintenance crack seal project is<br>taking place. Watch for pilot cars<br>And reduced speeds. Expect a 5 to 10<br>minute delay.<br><br>S-233 3 Miles North of Havre to the Canadian border crack sealing is in progress.<br>S-365 from 14 to 18 miles east of Brady an overlay project is underway. Expect 15 minute delays, a reduced speed limit, pilot cars and single lane traffic.<br><br>Travelers are reminded to obey all traffic speeds in the work zones, as traffic fines double in those areas. Also watch for workers, flaggers and equipment in those areas.and please be patient and give yourself extra time to reach your destination. And please remember to Buckle-Up!<br>And those are the work projects scheduled in the Havre Division of the Montanas Department of Transportation.</font>
]]>
</copytext>
<headline>Havre Highway 2 Construction Report</headline>
<ClassCode></ClassCode>
<UserURL></UserURL>
<UserEMail></UserEMail>
<UserLogo></UserLogo>
<UserAudio></UserAudio>
<Slug>Heavy ulitlity work and road construction is in progress on sections of US Highway 2 through the town of Havre. ...more...</Slug>
<Text>Heavy ulitlity work and road construction is in progress on sections of US Highway 2 through the town of Havre. Motor travel is being routed through the work zone. Here is the update on current constructon:

Watch for flaggers and expect brief delays for equipment entering. Traffic control channels on gravel aprons provide access to businesses on the North side of US-2. Single lanes of traffic have been routed to the South side of the roadway on both the East and West ends of the project. Please be courteous to other drivers merging back into traffic lanes from business access. Utility work is proceeding Westward from the 14th Avenue intersection. The road is closed to loads over 12 Feet wide.
</Text>
<copytext>
<![CDATA[
<b><font face="MS Sans Serif" size=3>Heavy ulitlity work and road construction is in progress on sections of US Highway 2 through the town of Havre. Motor travel is being routed through the work zone. Here is the update on current constructon:<br><br>Watch for flaggers and expect brief delays for equipment entering. Traffic control channels on gravel aprons provide access to businesses on the North side of US-2. Single lanes of traffic have been routed to the South side of the roadway on both the East and West ends of the project. Please be courteous to other drivers merging back into traffic lanes from business access. Utility work is proceeding Westward from the 14th Avenue intersection. The road is closed to loads over 12 Feet wide.</font></b>
]]>
</copytext>
</ROADREPORT>
View profile  Send private message
klwillis


Posts: 428
Posted: 09/03/2007, 11:08 AM

How about adding <br/> ?

Quote satellitejack:
Hi there

Can anyone help me with a code to incorporate a word wrap with xml files I want to display on my website. As it is now ..the text display from the xml is all grouped together without paragraph separation. Any help would be greatly appreciated ..thanks Rob

Here is the .php I've created

<?

function xml_roadreport(){
global $Headline;
global $Content;
global $file;


$Headline=array();
$Content=array();
$file = "DNR_KPQX_ROADREPORT.xml";
do_xml_parse();

echo "<table width=100% cellpadding=5 cellspacing=0>";

for($i=0;$i<count($Headline);$i++){
?>

<tr>
<td align=left valign=top>
<span style="font-size:10pt"><b><?= $Headline[$i] ?></b></span>
</td>
</tr>
<tr>
<td align=left valign=top>
<span style="font-size:10pt"><?= $Content[$i] ?></span>
</td>

</tr>
<tr>
<td height=2 bgcolor=#dddddd>
</td>
</tr>


<?
}
echo "</table>";


}
require_once "xml_common.php";

?>

Here's the xml file I am using and I am capturing the content in the <headline> and <text> fields.


<?xml version="1.0" encoding="iso-8859-1"?>
<ROADREPORT>
<station>KPQX</station>
<lastupdate>2007/07/09 11:18:06</lastupdate>
<category>DNR</category>
<webpage>ROADREPORT</webpage>
<headline>Montana Road Constuction Projects Report - (Update)</headline>
<ClassCode></ClassCode>
<UserURL></UserURL>
<UserEMail></UserEMail>
<UserLogo></UserLogo>
<UserAudio></UserAudio>
<Slug>These are the road construction projects that are schedule in the Havre Division of the Montana Depart of ...more...</Slug>
<Text>These are the road construction projects that are schedule in the Havre Division of the Montana Depart of Transportation. Some of these projects may be INACTIVE at this time.

Road construction or paving projects scheduled in the area:
I-15 North and South of Brady road milling is in progress. Expect 15 minute delays, reduced speeds and single lane traffic.
US-2 West of East Glacier
Reconstruction grading is in
progress with reduced speeds and
gravel trucks on the road.

US-2 West of Cut Bank
Reconstruction work in progress.
Expect Detour, Reduced speeds to 35
MPH. Pilot Cars, Single-Lane
closures. Short Detour on Asphalt.

US-2 East of Shelby
A maintenance crack seal project is
taking place. Watch for pilot cars
And reduced speeds. Expect a 5 to 10
minute delay.

S-233 3 Miles North of Havre to the Canadian border crack sealing is in progress.
S-365 from 14 to 18 miles east of Brady an overlay project is underway. Expect 15 minute delays, a reduced speed limit, pilot cars and single lane traffic.

Travelers are reminded to obey all traffic speeds in the work zones, as traffic fines double in those areas. Also watch for workers, flaggers and equipment in those areas.and please be patient and give yourself extra time to reach your destination. And please remember to Buckle-Up!
And those are the work projects scheduled in the Havre Division of the Montanas Department of Transportation.
</Text>
<copytext>
<![CDATA[
<font face="Times New Roman" size=3>These are the road construction projects that are schedule in the Havre Division of the Montana Depart of Transportation. Some of these projects may be INACTIVE at this time. <br><br>Road construction or paving projects scheduled in the area:<br>I-15 North and South of Brady road milling is in progress. Expect 15 minute delays, reduced speeds and single lane traffic.<br>US-2 West of East Glacier<br>Reconstruction grading is in <br>progress with reduced speeds and<br>gravel trucks on the road.<br><br>US-2 West of Cut Bank <br>Reconstruction work in progress.<br>Expect Detour, Reduced speeds to 35<br>MPH. Pilot Cars, Single-Lane <br>closures. Short Detour on Asphalt.<br><br>US-2 East of Shelby<br>A maintenance crack seal project is<br>taking place. Watch for pilot cars<br>And reduced speeds. Expect a 5 to 10<br>minute delay.<br><br>S-233 3 Miles North of Havre to the Canadian border crack sealing is in progress.<br>S-365 from 14 to 18 miles east of Brady an overlay project is underway. Expect 15 minute delays, a reduced speed limit, pilot cars and single lane traffic.<br><br>Travelers are reminded to obey all traffic speeds in the work zones, as traffic fines double in those areas. Also watch for workers, flaggers and equipment in those areas.and please be patient and give yourself extra time to reach your destination. And please remember to Buckle-Up!<br>And those are the work projects scheduled in the Havre Division of the Montanas Department of Transportation.</font>
]]>
</copytext>
<headline>Havre Highway 2 Construction Report</headline>
<ClassCode></ClassCode>
<UserURL></UserURL>
<UserEMail></UserEMail>
<UserLogo></UserLogo>
<UserAudio></UserAudio>
<Slug>Heavy ulitlity work and road construction is in progress on sections of US Highway 2 through the town of Havre. ...more...</Slug>
<Text>Heavy ulitlity work and road construction is in progress on sections of US Highway 2 through the town of Havre. Motor travel is being routed through the work zone. Here is the update on current constructon:

Watch for flaggers and expect brief delays for equipment entering. Traffic control channels on gravel aprons provide access to businesses on the North side of US-2. Single lanes of traffic have been routed to the South side of the roadway on both the East and West ends of the project. Please be courteous to other drivers merging back into traffic lanes from business access. Utility work is proceeding Westward from the 14th Avenue intersection. The road is closed to loads over 12 Feet wide.
</Text>
<copytext>
<![CDATA[
<b><font face="MS Sans Serif" size=3>Heavy ulitlity work and road construction is in progress on sections of US Highway 2 through the town of Havre. Motor travel is being routed through the work zone. Here is the update on current constructon:<br><br>Watch for flaggers and expect brief delays for equipment entering. Traffic control channels on gravel aprons provide access to businesses on the North side of US-2. Single lanes of traffic have been routed to the South side of the roadway on both the East and West ends of the project. Please be courteous to other drivers merging back into traffic lanes from business access. Utility work is proceeding Westward from the 14th Avenue intersection. The road is closed to loads over 12 Feet wide.</font></b>
]]>
</copytext>
</ROADREPORT>

_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.