Re: Loading a html file using DOM XML
| From: | Christian Stocker | Date: | Sun, 29 Aug 2004 13:07:22 +0000 |
| Subject: | Re: Loading a html file using DOM XML | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-195070@lists.php.net to get a copy of this message | ||
DOMXML can basically only load well-formed XML documents and does this
quite well. If it doesn't work, you are doing something wrong or your
XML/HTML document is not wellformed. It's that simple.. And yes,
FrontPage, doesn't produce well-formed code ;)
But... There is a solution, which maybe helps, see
http://ch.php.net/manual/en/function.dom-domdocument-loadhtmlfile.php
This function can load HTML into a DOM Document without having to be
well-formed
chregu
On Sun, 29 Aug 2004 05:56:51 -0700, Sam Hobbs <socalsam@bigfoot.com> wrote:
> I don't want a XML document! I need a HTML document.
>
> Are you sure that that is the only possible explanation? I think not, and if
> not, then it is not accurate to say that that is the obvious answer.
>
> I did try changing the extension from "html" to "XML" and loading that
> directly into IE. I did get errors. When I fixed the errors, the document
> loaded into IE, but of course it was shown as-is. That is not what I need; I
> need the HTML to be processed (formatted).
>
> When I load the corrected document in using domxml_open_file, it still does
> not load, regardlous of whether the extension is xml or html.
>
> So your answer is rather cryptic. I need to load a file that can be created
> and edited using a WYSIWYG editer, such as FrontPage. Then I need to modify
> it (to do things such as fill in a table) using the DOM and then show that.
> Perhaps the XML DOM is not capable of doing that then saying that the
> problem is that it is not well-formed is a minor detail and the answer is
> that I need HTML DOM functions instead of XML DOM. In other words, perhaps
> PHP cannot do what I need.
>
> "Christian Stocker" <chregu@gmail.com> wrote in message
> news:49373ab704082905387f0c9f49@mail.gmail.com...
>
>
> > It's obviously not a well-formed XML Document...
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | chregu@bitflux.ch | gnupg-keyid
0x5CE1DECB