Special Character in XML Attribute Value
I want to put a colon in an attribute value that is used to display the title of a chart on my webpage.
I have something like:
<chart displayname="This is the chart name" resource = "blah blah blah">
I want the display name to be something like "This: is the chart name"
How can I accomp开发者_如何学运维lish this?
If it helps here are the HTML codes of the characters I want to use: - and :
Colon is not a special character. Just put it in there, it will work.
If you want to keep your attributes alphanumeric, use the UTF notation instead of the colon:
displayname="This:My Chart"
Obviously the semicolon and spaces are not alphanumeric, but the above will achieve what I think you are going for.
精彩评论