Mobile Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsMobile ProgrammingMobile Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 25th, 2002, 09:22 AM
Begbie Begbie is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 48 Begbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
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:
<?xml version="1.0"?>
<!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='6'>Milk</option><br/>
            <option value='7'>Thuna fish</option><br/>
            <option value='8'>Salad</option><br/>
            <option value='9'>Meat (lots of!)</option><br/>
        </select>
        </p>
    </card>
</wml>


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

Reply With Quote
  #2  
Old May 31st, 2002, 05:09 AM
inijoey inijoey is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Posts: 4 inijoey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #3  
Old May 31st, 2002, 07:31 AM
peterg's Avatar
peterg peterg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: Alton,Hampshire,UK
Posts: 40 peterg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
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 ..

Reply With Quote
Reply

Viewing: Dev Shed ForumsMobile ProgrammingMobile Programming > Error in WML code

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap