Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I have an example for you. This snippet will surround the selected text with <code>&lt;![CDATA[...]]&gt;</code></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"&gt; &lt;Header&gt; &lt;Title&gt;Surround in CDATA&lt;/Title&gt; &lt;Author&gt;Sten Hougaard, 2010 - http://www.netsi.dk/wordpress&lt;/Author&gt; &lt;Shortcut&gt;shortcut&lt;/Shortcut&gt; &lt;Description&gt;Surrounds selected data in CDATA&lt;/Description&gt; &lt;SnippetTypes&gt; &lt;SnippetType&gt;SurroundsWith&lt;/SnippetType&gt; &lt;SnippetType&gt;Expansion&lt;/SnippetType&gt; &lt;/SnippetTypes&gt; &lt;/Header&gt; &lt;Snippet&gt; &lt;Declarations&gt; &lt;Literal&gt; &lt;ID&gt;name&lt;/ID&gt; &lt;Default&gt;value&lt;/Default&gt; &lt;/Literal&gt; &lt;/Declarations&gt; &lt;Code Language="XML"&gt; &lt;![CDATA[&lt;![CDATA[$selected$]]&gt;&lt;![CDATA[]]]&gt;&lt;![CDATA[]]]&gt;&lt;![CDATA[&gt;]]&gt; &lt;/Code&gt; &lt;/Snippet&gt; &lt;/CodeSnippet&gt; </code></pre> <p>The steps to make this example are this:</p> <ol> <li>Copy and paste these into a new XML file in Visual Studio</li> <li>Save it anywhere as for instance: "SnippetXML_SurroundWithCDATA.snippet"</li> <li>Open "Tools > Code Snippet Manager"</li> <li>Click "Import..." and locate the file you just saved, choose it and click "open"</li> <li>You now have the option to choose where it should be possible to "run" the snippet. Choose one or more "scenarios"</li> </ol> <p>The snippet is now ready for use. Try it using a relevant scenario, for instance a XML file. Select some data and click Ctrl+K and Ctrl+S (or go through the menu). Locate the snippet and voila - your data has been surrounded with CDATA.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload