Quantcast
Channel: Topic Tag: xml | WordPress.org
Viewing all articles
Browse latest Browse all 3201

John Blackbourn on "Passing HTML, Inside XML as Post Content with wp_insert_post"

$
0
0

After a cursory Google it seems that SimpleXML doesn't actually support this natively. The main problem is that the contents of the <Details> node of your XML should actually be wrapped in <![CDATA[ and ]]> to denote that this node contains text that would otherwise be interpreted as child nodes.

If you're not in control of the incoming XML then I would stick with the method you have at the moment ($xml->Details->asXML() and then stripping the container tags).

I had actually forgotten how terrible it is working with XML.


Viewing all articles
Browse latest Browse all 3201

Trending Articles