c# - Extract Data from Soap XML with Namespaces -
i trying extract data contained in soap response xml have contains multiple , variable namespaces in ssis script component using c#.
my xml looks this:
<?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body> <ns3:getcacheentryresponse xmlns:ns3="http://com.vedaadvantage/dp3/enterprise/standardtradecreditcommercial/silverchef/individualcommercialservice" xmlns:ns2="http://com.vedaadvantage/dp3/enterprise/standardtradecreditcommercial/silverchef" xmlns:ns4="http://com.vedaadvantage/dp3/enterprise/standardtradecreditcommercial/silverchef/individualcommercialdecision" xmlns:ns5="http://vedaadvantage.com/dp3/service/fault" xmlns:ns6="http://com/vedaadvantage/dp3/businessdecisionresultoverride" xmlns:ns7="http://com.vedaadvantage/dp3/connectors" xmlns:ns8="http://com.vedaadvantage/dp3/connectors/vedaxml/vedascore" xmlns:ns9="http://com.vedaadvantage/dp3/connectors/vedaxml/individualalerts"> <ns3:cacheentry> <cacheentrydata>&lt;response xmlns="http://com.vedaadvantage/dp3/connectors/vedaxml/vedascore" xmlns:b="http://com.vedaadvantage/dp3/connectors"&gt;&lt;enquiryreport&gt;&lt;primarymatch&gt;&lt;bureaureference&gt;805917662&lt;/bureaureference&gt;&lt;individual&gt;&lt;individualname&gt;&lt;familyname&gt;mohammadinejad&lt;/familyname&gt;&lt;firstgivenname&gt;ali&lt;/firstgivenname&gt;&lt;createdate&gt;2014-07-15&lt;/createdate&gt;&lt;/individualname&gt;&lt;gender&gt;male&lt;/gender&gt;&lt;dateofbirth&gt;1982-01-06&lt;/dateofbirth&gt;&lt;driverslicencenumber&gt;&lt;countrycodes&gt;au&lt;/countrycodes&gt;&lt;value/&gt;&lt;/driverslicencenumber&gt;&lt;b:address&gt;&lt;b:unitnumber/&gt;&lt;b:streetnumber&gt;43&lt;/b:streetnumber&gt;&lt;b:property&gt;43&lt;/b:property&gt;&lt;b:streetname&gt;king edward&lt;/b:streetname&gt;&lt;b:streettype&gt;ave&lt;/b:streettype&gt;&lt;b:suburb&gt;albion&lt;/b:suburb&gt;&lt;b:city/&gt;&lt;b:state&gt;vic&lt;/b:state&gt;&lt;b:postcode&gt;3020&lt;/b:postcode&gt;&lt;b:countrycode&gt;au&lt;/b:countrycode&gt;&lt;b:addresstype&gt;residentialcurrent&lt;/b:addresstype&gt;&lt;b:createdate&gt;2015-09-04&lt;/b:createdate&gt;&lt;/b:address&gt;&lt;/individual&gt;&lt;individualconsumercreditfile&gt;&lt;creditenquiry&gt;&lt;accounttype&gt;&lt;accounttype&gt;ua&lt;/accounttype&gt;&lt;value&gt;utilities&lt;/value&gt;&lt;/accounttype&gt;&lt;role&gt;&lt;consumerroletypecodesresponse&gt;principal&lt;/consumerroletypecodesresponse&gt;&lt;/role&gt;&lt;enquiryamount&gt;&lt;currencycodetype/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/enquiryamount&gt;&lt;coborrower/&gt;&lt;creditenquirer&gt;agl engy sales &amp; mktg ltd&lt;/creditenquirer&gt;&lt;clientreference/&gt;&lt;consumercreditenquirytyperesponse&gt;creditapplication&lt;/consumercreditenquirytyperesponse&gt;&lt;enquirydate&gt;2015-09-04&lt;/enquirydate&gt;&lt;/creditenquiry&gt;&lt;creditenquiry&gt;&lt;accounttype&gt;&lt;accounttype&gt;tc&lt;/accounttype&gt;&lt;value&gt;telecommunication service&lt;/value&gt;&lt;/accounttype&gt;&lt;role&gt;&lt;consumerroletypecodesresponse&gt;principal&lt;/consumerroletypecodesresponse&gt;&lt;/role&gt;&lt;enquiryamount&gt;&lt;currencycodetype/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/enquiryamount&gt;&lt;coborrower/&gt;&lt;creditenquirer&gt;vodafone decision point&lt;/creditenquirer&gt;&lt;clientreference&gt;1-dcqjwzg&lt;/clientreference&gt;&lt;consumercreditenquirytyperesponse&gt;creditapplication&lt;/consumercreditenquirytyperesponse&gt;&lt;enquirydate&gt;2014-07-15&lt;/enquirydate&gt;&lt;/creditenquiry&gt;&lt;/individualconsumercreditfile&gt;&lt;individualcommercialcreditfile&gt;&lt;creditenquiry&gt;&lt;accounttype&gt;&lt;commercialaccounttypecodesresponse&gt;cr&lt;/commercialaccounttypecodesresponse&gt;&lt;value&gt;commercial rental&lt;/value&gt;&lt;/accounttype&gt;&lt;enquiryamount&gt;&lt;currencycodetype/&gt;&lt;value&gt;25000&lt;/value&gt;&lt;/enquiryamount&gt;&lt;role&gt;&lt;commercialroletypecodesresponse&gt;principal&lt;/commercialroletypecodesresponse&gt;&lt;/role&gt;&lt;coborrower/&gt;&lt;creditenquirer&gt;gogetta equipment funding&lt;/creditenquirer&gt;&lt;clientreference/&gt;&lt;commercialcreditenquirytyperesponse&gt;creditenquiry&lt;/commercialcreditenquirytyperesponse&gt;&lt;enquirydate&gt;2016-04-04&lt;/enquirydate&gt;&lt;/creditenquiry&gt;&lt;/individualcommercialcreditfile&gt;&lt;matchtype&gt;strong&lt;/matchtype&gt;&lt;/primarymatch&gt;&lt;summarydata&gt;&lt;summary&gt;&lt;name&gt;enquiry-amount&lt;/name&gt;&lt;summarytype&gt;amount&lt;/summarytype&gt;&lt;currencycode&gt;aud&lt;/currencycode&gt;&lt;value&gt;25000&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;age-of-file&lt;/name&gt;&lt;summarytype&gt;months&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;20&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;age-of-subject&lt;/name&gt;&lt;summarytype&gt;years&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;34&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;time-at-address&lt;/name&gt;&lt;summarytype&gt;months&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;7&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;time-at-employer&lt;/name&gt;&lt;summarytype&gt;months&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value/&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;defaults&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;total-value-of-outstanding-defaults&lt;/name&gt;&lt;summarytype&gt;amount&lt;/summarytype&gt;&lt;currencycode&gt;aud&lt;/currencycode&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;defaults-paid&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;defaults-12&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;defaults-12-paid&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;defaults-12-unpaid&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;defaults-24-paid&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;defaults-24-unpaid&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;defaults-36-paid&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;defaults-36-unpaid&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;time-since-last-default&lt;/name&gt;&lt;summarytype&gt;months&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value/&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;total-credit-enquiries&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;3&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;credit-enquiries-1&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;1&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;credit-enquiries-3&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;1&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;credit-enquiries-6&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;1&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;credit-enquiries-12&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;2&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;credit-enquiries-60&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;3&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;time-since-last-enquiry&lt;/name&gt;&lt;summarytype&gt;months&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;7&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;telco-and-utility-defaults&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;telco-and-utility-defaults-12&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;telco-and-utility-enquiries&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;2&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;telco-and-utility-enquiries-6&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;telco-and-utility-enquiries-12&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;1&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;authorised-agents-enquiries-12&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;authorised-agents-enquiries-60&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;directorships-current&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;directorships-previous&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;judgements&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;proprietorships&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;adverse-on-file&lt;/name&gt;&lt;summarytype/&gt;&lt;currencycode/&gt;&lt;value&gt;no&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;file-notes&lt;/name&gt;&lt;summarytype/&gt;&lt;currencycode/&gt;&lt;value&gt;no&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;known-identities&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;1&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;bankruptcies&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;writs-and-summons&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;summary&gt;&lt;name&gt;external-administration-director&lt;/name&gt;&lt;summarytype&gt;count&lt;/summarytype&gt;&lt;currencycode/&gt;&lt;value&gt;0&lt;/value&gt;&lt;/summary&gt;&lt;/summarydata&gt;&lt;scoredata&gt;&lt;score&gt;&lt;scorecardmodel&gt;0303&lt;/scorecardmodel&gt;&lt;relativerisk&gt;2.3&lt;/relativerisk&gt;&lt;vedascore1_1index&gt;4.0863&lt;/vedascore1_1index&gt;&lt;applicantodds&gt;26.9&lt;/applicantodds&gt;&lt;contributingfactor&gt;&lt;impact&gt;greatly decreases risk&lt;/impact&gt;&lt;value&gt;lack of consumer adverse information&lt;/value&gt;&lt;/contributingfactor&gt;&lt;contributingfactor&gt;&lt;impact&gt;moderately decreases risk&lt;/impact&gt;&lt;value&gt;number of consumer credit applications&lt;/value&gt;&lt;/contributingfactor&gt;&lt;contributingfactor&gt;&lt;impact&gt;marginally decreases risk&lt;/impact&gt;&lt;value&gt;individual shopping pattern&lt;/value&gt;&lt;/contributingfactor&gt;&lt;contributingfactor&gt;&lt;impact&gt;marginally decreases risk&lt;/impact&gt;&lt;value&gt;current , historic credit type sought&lt;/value&gt;&lt;/contributingfactor&gt;&lt;population&gt;&lt;populationodds&gt;11.9&lt;/populationodds&gt;&lt;/population&gt;&lt;vedascore&gt;675&lt;/vedascore&gt;&lt;percentile&gt;30&lt;/percentile&gt;&lt;scoretype&gt;vs 1.1 commercial + consumer&lt;/scoretype&gt;&lt;/score&gt;&lt;/scoredata&gt;&lt;/enquiryreport&gt;&lt;/response&gt;</cacheentrydata> <connectorgroup>vedaxml</connectorgroup> <connectorid>vedascore</connectorid> <connectorversion>2014-08-28</connectorversion> <request>&lt;request xmlns:ns2="http://com.vedaadvantage/dp3/connectors" xmlns="http://com.vedaadvantage/dp3/connectors/vedaxml/vedascore"&gt;&lt;product&gt;&lt;name&gt;vedascorefinancialcommercialplusconsumer1_1&lt;/name&gt;&lt;summary&gt;true&lt;/summary&gt;&lt;/product&gt;&lt;individual&gt;&lt;individualname&gt;&lt;familyname&gt;mohammadinejad&lt;/familyname&gt;&lt;firstgivenname&gt;ali&lt;/firstgivenname&gt;&lt;othergivenname&gt;&lt;/othergivenname&gt;&lt;/individualname&gt;&lt;gender&gt;unknown&lt;/gender&gt;&lt;dateofbirth&gt;1982-01-06z&lt;/dateofbirth&gt;&lt;driverslicencenumber&gt;&lt;countrycodes&gt;au&lt;/countrycodes&gt;&lt;value&gt;06011982&lt;/value&gt;&lt;/driverslicencenumber&gt;&lt;ns2:address&gt;&lt;ns2:addresstype&gt;residentialcurrent&lt;/ns2:addresstype&gt;&lt;ns2:unitnumber&gt;3 u&lt;/ns2:unitnumber&gt;&lt;ns2:streetnumber&gt;43&lt;/ns2:streetnumber&gt;&lt;ns2:property&gt;43&lt;/ns2:property&gt;&lt;ns2:streetname&gt;king edward&lt;/ns2:streetname&gt;&lt;ns2:streettype&gt;ave&lt;/ns2:streettype&gt;&lt;ns2:suburb&gt;albion&lt;/ns2:suburb&gt;&lt;ns2:state&gt;vic&lt;/ns2:state&gt;&lt;ns2:postcode&gt;3020&lt;/ns2:postcode&gt;&lt;ns2:countrycode&gt;au&lt;/ns2:countrycode&gt;&lt;/ns2:address&gt;&lt;role&gt;principal&lt;/role&gt;&lt;/individual&gt;&lt;enquiry&gt;&lt;accounttype&gt;&lt;accounttype&gt;cr&lt;/accounttype&gt;&lt;/accounttype&gt;&lt;enquiryamount&gt;&lt;currencycodetype&gt;aud&lt;/currencycodetype&gt;&lt;value&gt;25000&lt;/value&gt;&lt;/enquiryamount&gt;&lt;enquirytype&gt;creditenquiry&lt;/enquirytype&gt;&lt;/enquiry&gt;&lt;customerreference&gt;gogetta&lt;/customerreference&gt;&lt;/request&gt;</request> </ns3:cacheentry> </ns3:getcacheentryresponse> </soap:body> </soap:envelope>
i have used http://xmltocsharp.azurewebsites.net/ generate c# classes this:
[xmlroot(elementname = "cacheentry", namespace = "http://com.vedaadvantage/dp3/enterprise/standardtradecreditcommercial/silverchef/individualcommercialservice")] public class cacheentry { [xmlelement(elementname = "cacheentrydata")] public string cacheentrydata { get; set; } [xmlelement(elementname = "connectorgroup")] public string connectorgroup { get; set; } [xmlelement(elementname = "connectorid")] public string connectorid { get; set; } [xmlelement(elementname = "connectorversion")] public string connectorversion { get; set; } [xmlelement(elementname = "request")] public string request { get; set; } } [xmlroot(elementname = "getcacheentryresponse", namespace = "http://com.vedaadvantage/dp3/enterprise/standardtradecreditcommercial/silverchef/individualcommercialservice")] public class getcacheentryresponse { [xmlelement(elementname = "cacheentry", namespace = "http://com.vedaadvantage/dp3/enterprise/standardtradecreditcommercial/silverchef/individualcommercialservice")] public cacheentry cacheentry { get; set; } [xmlattribute(attributename = "ns3", namespace = "http://www.w3.org/2000/xmlns/")] public string ns3 { get; set; } [xmlattribute(attributename = "ns2", namespace = "http://www.w3.org/2000/xmlns/")] public string ns2 { get; set; } [xmlattribute(attributename = "ns4", namespace = "http://www.w3.org/2000/xmlns/")] public string ns4 { get; set; } [xmlattribute(attributename = "ns5", namespace = "http://www.w3.org/2000/xmlns/")] public string ns5 { get; set; } [xmlattribute(attributename = "ns6", namespace = "http://www.w3.org/2000/xmlns/")] public string ns6 { get; set; } [xmlattribute(attributename = "ns7", namespace = "http://www.w3.org/2000/xmlns/")] public string ns7 { get; set; } [xmlattribute(attributename = "ns8", namespace = "http://www.w3.org/2000/xmlns/")] public string ns8 { get; set; } [xmlattribute(attributename = "ns9", namespace = "http://www.w3.org/2000/xmlns/")] public string ns9 { get; set; } } [xmlroot(elementname = "body", namespace = "http://schemas.xmlsoap.org/soap/envelope/")] public class body { [xmlelement(elementname = "getcacheentryresponse", namespace = "http://com.vedaadvantage/dp3/enterprise/standardtradecreditcommercial/silverchef/individualcommercialservice")] public getcacheentryresponse getcacheentryresponse { get; set; } } [xmlroot(elementname = "envelope", namespace = "http://schemas.xmlsoap.org/soap/envelope/")] public class envelope { [xmlelement(elementname = "body", namespace = "http://schemas.xmlsoap.org/soap/envelope/")] public body body { get; set; } [xmlattribute(attributename = "soap", namespace = "http://www.w3.org/2000/xmlns/")] public string soap { get; set; } }
here how trying extract cacheentrydata field not retrieving node list (xnlist) , not returning in foreach statement.
public override void createnewoutputrows() { string soap_resp = variables.getcacheentryrspxml.tostring(); soap_resp = soap_resp.replace("\"\"", "\""); system.windows.forms.messagebox.show(soap_resp); xmldocument agv = new xmldocument(); agv.loadxml(soap_resp); xmlnamespacemanager nsmgr = new xmlnamespacemanager(agv.nametable); nsmgr.addnamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/"); nsmgr.addnamespace("ns3", "http://com.vedaadvantage/dp3/enterprise/standardtradecreditcommercial/silverchef/individualcommercialservice"); xmlnodelist xnlist = agv.selectnodes("//ns3:cacheentry", nsmgr); foreach (xmlnode xn in xnlist) { var cacheentrydata = xn["ns3:cacheentry"].innertext; system.windows.forms.messagebox.show(convert.tostring(cacheentrydata)); } }
this unusual. code looks in html encoded had html decode.
using system.linq; using system.text; using system.xml; using system.xml.linq; using system.io; using system.net; namespace consoleapplication73 { class program { const string filename = @"c:\temp\test.xml"; static void main(string[] args) { string xml = file.readalltext(filename); createnewoutputrows(xml); } static public void createnewoutputrows(string xml) { xdocument doc = xdocument.parse(xml); xelement cacheentrydata = doc.descendants().where(x => x.name.localname == "cacheentrydata").firstordefault(); string cacheentrydataxml = webutility.htmldecode(cacheentrydata.tostring()); xelement cacheentrydata2 = xelement.parse(cacheentrydataxml); } } }
Comments
Post a Comment