EDN Admin
Well-known member
I have the following xml that I am pulling from a service:<br/>
<br/>
<pre class="prettyprint" style="border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; background-color:#f0f3f4; line-height:1.2em; min-height:35px; overflow-x:auto; overflow-y:auto; width:798px; font-family:Consolas,Courier New,Courier,monospace <span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <results><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <result><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <displayName><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent Joe Blow<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </displayName><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <department><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent Real Estate<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </department><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <ape><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <phone<span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="atn" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent type<span class="pun" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent =<span class="atv" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent "Mobile"<span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="atn" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent typeId<span class="pun" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent =<span class="atv" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent "6"<span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="atn" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent relationship<span class="pun" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent =<span class="atv" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent "Business"<span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="atn" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent relationshipId<span class="pun" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent =<span class="atv" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent "1"<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent ><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <formattedPhone><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent (555) 555-5555<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </formattedPhone><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere </phone><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere </ape><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <additionalFields><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <additionalField><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <definitionId><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent 8589935558<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </definitionId><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <name><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent Floor Location<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </name><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <value><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent 2373<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </value><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <displayValue><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent 2373<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </displayValue><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere </additionalField><span class="pln" style="margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span style="color:#222222 <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere </additionalFields><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere </result><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </results>[/code]
I am using the following code:<br/>
StreamReader reader = new StreamReader(data);<br/>
<br/>
XDocument xdoc = XDocument.Parse(reader.ReadToEnd());<br/>
<br/>
<span class="x_Apple-tab-span" style="white-spacere var contact = from contacts in xdoc.Descendants("result")<br/>
<span class="x_Apple-tab-span" style="white-spacere where contacts.Element("department") != null && contacts.Element("jobTitle") != null<br/>
<span class="x_Apple-tab-span" style="white-spacere select new<br/>
<span class="x_Apple-tab-span" style="white-spacere {<br/>
<span class="x_Apple-tab-span" style="white-spacere displayname = contacts.Element("displayname").Value,<br/>
<span class="x_Apple-tab-span" style="white-spacere department = contacts.Element("department").Value<br/>
<span class="x_Apple-tab-span" style="white-spacere /*office = ?????*/<span class="x_Apple-tab-span" style="white-spacere
<br/>
<span class="x_Apple-tab-span" style="white-spacere }
<br/>
What I am trying to get is one list with<br/>
<br/>
displayname,<br/>
department,<br/>
office (which is stored here <additionalFields><additionalField><value>2373</value></additionalFields></additionalField><br/>
<br/>
How do I modify my select to get this data?<br/>
<br/>
What is the best approach for this?<br/>
<br/>
Thanks in advance.
View the full article
<br/>
<pre class="prettyprint" style="border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; background-color:#f0f3f4; line-height:1.2em; min-height:35px; overflow-x:auto; overflow-y:auto; width:798px; font-family:Consolas,Courier New,Courier,monospace <span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <results><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <result><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <displayName><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent Joe Blow<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </displayName><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <department><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent Real Estate<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </department><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <ape><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <phone<span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="atn" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent type<span class="pun" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent =<span class="atv" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent "Mobile"<span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="atn" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent typeId<span class="pun" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent =<span class="atv" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent "6"<span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="atn" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent relationship<span class="pun" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent =<span class="atv" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent "Business"<span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="atn" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent relationshipId<span class="pun" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent =<span class="atv" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent "1"<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent ><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <formattedPhone><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent (555) 555-5555<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </formattedPhone><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere </phone><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere </ape><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <additionalFields><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <additionalField><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <definitionId><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent 8589935558<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </definitionId><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <name><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent Floor Location<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </name><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <value><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent 2373<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </value><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere <displayValue><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent 2373<span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </displayValue><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere </additionalField><span class="pln" style="margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span style="color:#222222 <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere </additionalFields><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <span class="x_Apple-tab-span" style="white-spacere </result><span class="pln" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent <br/><span class="tag" style="color:#222222; margin-bottom:0px; padding-bottom:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; vertical-align:baseline; background-color:transparent </results>[/code]
I am using the following code:<br/>
StreamReader reader = new StreamReader(data);<br/>
<br/>
XDocument xdoc = XDocument.Parse(reader.ReadToEnd());<br/>
<br/>
<span class="x_Apple-tab-span" style="white-spacere var contact = from contacts in xdoc.Descendants("result")<br/>
<span class="x_Apple-tab-span" style="white-spacere where contacts.Element("department") != null && contacts.Element("jobTitle") != null<br/>
<span class="x_Apple-tab-span" style="white-spacere select new<br/>
<span class="x_Apple-tab-span" style="white-spacere {<br/>
<span class="x_Apple-tab-span" style="white-spacere displayname = contacts.Element("displayname").Value,<br/>
<span class="x_Apple-tab-span" style="white-spacere department = contacts.Element("department").Value<br/>
<span class="x_Apple-tab-span" style="white-spacere /*office = ?????*/<span class="x_Apple-tab-span" style="white-spacere
<br/>
<span class="x_Apple-tab-span" style="white-spacere }
<br/>
What I am trying to get is one list with<br/>
<br/>
displayname,<br/>
department,<br/>
office (which is stored here <additionalFields><additionalField><value>2373</value></additionalFields></additionalField><br/>
<br/>
How do I modify my select to get this data?<br/>
<br/>
What is the best approach for this?<br/>
<br/>
Thanks in advance.
View the full article