473,662 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WAP and <? tag

Hi all.

I'm a somehow rusty on PHP, so maybe this is a dumb question...
I'm playing a bit with WAP developing, and found a simple problem right at
the beginning.
All the WAP pages that the editor (WAPTor) generate begin with
<?xml version="1.0"?>

That, <? is also the PHP tag for the beginning of the PHP scripting...
I've solved with this:
<?
echo("<?xml version=\"1.0\" ?>\n");
echo("<!-- created by WAPtor (http://www.wapdrive.net/) -->");
echo("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.or g/DTD/wml_1.1.xml\">\ n\n");
?>

But I'd like to know if there is a bettere way to do this...
Thx in advance.
Jul 17 '05 #1
4 2005
On Mon, 29 Mar 2004 22:02:53 +0000, Drizzt wrote:
Hi all.

I'm a somehow rusty on PHP, so maybe this is a dumb question... I'm
playing a bit with WAP developing, and found a simple problem right at
the beginning.
All the WAP pages that the editor (WAPTor) generate begin with <?xml
version="1.0"?>

That, <? is also the PHP tag for the beginning of the PHP scripting...
I've solved with this:
<?
echo("<?xml version=\"1.0\" ?>\n");
echo("<!-- created by WAPtor (http://www.wapdrive.net/) -->");
echo("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.or g/DTD/wml_1.1.xml\">\ n\n"); ?> But I'd like to know if there is a bettere way to do this...
Thx in advance.

I did much searching on this a year or so ago. I think your solution
appears to be similar to the one I used back then too, although I
specified a header also:
<?php
header('Content-type: text/vnd.wap.wml');

echo <<<WAP
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.or g/DTD/wml_1.1.xml">

WAP;
?>
<wml>
[...]
</wml>
Personally I prefer the Heredoc[1] method for multiple echo lines like
this.. but the results are the same =)

I don't know of any other way. I tried reconfiguring apache and add .wml
as a PHP handled file but this caused all sorts of other issues (I forget
the exact problems now).

Note however.. I also use the full opening '<?php' tag rather than the
short tag. I strongly suggest working in this manner too as it will
prevent some issues with XML and PHP tags.

Regards,

Ian

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/

Jul 17 '05 #2
On Mon, 29 Mar 2004 22:50:50 +0000, Ian.H wrote:
[ snip ]

Personally I prefer the Heredoc[1] method for multiple echo lines like
this.. but the results are the same =)

[ snip ]
Oops..

[1]: <<<TEXT is known as Heredoc in Perl (but Perl uses 2 << chars).. I
don't know if the reference differs for PHP.. I've never checked to find
out if the name is the same for this method.

Regards,

Ian

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/

Jul 17 '05 #3
On Mon, 29 Mar 2004 22:55:12 GMT, "Ian.H" <ia*@WINDOZEdig iserv.net> wrote:
On Mon, 29 Mar 2004 22:50:50 +0000, Ian.H wrote:

[1]: <<<TEXT is known as Heredoc in Perl (but Perl uses 2 << chars).. I
don't know if the reference differs for PHP.. I've never checked to find
out if the name is the same for this method.


http://www.php.net/manual/en/languag...syntax.heredoc

--
Andy Hassall <an**@andyh.co. uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #4
"Drizzt" <dr*******@libe ro.it> wrote in message
news:h2******** **************@ news3.tin.it...
Hi all.

I'm a somehow rusty on PHP, so maybe this is a dumb question...
I'm playing a bit with WAP developing, and found a simple problem right at
the beginning.
All the WAP pages that the editor (WAPTor) generate begin with
<?xml version="1.0"?>

That, <? is also the PHP tag for the beginning of the PHP scripting...
I've solved with this:
<?
echo("<?xml version=\"1.0\" ?>\n");
echo("<!-- created by WAPtor (http://www.wapdrive.net/) -->");
echo("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.or g/DTD/wml_1.1.xml\">\ n\n");
?>

But I'd like to know if there is a bettere way to do this...
Thx in advance.


In addition to the other responses, I'd like to propose the ever-popular
Smarty template library, which would enable you to concentrate on the data
acquisition and worry less about tactics for getting around syntax.

Garp
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6820
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
4
9640
by: matatu | last post by:
Hi to all, I have a xml file, a substring like: &lt;a href=&quot;#&quot;&gt;text&lt;/a&gt; which after an xslt trasform is rendered as (using xsl:output method html): &lt;a href="#"&gt;text&lt;/a&gt;
2
3209
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are writing one object in C# which will take the entire table tag contents and renders. Ie., we need to pass "<table>………… <thead>……</thead>. <tr>.<td> <td>..<tr>.<td> <td> </table>" content to
2
10555
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script type="text/javascript"> <!]> </script> <script type="text/javascript"
4
62096
by: higabe | last post by:
Three questions 1) I have a string function that works perfectly but according to W3C.org web site is syntactically flawed because it contains the characters </ in sequence. So how am I supposed to write this function? String.replace(/</g,'&lt;');
34
11035
by: Mark Moore | last post by:
It looks like there's a pretty serious CSS bug in IE6 (v6.0.2800.1106). The HTML below is validated STRICT HTML 4.01 and renders as I would expect in Opera, FrontPage, and Netscape. For some reason, there's an annoying vertical gap between adjacent rules that doesn't go away. This looks like IE6 is incorrectly setting the margin to some arbitrary value. Does anyone know if this is a known bug at MS? If you know of one, post the...
11
13687
by: Les Paul | last post by:
I'm trying to design an HTML page that can edit itself. In essence, it's just like a Wiki page, but my own very simple version. It's a page full of plain old HTML content, and then at the bottom, there's an "Edit" link. So the page itself looks something like this: <HTML><HEAD><TITLE>blah</TITLE></HEAD><BODY> <!-- TEXT STARTS HERE --> <H1>Hello World!</H1> <P>More stuff here...</P>
10
42955
by: Jon Noring | last post by:
Out of curiosity, may a CDATA section appear within an attribute value with datatype CDATA? And if so, how about other attribute value datatypes which accept the XML markup characters? To me, the XML specification seems a little ambiguous on this, so I defer to the XML authorities. Refer to sections 2.4 and 2.7 (it all hinges on if CDATA attribute values are part of markup or not.) Thanks.
9
5539
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash shell pieces like this: <pre><code> #!/bin/sh ftp -i -n ftp.server.com&lt; &lt;EOF user username password epsv4 cd /
6
24305
by: tentstitcher | last post by:
Hi all: I have a source xml document with an element of type string. This element contains something like the following: <stringData> &lt;Header&gt; &lt;Body&gt; </stringData> I would like to apply an XSLT and replace all occurances of &lt; with < and &gt; with >.
0
8343
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8545
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.