XML.Linq - get value based on another value - c#

I am trying to user Linq to XML to pull out a value from some xml based on another value..
Here is my xml
<Lead>
<ID>1189226</ID>
<Client>
<ID>8445254</ID>
<Name>City of Lincoln Council</Name>
</Client>
<Contact>
<ID>5747449</ID>
<Name>Fred Bloggs</Name>
</Contact>
<Owner>
<ID>36612</ID>
<Name>Joe Bloggs</Name>
</Owner>
<CustomFields>
<CustomField>
<ID>31961</ID>
<Name>Scotsm_A_n_Authority_Good</Name>
<Boolean>true</Boolean>
</CustomField>
<CustomField>
<ID>31963</ID>
<Name>Scotsma_N_Need Not Want</Name>
<Boolean>false</Boolean>
</CustomField>
</CustomFields>
So, for example, I want to try and get the value of <Boolean> in the <CustomField> where <Name> equals "Scotsm_A_n_Authority_Good" which should be "true"
I have tried the following:
var xmlAnswers = xe.Element("CustomFields").Element("CustomField").Element("Scotsm_A_n_Authority_Good");
But I get an error saying that:
The ' ' character, hexadecimal value 0x20, cannot be included in a name...
Can anyone help please?

You're looking for the wrong thing at the moment. You should be looking for a CustomField element with a Name element with the specified value:
string target = "Scotsm_A_n_Authority_Good"; // Or whatever
var xmlAnswers = xe.Element("CustomFields")
.Elements("CustomField")
.Where(cf => (string) cf.Element("Name") == target);
This will give you all the matching CustomField elements. You can then get the Boolean value with something like:
foreach (var answer in xmlAnswers)
{
int id = (int) answer.Element("ID");
bool value = (bool) answer.Element("Boolean");
// Use them...
}
(You could extract the ID and value in the LINQ query of course...)

Here is an xml linq solution
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
namespace ConsoleApplication93
{
class Program
{
static void Main(string[] args)
{
string xml =
"<Lead>" +
"<ID>1189226</ID>" +
"<Client>" +
"<ID>8445254</ID>" +
"<Name>City of Lincoln Council</Name>" +
"</Client>" +
"<Contact>" +
"<ID>5747449</ID>" +
"<Name>Fred Bloggs</Name>" +
"</Contact>" +
"<Owner>" +
"<ID>36612</ID>" +
"<Name>Joe Bloggs</Name>" +
"</Owner>" +
"<CustomFields>" +
"<CustomField>" +
"<ID>31961</ID>" +
"<Name>Scotsm_A_n_Authority_Good</Name>" +
"<Boolean>true</Boolean>" +
"</CustomField>" +
"<CustomField>" +
"<ID>31963</ID>" +
"<Name>Scotsma_N_Need Not Want</Name>" +
"<Boolean>false</Boolean>" +
"</CustomField>" +
"</CustomFields>" +
"</Lead>";
XDocument doc = XDocument.Parse(xml);
//to get all customField
var results = doc.Descendants("CustomField").Select(x => new
{
id = (int)x.Element("ID"),
name = (string)x.Element("Name"),
boolean = (Boolean)x.Element("Boolean")
}).ToList();
//to get specific
XElement Scotsm_A_n_Authority_Good = doc.Descendants("CustomField")
.Where(x => ((string)x.Element("Name") == "Scotsm_A_n_Authority_Good") && (Boolean)(x.Element("Boolean"))).FirstOrDefault();
}
}
}

Related

Find string in xml and get the corresponding sister(?) nodes

I am making a tool which reads the cvc of a file, and searches the cvc value in an xml. it has multiple parent notes called release. i already managed to let it find the cvc value in the xml but i am not able to make it, that it gets the corresponding sister(sorry i dont know how its called) nodes.
This is a part of the XML:
<releases>
<release>
<id>1</id>
<name>name1</name>
<publisher></publisher>
<region>WLD</region>
<languages>en,fr,de,it,es,ru,ja</languages>
<group></group>
<imagesize>16</imagesize>
<serial>LA-H-AAAAA</serial>
<titleid>01007EF00011E000 </titleid>
<imgcrc>5DD119C1</imgcrc>
<filename>test</filename>
<releasename>test</releasename>
<trimmedsize>0</trimmedsize>
<firmware>1.0.0</firmware>
<type>1</type>
<card>1</card>
</release>
<release>
<id>2</id>
<name>name2</name>
<publisher></publisher>
<region>WLD</region>
<languages>en,fr,de,it,es,nl,pt,ru,ja</languages>
<group></group>
<imagesize>8</imagesize>
<serial>LA-H-AABPA</serial>
<titleid>0100152000022000</titleid>
<imgcrc>1912A1DF</imgcrc>
<filename>test</filename>
<releasename>test</releasename>
<trimmedsize>0</trimmedsize>
<firmware>1.0.0</firmware>
<type>1</type>
<card>1</card>
</release>
This is my code:
XmlNode node = doc.SelectSingleNode ("releases/*[contains(name(),'release')]/imgcrc[text() = '" + textBox6.Text + "']");
if (node == null)
{
XmlNode id = node.ParentNode.SelectSingleNode ("titleid");
XmlNode serial = node.ParentNode.SelectSingleNode ("serial");
XmlNode r = node.ParentNode.SelectSingleNode ("region");
XmlNode fw = node.ParentNode.SelectSingleNode ("firmware");
textBox8.Text = id.InnerText;
textBox4.Text = r.InnerText;
if (textBox4.Text == "WLD") {
textBox4.Text = "Worldwide";
}
textBox3.Text = fw.InnerText;
if (textBox3.Text == "") {
textBox3.Text = "The required FW wasn't found yet";
}
textBox2.Text = serial.InnerText;
} else {
textBox2.Text = "Game is not in the DB or you modified it";
textBox3.Text = "Game is not in the DB or you modified it";
textBox4.Text = "Game is not in the DB or you modified it";
textBox8.Text = "Game is not in the DB or you modified it";
}
Sorry if my question isnt clear enough and or the formating wrong.
If you use a path something like this, you will get the release element rather than just the imgcrc element:
var path = "releases/release[imgcrc = '"+ crc +"']";
var node = doc.SelectSingleNode(path);
Now you can grab the relevant child values from there:
if(node != null)
{
var titleId = node["titleid"].InnerText;
var serial = node["serial"].InnerText;
var region = node["region"].InnerText;
var firmware = node["firmware"].InnerText;
//etc
}
Try xml linq :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
namespace ConsoleApplication1
{
class Program
{
const string FILENAME = #"c:\temp\test.xml";
static void Main(string[] args)
{
XDocument doc = XDocument.Load(FILENAME);
var results = doc.Descendants("release").Select(x => new {
id = (int)x.Element("id"),
name = (string)x.Element("name"),
publisher = (string)x.Element("publisher"),
region = (string)x.Element("region"),
languages = (string)x.Element("languages"),
group = (string)x.Element("group"),
imagesize = (int)x.Element("imagesize"),
serial = (string)x.Element("serial"),
titleid = (string)x.Element("titleid"),
imgcrc = (string)x.Element("imgcrc"),
filename = (string)x.Element("filename"),
releasename= (string)x.Element("releasename"),
trimmedsize = (int)x.Element("trimmedsize"),
firmware = (string)x.Element("firmware"),
type = (int)x.Element("type"),
card = (int)x.Element("card")
}).ToList();
}
}
}

Get Innertext from an XML string which has only one node without looping

I have an XML string which looks like below
<?xml version="1.0" encoding="Windows-1252"?><Product><ID>0701161476416</ID><UNIQUE_ID>test26051602</UNIQUE_ID><STATUS>DONE</STATUS></Product>
It is know that my XML string will always has a single node ans so I do not want to look, instead I would like to get Unique_ID and Status inner values without looping.
May I know a better way to do it and I do have the below code which actually loops through each node
XmlDocument xm = new XmlDocument();
xm.LoadXml(XML_STRING);
XmlNodeList xnList = xm.SelectNodes("/Product/Product");
foreach (XmlNode xn in xnList)
{
string uniqueID = xn["UNIQUE_ID"].InnerText;
string status = xn["STATUS"].InnerText;
}
There is SelectSingleNode() which you can use for this purpose :
XmlNode product = xm.SelectSingleNode("/Product/Product");
string uniqueID = product["UNIQUE_ID"].InnerText;
string status = product["STATUS"].InnerText;
Or, if Product is the root element, then you can access it from DocumentElement property of the XmlDocument :
XmlNode product = xm.DocumentElement;
string uniqueID = product["UNIQUE_ID"].InnerText;
string status = product["STATUS"].InnerText;
If you have more than one product try xml linq
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string xml =
"<?xml version=\"1.0\" encoding=\"Windows-1252\"?>" +
"<Products>" +
"<Product>" +
"<ID>0701161476416</ID>" +
"<UNIQUE_ID>test26051603</UNIQUE_ID>" +
"<STATUS>DONE</STATUS>" +
"</Product>" +
"<Product>" +
"<ID>0701161476417</ID>" +
"<UNIQUE_ID>test26051604</UNIQUE_ID>" +
"<STATUS>DONE</STATUS>" +
"</Product>" +
"<Product>" +
"<ID>0701161476418</ID>" +
"<UNIQUE_ID>test26051605</UNIQUE_ID>" +
"<STATUS>DONE</STATUS>" +
"</Product>" +
"</Products>";
XDocument doc = XDocument.Parse(xml);
var results = doc.Descendants("Product").Select(x => new
{
id = (long)x.Element("ID"),
uniqueID = (string)x.Element("UNIQUE_ID"),
status = (string)x.Element("STATUS")
}).ToList();
}
}
}
This could work, but I guess there is a better solution:
XDocument xm = XDocument.Parse(XML_STRING);
var product = xm.Element("Product").Element("Product");
string uniqueID = product.Element("UNIQUE_ID").Value;
string status = product.Element("STATUS").Value;
Your SelectNodes line seemed wrong for the sample Xml.
XmlNodeList xnList = xm.SelectNodes("/Product");
if (xnList.Count > 0)
{
string uniqueID = xnList[0]["UNIQUE_ID"].InnerText;
string status = xnList[0]["STATUS"].InnerText;
}

NetSuite SuiteTalk "customSearchJoin" access from SOAP XML Response

I am still getting warmed up with NetSuite and have come across an issue I can't crack.
I am building a C# function to pull information from an XML soap response from NetSuite. This XML is the result of a saved search call which contains a section that is a join titled customSearchJoin that I am unsure how to access. Below I will show the XML section and my attempts to access it in the C# function.
I am attempting to access the field with the value of 091736418
XML segment:
<platformCore:searchRow xsi:type="tranSales:TransactionSearchRow" xmlns:tranSales="urn:sales_2014_1.transactions.webservices.netsuite.com">
<tranSales:basic xmlns:platformCommon="urn:common_2014_1.platform.webservices.netsuite.com">
<platformCommon:dateCreated>
<platformCore:searchValue>2015-12-17T08:43:00.000-08:00</platformCore:searchValue>
</platformCommon:dateCreated>
<platformCommon:entity>
<platformCore:searchValue internalId="615"/>
</platformCommon:entity>
</tranSales:basic>
<tranSales:customerMainJoin xmlns:platformCommon="urn:common_2014_1.platform.webservices.netsuite.com">
<platformCommon:altName>
<platformCore:searchValue>Some Specific Customer</platformCore:searchValue>
</platformCommon:altName>
</tranSales:customerMainJoin>
<tranSales:itemJoin xmlns:platformCommon="urn:common_2014_1.platform.webservices.netsuite.com">
<platformCommon:itemId>
<platformCore:searchValue>Some Product</platformCore:searchValue>
</platformCommon:itemId>
</tranSales:itemJoin>
<tranSales:customSearchJoin xmlns:platformCommon="urn:common_2014_1.platform.webservices.netsuite.com">
<platformCommon:customizationRef internalId="167" scriptId="custrecord_itmfulfillmentid"/>
<platformCommon:searchRowBasic xsi:type="platformCommon:CustomRecordSearchRowBasic">
<platformCommon:recType internalId="25"/>
<platformCommon:customFieldList>
<platformCore:customField xsi:type="platformCore:SearchColumnStringCustomField" scriptId="custrecord_ssccbarcode" internalId="169">
<platformCore:searchValue>091736418</platformCore:searchValue>
</platformCore:customField>
</platformCommon:customFieldList>
</platformCommon:searchRowBasic>
</tranSales:customSearchJoin>
</platformCore:searchRow>
C# function:
private void testCustomJoinSearch() {
TransactionSearchAdvanced transSearchAdv = new TransactionSearchAdvanced
{
savedSearchScriptId = "customsearch_savedSearchID"
};
SearchResult searchResult = _service.search(transSearchAdv);
if (searchResult.status.isSuccess)
{
Console.WriteLine("Search Success");
foreach (TransactionSearchRow transSearchRow in searchResult.searchRowList)
{
// declare vars
string transInternalID = "";
string ssccBarcode = "";
//normal field
transInternalID = transSearchRow.basic. internalId[0].searchValue.internalId.ToString();
//joined and custom field ? Not sure this loop is correct
foreach (CustomSearchRowBasic customBasicSearchRow in transSearchRow.customSearchJoin)
{
// ????
};
Console.WriteLine("transInternalID {0}", transInternalID);
Console.WriteLine("ssccBarcode {0}", ssccBarcode);
} // end main search row
}
else
{
Console.WriteLine("Search Failure");
Console.WriteLine(searchResult.status.statusDetail);
}
}
Try xml linq. I fixed your xml that was missing some namespace definitions so I added root and then closed the end tags platformCore:searchRow and root.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
namespace ConsoleApplication70
{
class Program
{
static void Main(string[] args)
{
string xml =
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>" +
"<Root xmlns:platformCore=\"abc\" xmlns:xsi=\"def\">" +
"<platformCore:searchRow xsi:type=\"tranSales:TransactionSearchRow\" xmlns:tranSales=\"urn:sales_2014_1.transactions.webservices.netsuite.com\">" +
"<tranSales:basic xmlns:platformCommon=\"urn:common_2014_1.platform.webservices.netsuite.com\">" +
"<platformCommon:dateCreated>" +
"<platformCore:searchValue>2015-12-17T08:43:00.000-08:00</platformCore:searchValue>" +
"</platformCommon:dateCreated>" +
"<platformCommon:entity>" +
"<platformCore:searchValue internalId=\"615\"/>" +
"</platformCommon:entity>" +
"</tranSales:basic>" +
"<tranSales:customerMainJoin xmlns:platformCommon=\"urn:common_2014_1.platform.webservices.netsuite.com\">" +
"<platformCommon:altName>" +
"<platformCore:searchValue>Some Specific Customer</platformCore:searchValue>" +
"</platformCommon:altName>" +
"</tranSales:customerMainJoin>" +
"<tranSales:itemJoin xmlns:platformCommon=\"urn:common_2014_1.platform.webservices.netsuite.com\">" +
"<platformCommon:itemId>" +
"<platformCore:searchValue>Some Product</platformCore:searchValue>" +
"</platformCommon:itemId>" +
"</tranSales:itemJoin>" +
"<tranSales:customSearchJoin xmlns:platformCommon=\"urn:common_2014_1.platform.webservices.netsuite.com\">" +
"<platformCommon:customizationRef internalId=\"167\" scriptId=\"custrecord_itmfulfillmentid\"/>" +
"<platformCommon:searchRowBasic xsi:type=\"platformCommon:CustomRecordSearchRowBasic\">" +
"<platformCommon:recType internalId=\"25\"/>" +
"<platformCommon:customFieldList>" +
"<platformCore:customField xsi:type=\"platformCore:SearchColumnStringCustomField\" scriptId=\"custrecord_ssccbarcode\" internalId=\"169\">" +
"<platformCore:searchValue>091736418</platformCore:searchValue>" +
"</platformCore:customField>" +
"</platformCommon:customFieldList>" +
"</platformCommon:searchRowBasic>" +
"</tranSales:customSearchJoin>" +
"</platformCore:searchRow>" +
"</Root>";
XDocument doc = XDocument.Parse(xml);
string searchvalue = doc.Descendants().Where(x => x.Name.LocalName == "customSearchJoin")
.Descendants().Where(y => y.Name.LocalName == "searchValue").Select(z => (string)z).FirstOrDefault();
}
}
}
I believe it is something like this:
foreach (CustomSearchRowBasic customBasicSearchRow in transSearchRow.customSearchJoin) {
// ????
CustomRecordSearchRowBasic itmfulfillmentidRecord = customBasicSearchRow.searchRowBasic as CustomRecordSearchRowBasic;
foreach(SearchColumnCustomField customField in itmfulfillmentidRecord.customFieldList) {
if (customField.scriptId == "custrecord_ssccbarcode") {
SearchColumnStringCustomField stringField = customField as SearchColumnStringCustomField;
string itmfulfillmentid = stringField.searchValue;
}
}
}

Merge 2 XML Files Into Same Elements C#

I need to create a WebService that takes the name of a city as input and returns Location, Country and Weather information of the City. The thing is that the ID, Location, Country is in one XML file and all weather details in another.
<City>
<ID>city1</ID>
<Grid_ref>NG 895608</Grid_ref>
<Name>Berlin</Name>
<Country>Germany</Country>
</City>
<cityWeather>
<ID>city1</ID>
<temperature>20</temperature>
<wind>2</wind>
</cityWeather>
Using c# is it possible to merge everything into 1 file using ID or is there some other way I can do it? I would then search the XML file once, as having 2 different files mixes me up.
You can use DataSet. I suppose you have two XML files. CityWeather.xml et City.xml, you can make this
try
{
XmlTextReader xmlreader1 = new XmlTextReader("C:\\Books1.xml");
XmlTextReader xmlreader2 = new XmlTextReader("C:\\Books2.xml");
DataSet ds = new DataSet();
ds.ReadXml(xmlreader1);
DataSet ds2 = new DataSet();
ds2.ReadXml(xmlreader2);
ds.Merge(ds2);
ds.WriteXml("C:\\Books.xml");
Console.WriteLine("Completed merging XML documents");
}
catch (System.Exception ex)
{
Console.Write(ex.Message);
}
Console.Read();
You can make any changes that meet your need
hope it helps
Use add
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string cityXML =
"<Root>" +
"<City>" +
"<ID>city1</ID>" +
"<Grid_ref>NG 895608</Grid_ref>" +
"<Name>Berlin</Name>" +
"<Country>Germany</Country>" +
"</City>" +
"<City>" +
"<ID>city2</ID>" +
"<Grid_ref>F 5608</Grid_ref>" +
"<Name>Paris</Name>" +
"<Country>France</Country>" +
"</City>" +
"<City>" +
"<ID>city3</ID>" +
"<Grid_ref>RR 608</Grid_ref>" +
"<Name>Rome</Name>" +
"<Country>Italy</Country>" +
"</City>" +
"</Root>";
XElement cities = XElement.Parse(cityXML);
string weatherXML =
"<Root>" +
"<cityWeather>" +
"<ID>city1</ID>" +
"<temperature>20</temperature>" +
"<wind>2</wind>" +
"</cityWeather>" +
"<cityWeather>" +
"<ID>city2</ID>" +
"<temperature>30</temperature>" +
"<wind>3</wind>" +
"</cityWeather>" +
"<cityWeather>" +
"<ID>city3</ID>" +
"<temperature>40</temperature>" +
"<wind>4</wind>" +
"</cityWeather>" +
"</Root>";
XElement weather = XElement.Parse(weatherXML);
List<XElement> cityList = cities.Descendants("City").ToList();
foreach(XElement city in cityList)
{
XElement matchedCity = weather.Descendants("cityWeather").Where(x =>
x.Element("ID").Value == city.Element("ID").Value).FirstOrDefault();
if(matchedCity != null) city.Add(matchedCity);
}
}
}
}
​

Linq2Xml - how to get nodes and childnodes related

I have xml like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<supplyCrew xmlns="http://site.ddf.com">
<login>
<login>XXXX</login>
<password>XXXX</password>
</login>
<flightInformation>
<flights>
<item>
<arrivalDateTime>2010-11-08T22:48:00.000Z</arrivalDateTime>
<arrivingCity>ORD</arrivingCity>
<crewMembers>
<item>
<employeeId>020040</employeeId>
<isDepositor>Y</isDepositor>
<isTransmitter>N</isTransmitter>
</item>
<item>
<employeeId>09000</employeeId>
<isDepositor>N</isDepositor>
<isTransmitter>Y</isTransmitter>
</item>
</crewMembers>
</item>
<item>
<arrivalDateTime>2010-11-08T20:29:00.000Z</arrivalDateTime>
<arrivingCity>JFK</arrivingCity>
<crewMembers>
<item>
<employeeId>0538</employeeId>
<isDepositor>Y</isDepositor>
<isTransmitter>N</isTransmitter>
</item>
<item>
<employeeId>097790</employeeId>
<isDepositor>N</isDepositor>
<isTransmitter>Y</isTransmitter>
</item>
</crewMembers>
</item>
</flights>
</flightInformation>
</supplyCrew>
This code gets only the first item " and " and then generate a exception 'System.NullReferenceException'.
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Xml.Linq;
using System.Text;
using System.Xml;
using System.Data.SqlClient;
using System.Data;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
XElement doc = XElement.Load("U:/Crew.xml");
XNamespace e = "http://schemas.xmlsoap.org/soap/envelope/";
XNamespace s = "http://site.ddf.com";
var flights = doc.Elements(e + "Body")
.Elements(s + "supplyCrew")
.Elements(s + "flightInformation")
.Elements(s + "flights")
.Elements(s + "item")
.Select(
flight_item => new
{
//Anonymous Type
arrivalDateTime = flight_item.Element(s + "arrivalDateTime").Value,
arrivingCity = flight_item.Element(s + "arrivingCity").Value,
crewmember = flight_item.Elements(s + "crewMembers").Elements(s + "item"),
}
);
int index = 1;
foreach (var flight_item in flights)
{
Console.Write('\n'+"New flight item:"+'\n');
Console.Write('\t'+flight_item.arrivalDateTime + '\n');
Console.Write('\t'+flight_item.arrivingCity + '\n');
foreach (var item in flight_item.crewmember)
{
var employeeId = item;//crewmember.Elements(s + "item").Elements("employeeId");
Console.Write("\t "+employeeId);
Console.Write('\n');
//index++;
}
}
The idea is to get item.arrivalDateTime and item.arrivingCity and its crewMembers.item.employeeId for all the rows. However I do not know how to get the childnodes using linq...us occrring a exception if when try employeeId = x.Element(s + "employeeId").Value....
Result should be something like this:
2010-11-08T22:48:00.000Z; ORD; 020040
2010-11-08T22:48:00.000Z; ORD; 09000
2010-11-08T20:29:00.000Z; JFK; 0538
2010-11-08T20:29:00.000Z; JFK; 097790
The problem is in your use of Descendants. You're asking for all item descendants of flights elements - which means it will include this:
<item>
<employeeId>020040</employeeId>
<isDepositor>Y</isDepositor>
<isTransmitter>N</isTransmitter>
</item>
That clearly doesn't have an arrivalDateTime element, hence the problem.
Replacing every call of Descendants to Elements in your sample code fixes the problem... although you're still going to fail if the actual document doesn't have all of the expected data.
SOLVED
we just need to replace that foreach for :
foreach (var flight_item in l_flights)
{
Console.Write('\n'+"New flight item:"+'\n');
Console.Write('\t'+flight_item.arrivalDateTime + '\n');
Console.Write('\t'+flight_item.arrivingCity + '\n');
foreach (var item in flight_item.crewmember)
{
var employeeId = item.Element(s + "employeeId").Value;
var isDepositor = item.Element(s + "isDepositor").Value;
var isTransmitter = item.Element(s + "isTransmitter").Value;
Console.Write("\t " + employeeId + "\n");
Console.Write("\t " + isDepositor + "\n");
Console.Write("\t " + isTransmitter + "\n");
}
}
Thank you guys....

Categories

Resources