Created
October 19, 2012 16:46
-
-
Save davidvthecoder/3919271 to your computer and use it in GitHub Desktop.
Xelement with example output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Root xmlns="http://www.adventure-works.com"> | |
<Child3>1</Child3> | |
<Child3>2</Child3> | |
<Child3>3</Child3> | |
<Child4>4</Child4> | |
<Child5>5</Child5> | |
<Child5>6</Child5> | |
</Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XNamespace aw = "http://www.adventure-works.com"; | |
XElement xmlTree1 = new XElement(aw + "Root", | |
new XElement(aw + "Child1", 1), | |
new XElement(aw + "Child2", 2), | |
new XElement(aw + "Child3", 3), | |
new XElement(aw + "Child4", 4), | |
new XElement(aw + "Child5", 5), | |
new XElement(aw + "Child6", 6) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Teach,
Look what I did!
Megan