That is, when the element or attribute is not found in the XML tree, the getter
for either the attribute or element returns the default value.
For example, the following XSD schema fragment contains an element declaration that also defines a
default value for the Department element.
You can build an XML tree that intentionally excludes the definition of a Department element:
var emp = new EmployeeInfo
{
NationalIDNumber = "123456789",
LoginID = "adventure-works\scott",
Title = "Geek",
Name = "Scott",
EmailAddress = "scott@adventure-works.com"
};
When the getter for the Department element is called, the default defined by the schema is returned, as
shown here:
123456789
357
Appendix C: LINQ to XSD
adventure-works\scott
Geek
Scott
scott@adventure-works.
Pages:
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551