SV: [PHP-DB] Database => XML
| From: | Fredrik Larsson | Date: | Tue, 03 Oct 2000 15:51:38 +0000 |
| Subject: | SV: [PHP-DB] Database => XML | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-3268@lists.php.net to get a copy of this message | ||
Hi,
Is your webserver configured to run the .xml-file through PHP-engine?
Normally it would only be .php/.php3.
Regards, Fredrik.
-----Ursprungligt meddelande-----
Från: Martin Bouman [mailto:M.Bouman@telecats.nl]
Skickat: den 3 oktober 2000 15:58
Till: php-db@lists.php.net
Kopia: php-general@lists.php.net; php-dev@lists.php.net
Ämne: [PHP-DB] Database => XML
> Dear Sir / Madam,
>
> I am a student working at TeleCats BV in the Netherlands.
> The project I am working on right now has to do with XML.
> The company wants me to read records from an MS Access database
> and put htese in a XML file (just like with HTML (I use Apache Cocoon XML
> Server)), which
> will be translated to HTML, WML or VXML bymeans of XSL.
>
> The problem is the first part. To read the records and put them in a XML
> file.
> Below is an example of how our XML-file looks:
>
> <?xml version="1.0"?>
> <?xml-stylesheet href="rooster.xsl" type="text/xsl"?>
> <?cocoon-process type="xslt"?>
>
> <?php
> Include("db.php");
> $dbcart = new db;
> $dbcart->init("odbc");
> $dbcart->open("rooster","localhost","","");
> $query="SELECT *
> FROM Rooster;
> $dbcart->query($query);
> ?>
>
> <programma>
> <?php
> while($dbcart->getrow()) {
> $ps = $dbcart->field(1);
> $datum = $dbcart->field(2);
> $sport1 = $dbcart->field(3);
> $sport2 = $dbcart->field(4);
> ?>
> <dag>
> <ps><?php echo $ps; ?></ps>
> <datum><?php echo $datum; ?></datum>
> <sport1><?php echo $sport1; ?></sport1>
> <sport2><?php echo $sport2; ?></sport2>
> </dag>
> <?php
> }
> $dbcart->close();
> ?>
> </programma>
>
> The first line indicates that it is an XML-file.
> The second line associates the stylesheet with it.
> The third line indicates that Cocoon should handle the XML-file.
> 'db.php' makes the connection to the database 'rooster'.
> When we request the XML-page in a webbrowser the HTML-code
> (generated by the XSL-file) is presented to me, but without the values
> ($datum, $sport1, etc.).
> Is there a solution to this problem? Can PHP 4.02 read records from a
> database from within a XML-file and
> translate them by means of XSL?
>
> I hope you can help me with this problem and am looking forward to your
> reaction!
> Yours Sincerely,
> Martin Bouman, TeleCats BV (Netherlands)
> P.s: I have enclosed all the files described above.
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net