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. 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/
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/
"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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Christian Schmidbauer |
last post by:
Hello!
I prepare my XML document like this way:
-------------------------------------------------------
PrintWriter writer;
Document domDocument;
Element domElement;
// Root tag
|
by: matatu |
last post by:
Hi to all,
I have a xml file, a substring like:
<a href="#">text</a>
which after an xslt trasform is rendered as (using xsl:output method html):
<a href="#">text</a>
|
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
|
by: Donald Firesmith |
last post by:
I am having trouble having Google Adsense code stored in XSL converted
properly into HTML. The <> unfortunately become < and > and then
no longer work.
XSL code is:
<script type="text/javascript">
<!]>
</script>
<script type="text/javascript"
|
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,'<');
| |
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...
|
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>
|
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.
|
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< <EOF
user username password
epsv4
cd /
|
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>
<Header> <Body>
</stringData>
I would like to apply an XSLT and replace all occurances of < with <
and > with >.
|
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,...
| |
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...
|
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,...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |