Code: Select all
<?php
$fp = fopen('structure_names.txt','r');
if (!$fp) {echo 'Error; can not open file.'; exit;}
while (!feof($fp))
{
$line = fgets($fp, 512);
list ($name, $tab, $desc) = split ('\;', $line);
echo '
<table>
<tr>
<td>'.$tab.'.</td>
<td>'.$name.'</td>
<td>'.$desc.'</td>
</tr>
</table>';
/*
$content_intro=
"
<?xml version=\"1.0\"?>
<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">
<xsl:template match=\"/\">
<TABLE STYLE=\"border:1px solid black\">
<tr><b>".$name."</b></tr>";
$fp = fopen("c://apache//htdocs//xsl//".$ime.".xsl", "w");
fwrite ($fp, $content_intro);
// fclose($fp);
*/
$fp2 = fopen('files_name.txt','r');
if (!$fp2) {echo 'Error; can not open the file'; exit;}
while (!feof($fp2))
{
$line2 = fgets($fp2, 512);
list ($namefile, $descfile) = split ('\;',$line2);
echo '
<table>
<tr>
<td>'.$descfile.'</td>
<td>'.$namefile.'</td>
</tr>
</table>';
$content_head=
"<TR>
<TD STYLE=\"font-size:11pt; font-family:Verdana;\" bgcolor=\"gray\">".$namefile."</TD>
<TD width=\"1200\" nowrap=\"nowrap\" bgcolor=\"#999999\"><xsl:copy-of select=\"document('".$descfile."')//focus1/".$name."/.\"/></TD>
</TR>";
// $fp = fopen("c://apache//htdocs//xsl//".$name.".xsl", "a");
fwrite ($fp, $content_head);
*/
$fp2++;
}
$fp++;
fclose($fp2);
}
fclose($fp);
?>Code: Select all
name1;1;description1
name2;2;description2Code: Select all
xml1.xml;namefile1
xml2.xml;namefile2
xml3.xml;namefile3with the content of each files name1.xsl, name2.xsl, name3.xsl, etc... of files_names.txt.
If anyone can find the problem why both while loops aren't producing the results, let me know!
thank you!