views:

41

answers:

1

I'm trying to create an xml-based template system. The idea is to return my views as xml files (xhtml) and then append them to specific nodes in a template xml file. The template xml is then transformed with xslt.

My question is: how do I insert these xml files into the template xml file?

+2  A: 

See DOMDocument::importNode and DOMNode::appendChild.

Artefacto
related question: My views are php files with the content type set as text/xml. Would I be able to pass them into the DOMDocument/DOMNode classes as php files or will I need to use eval() first?
Tunji Gbadamosi
@Tun I don't understand your question. You don't pass DOMDocument PHP files, you pass it either a string containing the XML file or the path of the file (DOMDocument::load vs DOMDocument::loadXML).
Artefacto