简体   繁体   中英

DOMDocument / DOMXPath

I am working with DOMDocument / DOMXPath to try and make CSS inline. It would work perfectly except that the HTML I am passing to it trips it up saying it's not valid XML.

How can I set these functions to ignore unknown tags?

Anyway I can make these functions less finicky? I use the phpQuery classes to manipulate and output everything. But when I pass it to the inlinify stuff it breaks.

Other web-based inlinify apps have no problem with the output html I have.

And also.. anyone know a non-DOMDocument / DOMXPath way to do this? All CSS is between a single style pair of tags. Maybe fancy regex or phpQuery itself or both?

Thanks a ton!

To be fair, it's not wrong. If you want to load HTML then you should be using DOMDocument::loadHTML*() .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM