|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Error in WML code
Wow, not too much traffic in this forum... I still hope that someone can help me.
I run a php-script that produces a wml output but unfortunately not with the desired content. here is my code: PHP Code:
The wml-validator provided by w3schools.org reports an error in the line with the first option-tag. It says: "Element content invalid according to the DTD/scheme". can anyone see the mistake I made? cheers |
|
#2
|
|||
|
|||
|
what is your apache config (httpd.conf)?
is it only : AddType text/vnd.wap.wml .wml AddType application/vnd.wap.wmlc .wmlc AddType text/vnd.wap.wmlscript .wmls AddType application/vnd.wap.wmlscriptc .wmlsc AddType image/vnd.wap.wbmp .wbmp or you configure it with php : AddType application/x-httpd-php .php3 .php .phtml .wml ? if you choose the first one, i think it would work well according to your script. But if fail, I suggest you choose the 2nd choice and give this extra syntax into your first line of the script. <? Header("Content-type: text/vnd.wap.wml"); ?> PS. sorry for my bad english i hope you understand. |
|
#3
|
||||
|
||||
|
Heyup ! I tried this out on my system, and used the PyWeb emulator to check it. It objected to the <br/> at the end of each option line. The other thing I had problems with was the header, and this has been the case for quite a while now. It seems to be very picky about format and spacing, so in the end I constructed a PHP header which I know include in all my WAP/WML pages. Also, i don't know if it's significant, but I changed single quotes to double quotes.
The code below shows the final result, which seems to work. Code:
<?php
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<card id="card1" title="Shopping">
<p>
<do type="accept">
<go href="wap.php" method="post">
<postfield name="items" value="$Items"/>
</go>
</do>
Shoppinglist:<br/>
<select name="Items" multiple="true">
<option value="5">Veg</option>
<option value="6">Milk</option>
<option value="7">Thuna fish</option>
<option value="8">Salad</option>
<option value="9">Meat (lots of!)</option>
</select>
</p>
</card>
</wml>
inijoey was right about the WML Apache config - mine looks like this.. Code:
AddType application/x-httpd-php .php .php3 .php4 .htm .html .wml AddType text/vnd.wap.wmlscript .wmls AddType image/vnd.wap.wbmp .wbmp Hope this helps.. PS .. I added a veg option as number 5 .. ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > Error in WML code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|