|
-
Jun 26th, 2004, 12:30 PM
#1
Thread Starter
Hyperactive Member
what is wrong with this ???
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>
-
Jun 26th, 2004, 12:50 PM
#2
It would be the double quotes within the Value attribute - replace them with single quotes, or another alternative
-
Jun 26th, 2004, 12:51 PM
#3
Thread Starter
Hyperactive Member
I tried this ..
<params>
<Param Name="@strXML" Value='<Root><Table1 ID="1" Name="A" /></Root>'/>
</params>
still gives error ...
-
Jun 26th, 2004, 01:10 PM
#4
Ah - just had a quick play in IE - replace the < and > with < and > respectively
-
Jun 26th, 2004, 01:14 PM
#5
Thread Starter
Hyperactive Member
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 ...
-
Jun 26th, 2004, 01:15 PM
#6
Thread Starter
Hyperactive Member
Originally posted by axion_sa
Ah - just had a quick play in IE - replace the < and > with < and > respectively
I know, but its code and not a manual process. How will I know during runtime what tags do I have to convert ??
-
Jun 26th, 2004, 01:18 PM
#7
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.
-
Jun 26th, 2004, 01:25 PM
#8
Thread Starter
Hyperactive Member
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 ... ????
-
Jun 26th, 2004, 01:31 PM
#9
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 "
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|