I am trying to send a XML String inside a XML tag called value here ... its not allowing me to, whats wrong ??
<params>
<Param Name="@strXML" Value="<Root><Table1 ID="1" Name="A"></Root>"/>
</params>
Printable View
I am trying to send a XML String inside a XML tag called value here ... its not allowing me to, whats wrong ??
<params>
<Param Name="@strXML" Value="<Root><Table1 ID="1" Name="A"></Root>"/>
</params>
It would be the double quotes within the Value attribute - replace them with single quotes, or another alternative :)
I tried this ..
<params>
<Param Name="@strXML" Value='<Root><Table1 ID="1" Name="A" /></Root>'/>
</params>
still gives error ...
Ah - just had a quick play in IE - replace the < and > with < and > respectively :)
I think its something to do with < character. I somehow need to use Server.HTMLEncode method of ASP in VB to convert < > characters to XML values ...
I know, but its code and not a manual process. How will I know during runtime what tags do I have to convert ??Quote:
Originally posted by axion_sa
Ah - just had a quick play in IE - replace the < and > with < and > respectively :)
I assume you extract the attribute value(s) in code & action accordingly? In that case - replace all occurrences of < and > with their respective node values before you begin executing whatever it is you do.
You are right .. I wrote this ..
VB Code:
Public Function HTMLEncode(ByVal inputString As String) As String inputString.Replace("<", "<") inputString.Replace(">", ">") Return inputString End Function
however, this fixes the problem. I am now just wondering if there is anything else I need to worry about which I cannot foresee at this time ... ????
Not offhand - but to err on the right side of cautious... Perhaps have a Google at reserved XML characters, that might pop up a few more than <, > and "