473,385 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.org/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 1993
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.org/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.org/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*@WINDOZEdigiserv.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*******@libero.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.org/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
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
4
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...
2
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...
2
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...
4
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...
34
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...
11
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,...
10
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,...
9
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...
6
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.