Re: How to prevent DomDocument from adding a !DOCTYPE.
| From: | Mathijs | Date: | Wed, 17 Jan 2007 12:53:36 +0000 |
| Subject: | Re: How to prevent DomDocument from adding a !DOCTYPE. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247212@lists.php.net to get a copy of this message | ||
Mathijs van Veluw wrote:
Hello there, Im using DomDocument currently and i realy want to prevent it from adding the !DOCTYPE and mabye even <html> and <body> etc.. Is this possible and how? Thx in advance. Mathijs. --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 000703-1, 01/15/2007 Tested on: 1/16/2007 3:37:11 PM avast! - copyright (c) 1988-2007 ALWIL Software. http://www.avast.comHello again, I will try to explain what i want to do. Mabye there is an other soluttion to fix my problem. I have some HTML content: <div id="test1"> <div id="test2" class="testClass">
<span style="font-color: #900;" class="secondTestClass">
Testing<br>
</span>
ØøÅå_^{}\[~]|€ÆæßÉ@£$¥èéùìòÇ!"#¤%&'()*+,ÖÑܧ¿äöñüà-./:;<=>?¡Ä
</div>
</div>
Now i need to parse the HTML by getting all the class and id attributes and replace them with something else, and after that return the modified HTML.
The DomDocument looked nice for this, because it had getElementsByTagName() etc..
Is there mabye an other way to parse this HTML and replace/modify its atttributes?
Thx in advanced.