Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xml string in a C# summary comment

I'm documenting a few methods I wrote in C# that deal with parsing tokens. Due to some technical restraints in other areas of the system, these tokens need to take the form of XML elements (i.e., <tokenName />). I'd like to put the format of those tokens in the summary statement itself.

However, this throws an error: Badly formed XML -- A name was started with an invalid character". Is there any sort of escape character sequence I can use to embed XML in my C# summary comments?

like image 713
loomisjennifer Avatar asked Mar 03 '09 16:03

loomisjennifer


People also ask

What is XML string?

String. xml file contains all the strings which will be used frequently in Android project. String. xml file present in the values folder which is sub folder of res folder in project structure.In Android Studio, we have many Views such as TextView,Button,EditText,CheckBox,RadioButton etc.

What is XML C?

c. Similar to the GLib Markup parser, which also just parses an xml subset, xml. c is a simple, small and self contained xml parser in one file. Ideal for embedding into other projects without the need for big external dependencies.

How do I load a string in XML?

To load XML from a string To populate an XML literal such as an XElement or XDocument object from a string, you can use the Parse method. The following code example shows the use of the XDocument. Parse(String) method to populate an XDocument object with XML from a string.

What is XML parser in C?

The Oracle XML parser for C reads an XML document and uses DOM or SAX APIs to provide programmatic access to its content and structure. You can use the parser in validating or nonvalidating mode. This chapter assumes that you are familiar with the following technologies: Document Object Model (DOM).


1 Answers

Use standard XML escaping. For example:

<summary>This takes a &lt;token1&gt; and turns it into a &lt;token2&gt;</summary> 

It's not super-easy to type or read as code, but IntelliSense properly unescapes this and you see the right, readable thing in the tooltip.

like image 118
Andrew Arnott Avatar answered Sep 20 '22 00:09

Andrew Arnott