hi sir! little bit lost Pls help!
how can I add css file for may xml created from php?

    <?php
    bla bla bla.....
    ---------<?xml-stylesheet type="text/css" href="markers.css"?>-------how can i add this line?
    echo '<markers>';
    while ($row = @mysql_fetch_assoc($result)){
    echo '<marker ';
    echo 'name ="' . parseToXML($row['name']) . '" ';
    echo 'address ="' . parseToXML($row['address']) . '" ';
    echo 'lat ="' . $row['lat'] . '" ';
    echo 'lng ="' . $row['lng'] . '" ';
    echo '/>';
    }
    echo '</markers>';
    ?>

Link to css file put in XSLT file, like:

<?php

header("Content-type:text/xml;charset=utf-8");
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<?xml-stylesheet type=\"text/xsl\" href=\"transform.xsl\" ?>";

echo '<markers>';
    while ($row = @mysql_fetch_assoc($result)){
    echo '<marker ';
    echo 'name ="' . parseToXML($row['name']) . '" ';
    echo 'address ="' . parseToXML($row['address']) . '" ';
    echo 'lat ="' . $row['lat'] . '" ';
    echo 'lng ="' . $row['lng'] . '" ';
    echo '/>';
    }
echo '</markers>';

?>

File "transform.xsl" e.g.

<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <link rel="stylesheet" type="text/css" href="/style.css" />
            <title>My Page TITLE</title>
        </head>
        <body>
            <xsl:apply-templates />
        </body>
    </html>
</xsl:template>

<xsl:template match="/markers">
    <xsl:for-each select="marker">
        ................
        ................
        ................
    </xsl:for-each>
</xsl:template>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.