[SOLVED] problem with xsl(t)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

[SOLVED] problem with xsl(t)

Post by timvw »

ok, i'm playing around with xsl(t) and everything works....

however, if i have something like

Code: Select all

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

<xsl:output method='xml'
            indent="yes"
            omit-xml-declaration="yes"
            doctype-public = "-//W3C//DTD XHTML 1.0 Strict//EN"
            doctype-system = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
/>

<xsl:template match="/">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Tim Van Wassenhove :: Contact</title>
<link rel="stylesheet" href="/styles/style.css" type="text/css"/>
</head>

<body>

<form action="" method="post">
                <div class="row">
                    <span class="label">Message:</span>
                    <span class="input"><textarea name="message" rows="10" cols="40"></textarea></span>
                </div>
</form>
it will be transformed to <textarea name="message" rows="10" cols="40"/>. This is really unwanted... Anybody knows how to avoid this? (using php4.3.10 and sablotron)

The current workaround is to put <xsl:text> </xsl:text> in the textarea, but i don't like this.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

seems like a bug in the translation to me.. :?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

found the solution :)

choose html instead of xml for output method and problem was solved :)

Code: Select all

<xsl:output method='html'
             indent="yes"
             omit-xml-declaration="yes"
             doctype-public = "-//W3C//DTD XHTML 1.0 Strict//EN"
             doctype-system ="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
/>
Post Reply