subhorachana
asked on
Passing & as a parameter in string
Hello,
I have a message in XML format and I am retreiving data from each element of the XML using XPATH in Biztalk.I am now passing this data as parameters where I want to do additional manipulation to the data.
One of my string parameter values is coming as "EK &SONS INC" and when I try to pass this as it is in string format in a method call, I get the following error: "System.Xml.XmlException: An error occurred while parsing EntityName"
I have even tried to replace the & with &
Please suggest what should I do to format the string such that the '&' is retained in the string and the method call is successful.
I am using C#.NEt for coding
I have a message in XML format and I am retreiving data from each element of the XML using XPATH in Biztalk.I am now passing this data as parameters where I want to do additional manipulation to the data.
One of my string parameter values is coming as "EK &SONS INC" and when I try to pass this as it is in string format in a method call, I get the following error: "System.Xml.XmlException: An error occurred while parsing EntityName"
I have even tried to replace the & with &
Please suggest what should I do to format the string such that the '&' is retained in the string and the method call is successful.
I am using C#.NEt for coding
It was not- I added it there when I posted the above message :)
It was only in Microsoft Development, Programming Languages
It was only in Microsoft Development, Programming Languages
Could we see some sample code?
Possibly the full stack trace?
Possibly the full stack trace?
ASKER
exact location of code where I am getting the error:I am trying to create an XML as one of the parameter for Web service.It throws an error while creating the XML.
batchElement.InnerXml = "<Method ID='1' Cmd='New'>" +
"<Field Name='Title'>APIS</Field>" +
"<Field Name='Status'>Pending</Fie ld>" +
"<Field Name='Number'></Field>" +
"<Field Name='EffecitveDate'>adsaf sa</Field> " +
"<Field Name='ExpirationDate'></Fi eld>" +
"<Field Name='Named'>EK &SONS INC</Field>" +
"<Field Name='NamedICity'>Chicago< /Field>" +
"<Field Name='NamedZIP'>60611</Fie ld></Metho d>"
batchElement.InnerXml = "<Method ID='1' Cmd='New'>" +
"<Field Name='Title'>APIS</Field>"
"<Field Name='Status'>Pending</Fie
"<Field Name='Number'></Field>" +
"<Field Name='EffecitveDate'>adsaf
"<Field Name='ExpirationDate'></Fi
"<Field Name='Named'>EK &SONS INC</Field>" +
"<Field Name='NamedICity'>Chicago<
"<Field Name='NamedZIP'>60611</Fie
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER