I am getting an error when I attempt to access a node with
SelectSingleNod e(): "The expression passed to this method should result in a
NodeSet." I understand there is some confusion when you have to state a
namespace in the xpath. Can the node be accessible by the xpath specified?
Thanks.
XmlDocument xmldoc = new XmlDocument();
XmlCDataSection cdata = xmldoc.CreateCD ataSection(requ estString);
String soapEnvelope =
"<SOAP-ENV:Envelope
xmlns:SOAP-ENV=\"http://schemas.xmlsoap .org/soap/envelope/\"
xmlns:xsi=\"htt p://wwww3.org/1999/XMLSchema-instance\"
xmlns:xsd\"http ://www.w3.org/1999/XMLSchema\">
<SOAP-ENV:Body>
<m:submit xmlns:m=\"com.a bc.def\">
<parameter1>TES T</parameter1>
<parameter2></parameter2>
</m:submit>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>";
xmldoc.LoadXml( soapEnvelope);
XmlNode xmlnode =
xmldoc.Document Element.SelectS ingleNode("SOAP-ENV:Envelope/SOAP-ENV:Body/m:submit/parameter2/");
xmlnode.AppendC hild(cdata);
SelectSingleNod e(): "The expression passed to this method should result in a
NodeSet." I understand there is some confusion when you have to state a
namespace in the xpath. Can the node be accessible by the xpath specified?
Thanks.
XmlDocument xmldoc = new XmlDocument();
XmlCDataSection cdata = xmldoc.CreateCD ataSection(requ estString);
String soapEnvelope =
"<SOAP-ENV:Envelope
xmlns:SOAP-ENV=\"http://schemas.xmlsoap .org/soap/envelope/\"
xmlns:xsi=\"htt p://wwww3.org/1999/XMLSchema-instance\"
xmlns:xsd\"http ://www.w3.org/1999/XMLSchema\">
<SOAP-ENV:Body>
<m:submit xmlns:m=\"com.a bc.def\">
<parameter1>TES T</parameter1>
<parameter2></parameter2>
</m:submit>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>";
xmldoc.LoadXml( soapEnvelope);
XmlNode xmlnode =
xmldoc.Document Element.SelectS ingleNode("SOAP-ENV:Envelope/SOAP-ENV:Body/m:submit/parameter2/");
xmlnode.AppendC hild(cdata);
Comment