Re: [xml] Is a document a node? Is there a "virtual root node"?

On 28 Dec 2005, at 21:18, Daniel Veillard wrote:

On Wed, Dec 28, 2005 at 12:01:53PM +0000, Theodore H.Smith wrote:
<?xml version="1.0"?>
<!-- hi -->
<root>another little bit of data</root>

Now, this leads me to wonder, whats the best way to copy these
comments. If the document is also a node, or there is some node that

  the document is a node with 2 child in that case, the comment and
the root node.

Thanks. What happens to the <?xml?> PI, though?

A PI can exist anywhere in an XML document, not just at the start, and a PI can contain most character sequences. So, I assume that all nodes must be able to contain PI nodes (just like they can contain normal element nodes.).

If all nodes can contain PI nodes, then why does the document node not contain the PI node just like normal?

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]