c# - What's the difference between XElement and XDocument? -


what difference between xelement , xdocument , when use each?

xdocument represents whole xml document. composed of number of elements.

xelement represents xml element (with attributes, children etc). part of larger document.

use xdocument when working whole xml document, xelement when working xml element.

for example - xelement has hasattributes property indicating whether attributes exist on element, xdocument doesn't, such property meaningless in context of whole xml document.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -