0

I got a simple question here, but it is confusing me a lot..

Can i nest a dom Document objective in another Dom Document object?


My answer to the question is NO, should be one tree with child node , not a tree with child trees..It is only my answer and i am not expert,

I need the exact answer...Am I thinking right about nesting?

Explain Please...

Zaffar Saffee
  • 6,167
  • 5
  • 39
  • 77

1 Answers1

1

From the DOM spec:

[the Document interface] is the root of the document tree (source)

The root node is a node that is not a child of any other node (source)

I take this fairly clearly to mean that, according to the DOM spec, a DOMDocument object (which implements DOM's Document interface) cannot be nested within another. I'm not certain, but I'm fairly sure the PHP developers would not have implemented this in any other way.

Community
  • 1
  • 1
lonesomeday
  • 233,373
  • 50
  • 316
  • 318