Hi all,
From dotnet code i have encoded the XML as string and passed this value as XML attribute value in below.
Am not sure if we can have XML as attribute value inside another XML.hence i did with below approach.
Now i have special character '<' in that please refer yellow highlighted.this was having problem in casting to XML.
Kindly assist me.
Thanks in advance.
DECLARE @XMLXML
SET @XML='<Utility><Actions><Action Category="ExecuteSp" SettingName="GetDMS" ComponentId="19">
<Parameters Param="SourceXML" Value="&lt;NewDataSet&gt;&lt;Table1&gt;&lt;DocumentName&gt;US OB&amp;lt; 14 Weeks /Transvaginal&lt;/DocumentName&gt;&lt;/Table1&gt;&lt;/NewDataSet&gt;" /></Action></Actions></Utility>'
Declare @SourceDMSXMLasvarchar(max)
SELECT @SourceDMSXML = @XML.value('(/Utility/Actions/Action/Parameters[@Param = "SourceXML"]/@Value)[1]','varchar(max)')
SET @SourceDMSXML=Replace(@SourceDMSXML,'&lt;','<');
SET @SourceDMSXML=Replace(@SourceDMSXML,'&gt;','>');
SET @SourceDMSXML=Replace(@SourceDMSXML,'<','<');
SET @SourceDMSXML=Replace(@SourceDMSXML,'>','>');
DECLARE @SourceXMLXML
SET @SourceXML=CAST(@SourceDMSXMLASXML)
select @SourceXML