Connecting Tech Pros Worldwide Forums | Help | Site Map

web app with php, xml, xsl, css

petermichaux@yahoo.com
Guest
 
Posts: n/a
#1: Jul 17 '05
Hi,

I'm interested in building database web applications. A perfect example
of what I want to do would be an e-commerce website with php, xml, xsl,
css, pear db and mysql. I understand the basics of the technology parts
seperately but I would like to read about integrating them and managing
the files (directory structure). Any books or sites that cover this
integration?

Thank you,
Peter


Tony Marston
Guest
 
Posts: n/a
#2: Jul 17 '05

re: web app with php, xml, xsl, css


I have a sample application available for download at
http://www.tonymarston.net/php-mysql...plication.html which is built
with PHP using XML, XSL, XHTML, CSS and MySQL. I don't use PEAR DB as I have
my own database abstraction layer.

There is plenty of documentation on my site which explains the thought
processes behind this architecture. It may be of some use to you.

--
Tony Marston

http://www.tonymarston.net



<petermichaux@yahoo.com> wrote in message
news:1119303788.648764.156080@g44g2000cwa.googlegr oups.com...[color=blue]
> Hi,
>
> I'm interested in building database web applications. A perfect example
> of what I want to do would be an e-commerce website with php, xml, xsl,
> css, pear db and mysql. I understand the basics of the technology parts
> seperately but I would like to read about integrating them and managing
> the files (directory structure). Any books or sites that cover this
> integration?
>
> Thank you,
> Peter
>[/color]


RC
Guest
 
Posts: n/a
#3: Jul 17 '05

re: web app with php, xml, xsl, css


petermichaux@yahoo.com wrote:
Any books or sites that cover this[color=blue]
> integration?[/color]

O'Reilly books and/or Teacher Yourself xxxx in ## Weeks/Days
petermichaux@yahoo.com
Guest
 
Posts: n/a
#4: Jul 17 '05

re: web app with php, xml, xsl, css


RC,

I haven't seen any O'Reilly books or Teach Yourself books that cover
the integration fo these technologies. Did I miss something?

Thanks,
Peter

Malcolm Dew-Jones
Guest
 
Posts: n/a
#5: Jul 17 '05

re: web app with php, xml, xsl, css


petermichaux@yahoo.com wrote:
: RC,

: I haven't seen any O'Reilly books or Teach Yourself books that cover
: the integration fo these technologies. Did I miss something?

Php has an xml parsing library, so read the manual for that. Other than
that there isn't really anything to "integrate".

Xml is just text, so php can output it without any "integration" required.

There isn't anything to integrate between php and css either, they are
simply different things, kind of like asking to integrate php and your
mouse.

xsl-fo is just xml. xsl-t is used to transform xml. Unless you are
asking php to do the transform then php has nothing to do with it. Since
php doesn't have a built in library that I know of to do xslt transforms,
(though you can read the php manuals, ver 4 and ver 5 to be sure), then
"integration" consists of calling an external program when you need it,
which has nothing to do with xsl per se.

So, I think the reason you haven't see a book to cover this is because
there isn't really anything to "integrate". If you have a reason to use
xml, or xsl, or css, then examine the tools php provides and use them to
best effect, exactly as you would with any other programming task.



--

This space not for rent.
petermichaux@yahoo.com
Guest
 
Posts: n/a
#6: Jul 17 '05

re: web app with php, xml, xsl, css


Hi Malcolm,

I grew up next door to a Malcolm Dew-Jones.

I think I figured out what I was after. I've attached it below.

Thanks,
Peter

<?php

//Step 1: Generate the xml string. This could be generated dynamically
by querying a database

$xmlString = "<collection>";
$xmlString .= "<cd>";
$xmlString .= "<title>Sailing The Seas Of Cheese</title>";
$xmlString .= "<artist>Primus</artist>";
$xmlString .= "<year>1991</year>";
$xmlString .= "</cd>";
$xmlString .= "<cd>";
$xmlString .= "<title>Pure Guava</title>";
$xmlString .= "<artist>Ween</artist>";
$xmlString .= "<year>1992</year>";
$xmlString .= "</cd>";
$xmlString .= "</collection>";


// Step 2: Transform the xmlString into html by using the xsl file

$xml = new DomDocument;
$xml->loadXml($xmlString);

$xsl = new DomDocument;
$xsl->load('collection.xsl');

$proc = new XsltProcessor;
$proc->importStyleSheet($xsl);

$cdListHtml = $proc->transformToXml($xml);


// Step 3: Output the document that will be sent to the viewers browser

echo "<html>\n";
echo "<head>\n";
echo "\t<link href='collection.css' type='text/css'
rel='stylesheet'/>\n";
echo "</head>\n";
echo "<body>\n";
echo $cdListHtml;
echo "</body>\n";
echo "</html>\n";
?>

Marcel
Guest
 
Posts: n/a
#7: Jul 17 '05

re: web app with php, xml, xsl, css


PHP and MySQL Web Development by Luke Welling and Laura Thomson might be
what you're after. Web: www.developers-library.com

Marcel

<petermichaux@yahoo.com> wrote in message
news:1119303788.648764.156080@g44g2000cwa.googlegr oups.com...[color=blue]
> Hi,
>
> I'm interested in building database web applications. A perfect example
> of what I want to do would be an e-commerce website with php, xml, xsl,
> css, pear db and mysql. I understand the basics of the technology parts
> seperately but I would like to read about integrating them and managing
> the files (directory structure). Any books or sites that cover this
> integration?
>
> Thank you,
> Peter
>[/color]


Malcolm Dew-Jones
Guest
 
Posts: n/a
#8: Jul 17 '05

re: web app with php, xml, xsl, css


petermichaux@yahoo.com wrote:
: Hi Malcolm,

: I grew up next door to a Malcolm Dew-Jones.

hum, I wouldn't be surprised if that's the same Malcolm that lived with my
Mom and Dad :)

: I think I figured out what I was after. I've attached it below.

: Thanks,
: Peter

: <?php

: //Step 1: Generate the xml string. This could be generated dynamically
: by querying a database

: $xmlString = "<collection>";
: $xmlString .= "<cd>";
: $xmlString .= "<title>Sailing The Seas Of Cheese</title>";
: $xmlString .= "<artist>Primus</artist>";
: $xmlString .= "<year>1991</year>";
: $xmlString .= "</cd>";
: $xmlString .= "<cd>";
: $xmlString .= "<title>Pure Guava</title>";
: $xmlString .= "<artist>Ween</artist>";
: $xmlString .= "<year>1992</year>";
: $xmlString .= "</cd>";
: $xmlString .= "</collection>";


: // Step 2: Transform the xmlString into html by using the xsl file

: $xml = new DomDocument;
: $xml->loadXml($xmlString);

: $xsl = new DomDocument;
: $xsl->load('collection.xsl');

: $proc = new XsltProcessor;
: $proc->importStyleSheet($xsl);

: $cdListHtml = $proc->transformToXml($xml);

Well, look at that, shows how much I know about php, doesn't it. I don't
see that in my php online docs. Time to do a php upgrade, I guess - I
hadn't realized I was that out of date. Or maybe I just didn't install
everything. In any case, checking now I see that various, interesting,
XML related capabilities are documented in the php manual (not mine, but
the one at the php web site), so I guess the php manual is still the best
place to look.


: // Step 3: Output the document that will be sent to the viewers browser

: echo "<html>\n";
: echo "<head>\n";
: echo "\t<link href='collection.css' type='text/css'
: rel='stylesheet'/>\n";
: echo "</head>\n";
: echo "<body>\n";
: echo $cdListHtml;
: echo "</body>\n";
: echo "</html>\n";
: ?>

thanks, bye.

--

This space not for rent.
Closed Thread