Hi, As far as i know, & and < are special characters for xml. so we need to escape those two characters to make the string be well-formed xml string. & is easy to handle, just encode it to & ;.afer validation or transformation, decode it back. My question is how to encode < sign in element value, seems can not just encode it to < ;, since it's hard to differieciated less than sign from open tag If you have solution, share with me please. Huge thanks.
It looks like Rose was trying to write "<" in the first place, but wrote "< ;" (trying to fool UBB) and UBB (or the browser?) converted this to "< ;". Very . Anyway, to write < in UBB type < which you in turn get by writing &lt; which you in turn get by writing &amp;lt; which you in turn get by writing &amp;amp;lt; etc. :roll: Usually you just need to go just one or two steps into this progression, but in order to talk about step 1 you need to use step 2, etc. To anwer what I think was the intended question - when you write a "<", you usually need to know at the time whether it's the beginning of a tag (in which case write it as "<") or part of the text content of a tag (in which case replace it with "<"). I guess it really depends where you're getting this data from, but in most contexts I can imagine you should already know if it's content or markup. The only exception I can think of is if you're reading an XML file which was not properly encoded to beging with, and you're trying to fix it. But perhaps you (Rose) should tell us more about where the data comes from, before we get into all the possibilities here. [ February 13, 2003: Message edited by: Jim Yingst ]