NYCPHP Meetup

NYPHP.org

[nycphp-talk] DOM XML questions

Ajai Khattri ajai at bitblit.net
Mon Nov 19 18:05:35 EST 2007


Anyone here familiar with the DOM XML functions in PHP?

Im running an XPath query on an XML document and I get back a list of DOM 
Elements which I can iterate through. Great. But want I really want to do 
it convert all of those tags into strings, concatenate them together and 
save them in a database.

Looking at the DOM API, it looks like I can create a new a DomDocument, 
and then append child nodes to it before calling saveXML().

But how do I "cast" the DOM Element to DOM Nodes that appendChild() needs?



--
Aj.




More information about the talk mailing list