I have an xml document that I want to extract nodes as a new smaller xml file. Take:
Code:
<root>
<sub id="1">
[Lots of other children]
</sub>
<sub id="n">
[...]
</sub>
</root>
to a new xml file:
Code:
<root>
<sub id="1">
[Lots of other children]
</sub>
</root>
What I am trying to do is extract each <sub> as a new xml file or string with formatting, which I will output to the browser with
XSLTProcessor::importStyleSheet($xsl)
XSLTProcessor::transformToXML($xml);
I have an xsl document that I can use to transform the whole document. I could modify it to take out the root take, but it would also be nice to wrap each extracted sub document in a <root> tag.
I am really stuck on this. It seems reasonable to me.
Thanks in advance.