Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all 935 articles
Browse latest View live

Splitting one XML file into multiple xml files with XSLT

$
0
0

Hi Team, Currently I'm struggling to split single XML file in multiple XML-files. I need all elements and attributes same as an all xmls, Currently i have mapped single xml to single xml, But requirement is create xslt for single input xml to split to multiple xmls. I want to split xml base on the <RECORD> tag,Could you please support to sort out this concern for your reference here with attached input sample and required output.

Input sample xml- :

<?xml version='1.0' encoding='utf-8'?>
<RECORDS>
<Header>
<MessageId>HAWB XML Export</MessageId>
<SendingDate>2018-10-12 16:39:56</SendingDate>
<JobType>AIR IMPORT</JobType>
</Header>
<RECORD>  <!--1st xml -->
<Shipment>
<CargoReadyDate>0000-00-00 00:00:00</CargoReadyDate>
<IncoTerm></IncoTerm>
<NetWeight>1000.000</NetWeight>
<GrossWeight>1050.000</GrossWeight>
<ChargableWeight>1000.000</ChargableWeight>
<Description></Description>
<Remarks>TEST RAMARKS</Remarks>
</Shipment>
<FlightRouteCount>1</FlightRouteCount>
<FROUTES>
<FROUTE>
<FlightCode>CX</FlightCode>
<FlightNo>421</FlightNo>
<FlightDate>2018-10-17</FlightDate>
<FlightTime>11:50:00</FlightTime>
<FlightAPOL>TPE</FlightAPOL>
<FlightAPOD>SYD</FlightAPOD>
</FROUTE>

</FROUTES>
</RECORD>

<RECORD>   <!--2nd xml -->
<Shipper>
<ID>225</ID>
</Shipper>
<Consignee>
<ID>225</ID>
</Consignee>
<Shipment>
<CargoReadyDate>0000-00-00 00:00:00</CargoReadyDate>
<IncoTerm></IncoTerm>
<NetWeight>1000.000</NetWeight>
<GrossWeight>1050.000</GrossWeight>
<ChargableWeight>1000.000</ChargableWeight>
<Description></Description>
<Remarks>TEST RAMARKS</Remarks>
</Shipment>
<FlightRouteCount>1</FlightRouteCount>
<FROUTES>
<FROUTE>
<FlightCode>CX</FlightCode>
<FlightNo>421</FlightNo>
<FlightDate>2018-10-17</FlightDate>
<FlightTime>11:50:00</FlightTime>
<FlightAPOL>TPE</FlightAPOL>
<FlightAPOD>SYD</FlightAPOD>
</FROUTE>

</FROUTES>

</RECORD>

<RECORD>   <!--3rd xml -->
<Shipper>
<ID>225</ID>

</Shipper>
<Consignee>
<ID>225</ID>

</Consignee>
<Shipment>
CargoReadyDate>0000-00-00 00:00:00</CargoReadyDate>
<IncoTerm></IncoTerm>
<NetWeight>1000.000</NetWeight>
<GrossWeight>1050.000</GrossWeight>
<ChargableWeight>1000.000</ChargableWeight>
<Description></Description>
<Remarks>TEST RAMARKS</Remarks>
</Shipment>
<FlightRouteCount>1</FlightRouteCount>
<FROUTE>
<FlightCode>CX</FlightCode>
<FlightNo>421</FlightNo>
<FlightDate>2018-10-17</FlightDate>
<FlightTime>11:50:00</FlightTime>
<FlightAPOL>TPE</FlightAPOL>
<FlightAPOD>SYD</FlightAPOD>
</FROUTE>
</RECORD>

</RECORDS>

Current Single XSLT- :

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="xml" omit-xml-declaration="yes"/>

<xsl:template match="/">
<UniversalShipment xmlns="http://www.cse.com/Schemas/Universal/2011/11" version="1.1">
<Shipment>
<DataContext>
<DataTargetCollection>
<DataTarget>
<Type>ForwardingShipment</Type>
<Key></Key>
</DataTarget>
</DataTargetCollection>
<Company>
<Code>LK1</Code>
</Company>
<EnterpriseID>EXK</EnterpriseID>
<ServerID>TST</ServerID>
</DataContext>


<ActualChargeable><xsl:value-of select="RECORDS/RECORD/Shipment/ChargableWeight"/></ActualChargeable> 

<!--<ActualChargeable>1000.000</ActualChargeable> -->
<AdditionalTerms></AdditionalTerms>

<TransportMode>
      <Code>AIR</Code>
      <Description></Description>
    </TransportMode>

</Shipment>
</UniversalShipment>
</xsl:template>
</xsl:stylesheet>

Expected Sample output- : This is a one xml file i need a generate multiple xmls base on the input xml<RECORD> Tag

<?xml version="1.0" encoding="utf-8"?>
<UniversalShipment version="1.1" xmlns="http://www.cargowise.com/Schemas/Universal/2011/11">
<Shipment>
<DataContext>
<DataTargetCollection>
<DataTarget>
<Type>ForwardingShipment</Type>
<Key />
</DataTarget>
</DataTargetCollection>
<Company>
<Code>LK1</Code>
</Company>
<EnterpriseID>EXK</EnterpriseID>
<ServerID>TST</ServerID>
</DataContext>
<ActualChargeable>1000.000</ActualChargeable>
<AdditionalTerms />
<TransportMode>
<Code>AIR</Code>
<Description />
</TransportMode>
</Shipment>
</UniversalShipment>



XmlDocument isn't Releasing My XML File for Saving

$
0
0

I would like to load an XML from a file, modify it, then save the XML to itself. However, I am getting an error when I try to write to the same file. I can create a new file, but that is not my goal. Since there is no close/dispose option for XmlDocument, I don't know how to force it. I did try GC.Collect() even though it is not recommend, but it didn't help either-way.


Dim ShipXMLDocument As XmlDocument = New XmlDocument()
ShipXMLDocument.Load(FilePath)

'Modify XML....

ShipXMLDocument.Save(FilePath)

I am new at coding so please explain the solution like I am a 7 year old.

Thank you!

Thank you!

XML Document mapping structure error

$
0
0

Hi Team,

Currently i have a requirement write a XSLT map for transform one xml format to on another format, According to its seems input xml have special element and i when i tring to write XSLT its getting formatting error, Could you please Support to me to complete that. for your reference here with attached sample input file and Current Xslt and expected Sample output.

Input Sample-:

<value odata.etag="">
<ItemInternalId>2c11af0c-ec99-417d-849d-7db167171abc</ItemInternalId>
<JS_UniqueConsignRef>S14019253333</JS_UniqueConsignRef>
<JS_TransportMode>SEA</JS_TransportMode>
<JS_RS_NKServiceLevel>STD</JS_RS_NKServiceLevel>
<JS_SystemLastEditTimeUtc>2019-12-12T09:58:00Z</JS_SystemLastEditTimeUtc>
<JS_INCO>FOB</JS_INCO>
<JS_PackingMode>FCL</JS_PackingMode>

</value>

Current XSLT- 

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--<xsl:output indent="yes" method="xml" omit-xml-declaration="yes"/> -->
<xsl:output indent="yes" method="xml"/>


<xsl:template match="/">

<value>
    <ItemInternalId><xsl:value-of select="value/ItemInternalId"/></ItemInternalId>
    <JS_UniqueConsignRef><xsl:value-of select="value/JS_UniqueConsignRef"/></JS_UniqueConsignRef>
    <JS_IsForwardRegistered>0</JS_IsForwardRegistered>
    <JS_TransportMode><xsl:value-of select="value/JS_TransportMode"/></JS_TransportMode>

   </value> 
</xsl:template>
</xsl:stylesheet>

Expected Output-

<value odata.etag="">
<ItemInternalId>2c11af0c-ec99-417d-849d-7db167171abc</ItemInternalId>
<JS_UniqueConsignRef>S14019253333</JS_UniqueConsignRef>

 <JS_IsForwardRegistered>0</JS_IsForwardRegistered>

<JS_TransportMode>SEA</JS_TransportMode>
</value> 



How To Create the XSLT with the Grouping

$
0
0

Hi Team

Currently i have a requirement write a XSLT map for transform one xml format to on another format,  have requirement is grouping Order no on the  JS_UniqueConsignRef, Could you please Support to me to complete that. for your reference here with attached sample input file  and expected Sample output.

Input XML

<Booking odata.context="https://logic-apis-southeastasia.azure-apim.net/apim/sql/076c2af418044a429486d5c21815d600/$metadata#datasets('default%2Cdefault')/tables('%5Bdbo%5D.%5BShippingXMLTable_ForOneTesting%5D')/items"><value odata.etag=""><ItemInternalId>2983e1fd-940e-4554-b1e4-293c2cf3a801</ItemInternalId><JS_UniqueConsignRef>S17119207972</JS_UniqueConsignRef><OrderNo>BY-91959</OrderNo><BuyerCode>DKVEJ</BuyerCode><SupplierCode>SRESANTUP1</SupplierCode><ConfirmNo></ConfirmNo><InvoiceNo>SSE/0101</InvoiceNo></value><value odata.etag=""><ItemInternalId>00bb143f-a928-463e-831a-c03ef9ca71ee</ItemInternalId><JS_UniqueConsignRef>S17119207972</JS_UniqueConsignRef><OrderNo>BY-91967</OrderNo><BuyerCode>DKVEJ</BuyerCode><SupplierCode>SRESANTUP1</SupplierCode><ConfirmNo></ConfirmNo><InvoiceNo>SSE/0101</InvoiceNo></value></Booking>

Expected Sample Output

<value odata.etag=""><JS_UniqueConsignRef>S17119207972</JS_UniqueConsignRef><JS_IsForwardRegistered>true</JS_IsForwardRegistered><OrderCollection><OrderNo>BY-91959</OrderNo><OrderNo>BY-91967</OrderNo></OrderCollection></value>

XML Notepad: Where can I get it? What can it do for the new XML users?

$
0
0

Hi all,

I am new in using XML in the Microsoft Windows 7 Enterprise - Network Computer System. I have Microsoft Office 2007, SQL Server 2012 Management Studio and Visual Studio 2012 Express in my PC that are housed in the Microsoft Windows 7 Enterprise - Network Computer System.  I just heard XML Notepad and XML Notepad Design. Where can I get XML Notepad? What can it do for the new XML users? I am learning (i) how to read the .XML files in general, (ii) how to create the XML table files for XML databases in Access 2007, (iii) how to use XSLT, and (iv) how to extract/query the desired elements/data in the XML (or Access) databases.  Please kindly help, answer the above-mentioned questions and respond.

Thanks in advance,

Scott Chang  


FTP XML to SQL 2012 to SSRS

$
0
0

I'm new to XML and am just dangerous enough with SQL to mess things up, so bare with me as I explain a new project I'm thinking of.

  1. ftp into an FTP server and download electronic patient files (in XML). An example file was provided and is attached. 
  2. Next take all those xml files and somehow import them into a SQL 2012 Table. Then remove the files from the ftp folder as soon as they are inserted into the table.
  3. Then I think I saw it is called shred? the xml in the table to create table(s) or views to be able to run SQL Server reports off of them using SSRS.

I'm just starting out but is there anything out there that can help automate this process?

If not, what type of software can I use to get started?

Is this something I can get someone to do on the side? If so, where can I ask for someone to do this?


Randy Marrero

part /word/document.xml line 0 column 0

XSLT 2.0 Choose Condition issue

$
0
0

Hi Team,

Currently i have issue when i using choose condition, error getting as a 'Unable to generate the XML document using the provided XML/XSL input. Errors were reported during stylesheet compilation' , According to i checked that sysntax, there not have an any problem on that, Could you please correct me if there have any issue on my current choose condition on XSLT 2.0.

<xsl:choose><xsl:when test="(/OceanRateQuotes/CarrierDetails/Carrier/Rates/Amounts[ContainerType = $ContainerType]/ContainerType)[1]/='20 STD'">20GP</xsl:when><xsl:when test="(/OceanRateQuotes/CarrierDetails/Carrier/Rates/Amounts[ContainerType = $ContainerType]/ContainerType)[1]/='40 STD'">40GP</xsl:when><xsl:when test="(/OceanRateQuotes/CarrierDetails/Carrier/Rates/Amounts[ContainerType = $ContainerType]/ContainerType)[1]/='45 STD'">45HC</xsl:when><xsl:otherwise>
    20GP	</xsl:otherwise></xsl:choose>


Remove XMLNS attribute

$
0
0
Hello ,
Is there a way to remove XMLNS attribute from the root node.I have read in lot of artilces that it cannot be removed as namespace has been attached to all the other elements . But In my case i am just using it to validate the file against one schema and then i need to save that xml file without the XMLNS attribute because it is been used by other system which cannot parse the file if there is a Namespace.

Thank You in advance,
Preet

XSLT 2.0 Date Conversion concern

$
0
0

Hi Team, 

on the XSLT 2.0, i have a  requirement to convert to  datetime format on the xslt level, Could you please support to sort out my concern,

Current mapping output-

<StartDate>
<Date>2019-06-25T05:29:18Z</Date>
</StartDate>

Required format-:

<StartDate>
<Date>2019-06-25T00:00:00</Date>
</StartDate>

Substring Concern on XSLT 2.0

$
0
0

Hi Team,

Currently i'm doing XSLT mapping using XSLT 2. According to i'm Tried capture special part from data field using sub string but still unable to crop and capture requires data part, So Could you please support to do that, for your reference here with attached required data.

Input Data

<RoutingDetails><IXId>1</IXId><Origin>NEW YORK, NY - 10004</Origin><Ramp>MIAMI, FL [USMIA]</Ramp><POL>NEW YORK [USNYC]</POL><Transshipment></Transshipment><POD>ROTTERDAM [NLRTM]</POD><Final_Destination></Final_Destination></RoutingDetails>
expected output

<Ramp>USMIA</Ramp><POL>USNYC</POL><POD>NLRTM</POD>

How to calculate SignatureValue hash for timestamp (XAdES-T)?

$
0
0

I'm trying to add timestamp into XAdES digital signature in order to rise it to XAdES-T level. The problem is: how to calculate hash value of SIgnatureValue element to send it to TSA (timestamp authority) in order to get timestamp on it?

Below is part of my xml signature file with SignatureValue element and C# code used to calculate hash value. I've tried different methods (with PreserveWhitespace true or false, etc.), but calculated hash value is the same. Converted from byte[] to Base64 string: "Ai0lX2Kpgvf2qgnvgnZKN9neUCNGHjXI+XAsEwBzW8k="

Problem is: when we're validating created timestamp with other system, it states that timestamp is incorrect, because timestamped data has changed. After debugging we've found that another system is calculating different hash value of the same SignatureValue element: "XLwTMsF/Axb5/BI0Vvb8fKsJiVVRZmVILWCb/osTWC4="

If we hardcode that hash value into our code, then everything goes fine and created XAdES-T file with timestamp is validated correctly in another system. It's not possible to compare source code with another system because it's proprietary and anyway it's created not on Microsoft platform (not .NET). They stated that our code for calculating hash value of SignatureValue element is incorrect and problem is most likely about canonization - referring to http://www.w3.org/TR/2001/REC-xml-c14n-20010315 and stating that canonization must be performed in the context of the whole document, not just SignatureValue element. But, as described in W3 XAdES-T specification (http://www.w3.org/TR/XAdES/#Syntax_for_XAdES_T_form):"the input for the timestamp hash computation is the ds:SignatureValue XML element". Also, any samples and recommendations (we're able to find on the Internet for calculating timestamp) are using the same approach as in the code sample below.

This is very urgent, could anyone help, please? Answer could be one of the following:

1. If code below for calculating hash value is incorrect, then what is correct way to get correct result?

or

2. If our code is correct, then another system is not conforming with standards - how could I verify and prove that?

Test code for calculating hash value of SignatureValue element:

var doc = new XmlDocument() { PreserveWhitespace = true };
doc.Load("signature_file.xml");

var docElement = doc.DocumentElement;
var signatureValueXmlElement = docElement.GetElementsByTagName("SignatureValue")[0];

var signedInfoDoc = new XmlDocument { PreserveWhitespace = true};

signedInfoDoc.LoadXml(signatureValueNode.OuterXml);

var canonization = new XmlDsigC14NTransform();
canonization.LoadInput(signedInfoDoc);

SHA256 sha256 = SHA256.Create();
var tempHash = canonization.GetDigestedOutput(sha256);

Part of digital signature file ("signature_file.xml") with SignatureValue element:

<Signature ...><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><SignatureMethod ...><Reference ...></Reference>
...</SignedInfo><SignatureValue Id="SignatureValue_Elem_0">
mnmqIMTVG/zflF60U5CKsCI8M9YwOOm09+ZcV1BZSSeYJq6FUD/Dj/tztp6pDmitCOSa33R/87wi
uipRwZmT6H45PnRYFwHFBAt3fOjmkQ7CZr4tYCC2YFnEEOB3FFJVCy1BS46VG7yTa0KQVU/IgSFS
lrR3WWuiBLBn9wwqN+26oERLXTvVR4nVKEdJBG67xCBGL5TJH2DdccnIe2eP0joVcTbkMebGV7F0
eYZ4us0wQeh3HvBF8feKP77eIGeMoF62Gx+2QU+s9VCLmFyglPfSXW9r/7W0UNTMuPrHG3lBalTl
2ULgzuB825pGe44rwPBSmhsL3SmNs6BAyeBA9A==</SignatureValue><KeyInfo><X509Data><X509Certificate>
...</X509Certificate></X509Data></KeyInfo><Object>
		...</Object></Signature>



What's the right XML code If I need to exclude data with value in a date field?

$
0
0

What's the right XML code If I need to exclude data with value in a date field?

<Field SystemID="DateFieldName" [ Code I need] />

I tried these but I'm getting this error:  Object reference not set to an instance of an object

<Field SystemID="DateFieldName" Value!="" /><Field SystemID="DateFieldName" Value<>"" /><Field SystemID="DateFieldName" xsi:nil="false" />


XML digital signature Web service SOAP

$
0
0

Hi to everyone, 

I have web proxy and a few methods there. When the XML has not digital signature, the method that is required is invoked and everything is cool, but if the XML has digital signature, the method is not invoked.

where should i focus to find the mistake ?

this is a problem that i have to find options that are likely to be close to the right answer

How do you filter an XML - with the following query?

$
0
0

Not really sure how to put it, but I can not seem to filter when I used the following clause:  

and c:SampleNumber not like 'NPR%'

Any ideas? What am I doing wrong? Any pointers in the right direction? 

This is the whole code : 

parserName = "xmlHandler"
processXML = samplesXMLResponse

status = XMLParse(parserName, processXML)

' qry = "select c:Programme,c:OrganisationId, c:OrganisationName, c:SampleId, c:SampleNumber, c:MatrixGroup  " 'c:MatrixGroup differentiates between NMD and STEC samples
' qry = qry & "from c:SampleHeader "
' qry = qry & "where c:SampleState = 'Active' " 
' qry = qry & "and c:Programme like 'NMD%'" 

qry = "select c:Programme,c:OrganisationId, c:OrganisationName, c:SampleId, c:SampleNumber, c:MatrixGroup  " 'c:MatrixGroup differentiates between NMD and STEC samples
qry = qry & "from c:SampleHeader "
qry = qry & "where c:SampleState = 'Active' " 
qry = qry & "and c:Programme like 'NMD%' and c:SampleNumber not like 'NPR%' " 


status = ClearArray("sampleIdArray")
status = XMLQuery(parserName, qry, "sampleIdArray")


Getting node values separately using msxml parser in vc++?

$
0
0

In the below example how can i get the text values separately like : { {i am parent text}, {i am child1}, {i am child2}, {with above childs} } using {get_nodeValue} property in MSXML using c++ : {<rootElement>} {<parent>i am parent text} {<child_1>i am child1</child_1>} {<child_2>i am child2</child_2>} {with above childs} {</parent>} {</rootElement>} here when i am using {get_nodeValue()} for the {parent} element, i am getting null as it is of NODE_ELEMENT type. i have referred following link :

<https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms756022(v%3Dvs.85)>

Here is the code used:

ParseCurrentNode(IXMLDOMNode* CurrentNode) { VARIANT nValNode; BSTR bstrNodeText; CString strNodeText; Nodevalue->get_text(&bstrNodeText); strNodeText = bstrNodeText; SysFreeString(bstrNodeText); HRESULT temphr=FormatNode->get_nodeValue(&nValNode); } result is: strNodeText (concatenated string)="i am parent text i am child1 i am child2 with above childs" nValNode = null; Here CurrentNode is "parent":<rootelement><parent>i am parent text<child1>i am child 1</child1><child2>i am child 2</child2>

with above childs

</rootelement>

Retrieving Text strings in a mixed-content XmlElement

$
0
0

I have an XML Element that may contain elements, text or both. For example:

 

Code Block

<

testvalue="-360.0">

  <

testlogic="OR">

    fcs/heading-error-1 gt 180

    fcs/heading-error-2 gt 180

  </test>                     

  fcs/heading-error gt 180

  fcs/heading-error-3 gt 180  

</test>

 

 

I'd like to extract the text only from each element - and ONLY the text for that element and not child elements. The XmlElement InnerText and InnerXml members return strings that are not completely what I am looking for. For example, I'd like to get the text for the top-level element as:

 

Code Block

fcs/heading-error gt 180

fcs/heading-error-3 gt 180

 

And, I'd like to retrieve the nested test strings:

 

Code Block

fcs/heading-error-1 gt 180

fcs/heading-error-2 gt 180

 

Notice there are not even any comments there.

 

Am I correct in thinking that I'm going to have to do a lot of "manual" test processing? Or, is there a better approach?

 

Jon

How to parse mixed content in xml using msxml parser?

$
0
0
How to parse mixed content in xml using msxml parser. please show with example

Formatting Paragraphs to same length

$
0
0
Hi, the below xml is formatting the paragraph strange. the very first line is double the length of all the other lines. I have only included a portion of the text and rather than manually editing the text to format the whole thing to be the longer version how can you format it in notepad++ to all be the same length? Text wrap won't work since all the lines with the exception of the first line are shortened. Thanks

<Section xmlns="http://schemas.microsoft.com/winfx/2006/xaml/prese..." xml:space="preserve" HasTrailingParagraphBreakOnPaste="True">
<Paragraph FontSize="12" FontFamily="Portable User Interface" Foreground="#FF000000" FontWeight="Normal" FontStyle="Normal" FontStretch="Normal" CharacterSpacing="0" Typography.AnnotationAlternates="0" Typography.EastAsianExpertForms="False" Typography.EastAsianLanguage="Normal" Typography.EastAsianWidths="Normal" Typography.StandardLigatures="True" Typography.ContextualLigatures="True" Typography.DiscretionaryLigatures="False" Typography.HistoricalLigatures="False" Typography.StandardSwashes="0" Typography.ContextualSwashes="0" Typography.ContextualAlternates="True" Typography.StylisticAlternates="0" Typography.StylisticSet1="False" Typography.StylisticSet2="False" Typography.StylisticSet3="False" Typography.StylisticSet4="False" Typography.StylisticSet5="False" Typography.StylisticSet6="False" Typography.StylisticSet7="False" Typography.StylisticSet8="False" Typography.StylisticSet9="False" Typography.StylisticSet10="False" Typography.StylisticSet11="False" Typography.StylisticSet12="False" Typography.StylisticSet13="False" Typography.StylisticSet14="False" Typography.StylisticSet15="False" Typography.StylisticSet16="False" Typography.StylisticSet17="False" Typography.StylisticSet18="False" Typography.StylisticSet19="False" Typography.StylisticSet20="False" Typography.Capitals="Normal" Typography.CapitalSpacing="False" Typography.Kerning="True" Typography.CaseSensitiveForms="False" Typography.HistoricalForms="False" Typography.Fraction="Normal" Typography.NumeralStyle="Normal" Typography.NumeralAlignment="Normal" Typography.SlashedZero="False" Typography.MathematicalGreek="False" Typography.Variants="Normal" TextOptions.TextHintingMode="Fixed" TextOptions.TextFormattingMode="Ideal" TextOptions.TextRenderingMode="Auto" TextAlignment="right" LineHeight="0" LineStackingStrategy="MaxHeight">
<Run>Please read the Confidentiality and Nonsolicitation agreement then acknowledge you understand by clicking the box below. For good and valuable consideration, the receipt of which is hereby acknowledged, hereby agrees with Company (“WK”) (hereinafter “Company,” Company and Signatory are collectively referred to as the
“Parties” or in the singular as a “Party”) as follows pursuant to this Confidentiality and
Nonsolicitation Agreement (“Agreement”):

How to avoid omitted namespace on OuterXml

$
0
0
When trying to build SOAP request using XmlDocument
when calling myXmlDocument.OuterXml - it omits the "tns:" which breaks the SOAP request

Simplest code to show the problem follows:

var doc = new XmlDocument();
    doc.LoadXml("<Root />");
    XmlNode node = doc.CreateElement("tns:MyNode");
    string nodeName = node.Name;    // "tns:MyNode"
    string nodeXml = node.OuterXml; // "<MyNode />"
    // Why OuterXml does not show the correct node.Name
Viewing all 935 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>