Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

XHTML document in a .PHP file - How?

XHTML documents *must* begin with the processing instruction <?xml
version="1.0"?>. Unfortunately, when the PHP parser sees <? it tries to
parse it as PHP. How can I solve this? Should I put an include(); statement
at
the begining of the file to insert another file containing the XML processing
instruction?
If that doesn't do the trick what will?

PHP has XML parsing functions but that's not what I need. The XHTML
(essentially HTML) document can already be converted to XML when
validated against the W3C's XHTML DTD at the location specified in the
DOCTYPE declaration.

Any suggestions of a better forum to post this question would be greatly
appreciated.
AFAIK, there is no PHP newsgroup.
[782 byte] By [DANIELX webmaster] at [2007-11-9 14:55:20]
# 1 Re: XHTML document in a .PHP file - How?
I have not used PHP. When you want to use XML inline with other scripts you
can use XML data islands. go to

http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/xmlsdk/xmlp9
1b9.htm

for an example.

Hope this helps

<DANIELX webmaster> wrote in message news:3919f2a4$1@news.dev-archive.com...
>
> XHTML documents *must* begin with the processing instruction <?xml
> version="1.0"?>. Unfortunately, when the PHP parser sees <? it tries to
> parse it as PHP. How can I solve this? Should I put an include();
statement
> at
> the begining of the file to insert another file containing the XML
processing
> instruction?
> If that doesn't do the trick what will?
>
> PHP has XML parsing functions but that's not what I need. The XHTML
> (essentially HTML) document can already be converted to XML when
> validated against the W3C's XHTML DTD at the location specified in the
> DOCTYPE declaration.
>
> Any suggestions of a better forum to post this question would be greatly
> appreciated.
> AFAIK, there is no PHP newsgroup.
Chris Patterson at 2007-11-11 23:33:49 >