Skip to content

Instantly share code, notes, and snippets.

@davidvthecoder
Created October 19, 2012 16:46
Show Gist options
  • Save davidvthecoder/3919271 to your computer and use it in GitHub Desktop.
Save davidvthecoder/3919271 to your computer and use it in GitHub Desktop.
Xelement with example output
<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>
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)
);
@meganmcchesney
Copy link

6.4 DateTime.Now BKDK 0612314000005 USD EN

XElement xmlTree1 = new XElement("Header", Header,
new XElement("PIESVersion" , 6.4),
new XElement("BlanketEffectiveDate", DateTime.now),
new XElement("ParentAAIAID", BKDK),
new XElement("BrandOwnerGLN", 0612314000005),
new XElement("CurrencyCode", USD),
new XElement("LanguageCode", EN)
);

@meganmcchesney
Copy link

Hey Teach,
Look what I did!
Megan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment