At 14:10 18/07/2001 +0000, Leon wrote:
>Is there some way to include HTML tags in a XML doc???
>I want to use a XML document to include HTML data for my
>webpage. I have made a solution of replacing a special word to
>the '<' and '>" of a HTML tag.
>But I think my solution is very stupid.

How you do this does in depends on your requirements.

Is this blob of HTML data something you need to be able to parse
into and analyse, or is only ever going to be used as a single
unit? In that case your solution is probably the best one, except
I would make sure you use the standard mappings for this which
          "<"             ==>   "&lt;"
          ">"             ==>   "&gt;"
       pre-existing "&"   ==>   "&amp;"

as any XML tool worth it's salt will provide a simple way to do
this transformation. The php function for encoding a lump of
text in this way is "htmlspecialchars", and I suspect the XML
parser will autonmatically decode it for you.

If this is a blob of data you need to be able to analyse then
is not HTML any more, so much as an integral part of the
structure of your document that has certain similarities with
HTML. If you are using a DTD, I would figure out what HTML
you actually need and define a subset of allowable elements
and use those.

If you are using merely well formed XML, then you can slot in whatever
you like, as long as
    a) You have it wrapped up in a element name liked "<htmlexcerpt>"
    b) Your HTML is XHTML
However, I personally thing not having a DTD give you no discipline,
structure or specification and is a bad idea.

>And is there a special php xml newsgroup??
>PHP General Mailing List (
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]

Brian White
Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy
Phone: +612-93197901

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to