Sorry for such an unusual question:
I have an XML file which I am trying to pull into a php page. Everything works and here is my issue.
The XML file has 15 children of which each is called in some way or another into a table. However, on the 4th call, the <description>Economics, Finance, and Management.</description> seems to get cut off on the 4th table for NO REASON (just reads agement.). I tried <description>Management.</description> and that worked; I tried <description>Finance, and Management.</description> and that worked; but anything else within just messed up the results on the webpage. I am not sure why this is doing this or how to fix it.
<tr><td width="110" align="right" valign="top" class="coursedesc"><b>Description:</b></td>
<td width="515" align="left" valign="top" class="coursetd"><?php echo $course_data[$a]["description"]; ?></td></tr>
the other 3 tables work fine -- but once it reads this one it just screws up that description piece -- non of the others are messed up and the other data elemets called from the XML file after this one piece are fine also.
Any ideas? PLEASE???
Anthonyit almost sounds like a php bug we had in version 4.2.3 bu tthe bug was the other way around. it would cut off anythign after the 4 character, not show everything after a certain character. what is teh method you are using to get the info.
I am not big on XML but I will try to help.This is the first statement in my page.
include ($GLOBALS["path"]."cma_courses_parser.php");
That calls the parser script which is attached in this post.
and of course the code to call it is:
<tr>
<td width="110" align="right" valign="top" class="coursedesc"><b>Description:</b></td>
<td width="515" align="left" valign="top" class="coursetd"><?php echo $course_data[$a]["description"]; ?></td>
</tr>
Anthonyyou have some weird things going on in those functions. a lot of wasted code too.
but try this
while( $data = fread($fp, filesize("cma_courses.xml")) ) {I wasn't entirely sure where i was suppost to type that code in. You have seen my Parser script, so here is what the XML file looks like:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<!DOCTYPE training [
<!ELEMENT course (date_start, date_end, date_month, date_day, date_year, time_start, time_end, class_day, name, description, course_number, notes1, notes2, notes3, hours, type, type_group, price, location_name)>
<!ELEMENT date_start (#PCDATA)>
<!ELEMENT date_end (#PCDATA)>
<!ELEMENT date_month (#PCDATA)>
<!ELEMENT date_day (#PCDATA)>
<!ELEMENT date_year (#PCDATA)>
<!ELEMENT time_start (#PCDATA)>
<!ELEMENT time_end (#PCDATA)>
<!ELEMENT class_day (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT course_number (#PCDATA)>
<!ELEMENT notes1 (#PCDATA)>
<!ELEMENT notes2 (#PCDATA)>
<!ELEMENT notes3 (#PCDATA)>
<!ELEMENT hours (#PCDATA)>
<!ELEMENT type (#PCDATA)>
<!ELEMENT type_group (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT location_name (#PCDATA)>
]>
<training>
<course>
<date_start>2004 10 05</date_start>
<date_end>2004 12 16</date_end>
<date_month>10</date_month>
<date_day>05</date_day>
<date_year>2004</date_year>
<time_start>18:15</time_start>
<time_end>21:15</time_end>
<class_day>Tuesdays</class_day>
<name>Course Part 3</name>
<description>Management Reporting, Analysis, and Behavioral Issues.</description>
<course_number>blah101</course_number>
<notes1>*Note that this course is only open to people meeting one of the following criteria:</notes1>
<notes2>1) registered with me prior to July 1, 2004;</notes2>
<notes3>2) Passed at least one part of the 101 or 102 examinations prior to July 1, 2004.</notes3>
<hours>21</hours>
<type>Special</type>
<type_group>Unique</type_group>
<price>10.00`(includes all materials)</price>
<location_name></location_name>
</course>
</training>
This is my loop within my PHP code to call this xml is:
for ($a=0; $a < $counter_course; ++$a) {
and within this loop i just call each piece into a table using XHTML and PHP like so...
<td align="left" colspan="2" class="coursehd"><?php echo $course_data[$a]["name"]; ?></td>
This is why i do not understand how the information is getting messed up on ONE piece when nothing else is messed up and the same XML tab is fine elsewhere.
Anthony
you type that code in where you have it in the txt file you posted "cma_courses_parser.txt" it is at teh botom. use mine instead of the one you have.I guess what you are telling me is that, with a predefined number of 4096, I am running into an overflow error really. To much information, but not enough memory retention.
Thank you very much.
That was a little more difficult to notice since I was taking that from a book that did not explain the point of the 4096. Hell...I figured that was enough for anything, like setting something to maximum.
Well thx again, it has worked so far.
Anthonythat was my first guess. surprised it worked. maybe it was in need of more.
cool
I have an XML file which I am trying to pull into a php page. Everything works and here is my issue.
The XML file has 15 children of which each is called in some way or another into a table. However, on the 4th call, the <description>Economics, Finance, and Management.</description> seems to get cut off on the 4th table for NO REASON (just reads agement.). I tried <description>Management.</description> and that worked; I tried <description>Finance, and Management.</description> and that worked; but anything else within just messed up the results on the webpage. I am not sure why this is doing this or how to fix it.
<tr><td width="110" align="right" valign="top" class="coursedesc"><b>Description:</b></td>
<td width="515" align="left" valign="top" class="coursetd"><?php echo $course_data[$a]["description"]; ?></td></tr>
the other 3 tables work fine -- but once it reads this one it just screws up that description piece -- non of the others are messed up and the other data elemets called from the XML file after this one piece are fine also.
Any ideas? PLEASE???
Anthonyit almost sounds like a php bug we had in version 4.2.3 bu tthe bug was the other way around. it would cut off anythign after the 4 character, not show everything after a certain character. what is teh method you are using to get the info.
I am not big on XML but I will try to help.This is the first statement in my page.
include ($GLOBALS["path"]."cma_courses_parser.php");
That calls the parser script which is attached in this post.
and of course the code to call it is:
<tr>
<td width="110" align="right" valign="top" class="coursedesc"><b>Description:</b></td>
<td width="515" align="left" valign="top" class="coursetd"><?php echo $course_data[$a]["description"]; ?></td>
</tr>
Anthonyyou have some weird things going on in those functions. a lot of wasted code too.
but try this
while( $data = fread($fp, filesize("cma_courses.xml")) ) {I wasn't entirely sure where i was suppost to type that code in. You have seen my Parser script, so here is what the XML file looks like:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<!DOCTYPE training [
<!ELEMENT course (date_start, date_end, date_month, date_day, date_year, time_start, time_end, class_day, name, description, course_number, notes1, notes2, notes3, hours, type, type_group, price, location_name)>
<!ELEMENT date_start (#PCDATA)>
<!ELEMENT date_end (#PCDATA)>
<!ELEMENT date_month (#PCDATA)>
<!ELEMENT date_day (#PCDATA)>
<!ELEMENT date_year (#PCDATA)>
<!ELEMENT time_start (#PCDATA)>
<!ELEMENT time_end (#PCDATA)>
<!ELEMENT class_day (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT course_number (#PCDATA)>
<!ELEMENT notes1 (#PCDATA)>
<!ELEMENT notes2 (#PCDATA)>
<!ELEMENT notes3 (#PCDATA)>
<!ELEMENT hours (#PCDATA)>
<!ELEMENT type (#PCDATA)>
<!ELEMENT type_group (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT location_name (#PCDATA)>
]>
<training>
<course>
<date_start>2004 10 05</date_start>
<date_end>2004 12 16</date_end>
<date_month>10</date_month>
<date_day>05</date_day>
<date_year>2004</date_year>
<time_start>18:15</time_start>
<time_end>21:15</time_end>
<class_day>Tuesdays</class_day>
<name>Course Part 3</name>
<description>Management Reporting, Analysis, and Behavioral Issues.</description>
<course_number>blah101</course_number>
<notes1>*Note that this course is only open to people meeting one of the following criteria:</notes1>
<notes2>1) registered with me prior to July 1, 2004;</notes2>
<notes3>2) Passed at least one part of the 101 or 102 examinations prior to July 1, 2004.</notes3>
<hours>21</hours>
<type>Special</type>
<type_group>Unique</type_group>
<price>10.00`(includes all materials)</price>
<location_name></location_name>
</course>
</training>
This is my loop within my PHP code to call this xml is:
for ($a=0; $a < $counter_course; ++$a) {
and within this loop i just call each piece into a table using XHTML and PHP like so...
<td align="left" colspan="2" class="coursehd"><?php echo $course_data[$a]["name"]; ?></td>
This is why i do not understand how the information is getting messed up on ONE piece when nothing else is messed up and the same XML tab is fine elsewhere.
Anthony
you type that code in where you have it in the txt file you posted "cma_courses_parser.txt" it is at teh botom. use mine instead of the one you have.I guess what you are telling me is that, with a predefined number of 4096, I am running into an overflow error really. To much information, but not enough memory retention.
Thank you very much.
That was a little more difficult to notice since I was taking that from a book that did not explain the point of the 4096. Hell...I figured that was enough for anything, like setting something to maximum.
Well thx again, it has worked so far.
Anthonythat was my first guess. surprised it worked. maybe it was in need of more.
cool