Re: what can i do if i want to include "<" or ">" in xml document.



Escape them to "&lt;" and "&gt;" (excluding the surrounding quotes.

">" is ususally safe even unescaped in most contexts.

Sometimes it becomes necessary to escape the quotes and the apostrophe
characters -- accordingly -- with "&quot;" and "&apos;"

Another character to escape almost always is the ampersand character
itself -- this is escaped as "&amp;"


Cheers,
Dimitre Novatchev


"Steven.Xu" <StevenXu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DED43E7B-486A-45C9-A566-F1DACEC8C429@xxxxxxxxxxxxxxxx
hi everybody,
i am useing some classes which in System.Xml to deal with xml document.
what
can i do if the document include "<" or ">"?

Thanks.


.



Relevant Pages

  • Re: A critique of cgi.escape
    ... and quotes should always be escaped. ... Making cgi.escape always escape the '"' character would not break ... and would probably fix a few bugs in existing code. ...
    (comp.lang.python)
  • Re: escaped identifier vs regular names ?
    ... Escaped identifiers are not in a separate namespace from normal ... the terminating whitespace character to be a space character, ... And, yes, many Verilog tools create escaped names of this form. ... escape names, it isn't really handling the entire Verilog language. ...
    (comp.lang.verilog)
  • Re: delimiters, sql, joins, AHHH!
    ... To decide whether or not to delimit the data, look at the datatype of the ... means you MUST NOT delimit the data by putting quotes around it. ... the data contains an apostrophe, then you must replace the apostrophe with ... you don't have to escape the apostrophe in O'Malley when you use ...
    (microsoft.public.inetserver.asp.general)
  • Re: delimiters, sql, joins, AHHH!
    ... > contains literal quotes, you must escape them by doubling them. ... > that if you use single quotes for your string delimiters, ... > the data contains an apostrophe, then you must replace the apostrophe with ...
    (microsoft.public.inetserver.asp.general)
  • Re: Unrecognized escape sequences in string literals
    ... character without knowing the context, ... '\n' maps to the string chr. ... In both cases the backslash in the literal have the same meaning: ... escape every backslash, ...
    (comp.lang.python)

Loading