<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss">

<channel>
	<title>www.netsi.dk &#187; XSLT</title>
	<atom:link href="http://www.netsi.dk/wordpress/index.php" rel="self" type="application/rss+xml" />
	<link>http://www.netsi.dk/wordpress</link>
	<description>&#34;The internet is just a layer on the real world&#34; (don&#039;t forget that!)</description>
	<lastBuildDate>Thu, 09 Feb 2012 08:52:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<atom:link rel="next" href="http://www.netsi.dk/wordpress/index.php?page=2" />

		<item>
		<title>Controling styles for individual websites on shared CSS</title>
		<link>http://www.netsi.dk/wordpress/index.php/2012/02/09/controling-styles-for-individual-websites-on-shared-css/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2012/02/09/controling-styles-for-individual-websites-on-shared-css/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 08:49:56 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dynamicweb]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[kiss]]></category>
		<category><![CDATA[modenizr]]></category>
		<category><![CDATA[stylesheet]]></category>
		<category><![CDATA[styling]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2012/02/09/controling-styles-for-individual-websites-on-shared-css/</guid>
		<description><![CDATA[When working with CMS like Dynamicweb or Syncron VIA, you sometimes share stylesheet files across domains or subdomains. It makes sense to share common CSS codes when you want to some some common styles like fonts, colours or logos. &#160; The same styles… almost… It is also common that some small differences exists on subdomains, [...]]]></description>
			<content:encoded><![CDATA[<p>When working with CMS like Dynamicweb or Syncron VIA, you sometimes share <a href="http://www.netsi.dk/wordpress/index.php/tag/stylesheet/" class="st_tag internal_tag" rel="tag" title="Posts tagged with stylesheet">stylesheet</a> files across domains or subdomains. It makes sense to share common CSS codes when you want to some some common styles like fonts, colours or logos.</p>
<p>&#160;</p>
<h2>The same styles… almost…</h2>
<p>It is also common that some small differences exists on subdomains, perhaps a campaign site or a site target for a specific group of people. You then need to apply some small changes to those sites. Ofcause you can do this in many ways, and the CMS you use will probertly be a part of your decision on <a href="http://www.netsi.dk/wordpress/index.php/tag/how-to/" class="st_tag internal_tag" rel="tag" title="Posts tagged with how to">how to</a> implement it. Here is one way to do it:</p>
<blockquote><h3>Add a CLASS to HTML tag with some site related information.</h3>
</blockquote>
<p>For instance I could add this code to my blog:</p>
<pre class="csharpcode"><span class="kwrd">&lt;</span>html class=&quot;wwwnetsidk&quot;...</pre>
<p>The rule should be simple, for instance:</p>
<ul>
<li>Replace not-valid characters like “.” from the DOMAIN NAME to “nothing” </li>
</ul>
<p>The reason it should be simpel is that it makes it easy to figure out what it should be for a given domain name. Things which are using the <a title="Read about the acronym &quot;Kiss&quot; - keep it simple, stupid!" href="http://en.wikipedia.org/wiki/KISS_principle">KISS</a> (“Keep It Simple, Stupid!”) principle will more likely be used by people, as (in general) people are lazy (I know! <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smiley" src="http://www.netsi.dk/wordpress/wp-content/uploads/2012/02/wlEmoticon-smile.png" />, trust me.)</p>
<p>&#160;</p>
<p>When this rule have been applied you can add extra lines to your shared CSS file like this:</p>
<pre>html.wwwnetsidk {background-color: red;}</pre>
<p>The princip is used widely, for instance by <a href="http://www.modernizr.com/">http://www.modernizr.com/</a> which addes a lot of feature related classes to your HTML element telling you for instance which HTML5 features are supported. Just look here at parts of what modernizr adds to your HTML document:</p>
<pre title="Example of classes added to HTML element by modenizr">js no-touch postmessage history multiplebgs boxshadow opacity...</pre>
<h2><a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a> example from Syncron Via CMS</h2>
<p>Here are an example of how I have implemented this feature in the Danish CMS system Syncron Via. The system is using XSLT a lot, and the code here is applied to the XSLT template used to render the outer Page data:</p>
<pre title="Define the class to be added to the HTML element in a variable and add it to the HTML class attribute.">&lt;xsl:variable name=&quot;serverName&quot; select=&quot;translate(/Page/RequestContent/ServerVariables/Entry[@Name='SERVER_NAME'], '.-', '')&quot; /&gt;
...
&lt;html class=&quot;{$serverName}&quot;...</pre>
<p>This is what I do: define the class to be added to the HTML element in a variable and add it to the HTML class attribute.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2012%2F02%2F09%2Fcontroling-styles-for-individual-websites-on-shared-css%2F&amp;title=Controling%20styles%20for%20individual%20websites%20on%20shared%20CSS" id="wpa2a_2"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2012/02/09/controling-styles-for-individual-websites-on-shared-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add entities to XSLT templates</title>
		<link>http://www.netsi.dk/wordpress/index.php/2012/01/18/how-to-add-entities-to-xslt-templates/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2012/01/18/how-to-add-entities-to-xslt-templates/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 12:52:39 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[entities;]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2012/01/18/how-to-add-entities-to-xslt-templates/</guid>
		<description><![CDATA[When you work with XSLT you sometimes need special characters like “«” and “»”. You can define “entities” which can then be used in the document. Here is how: &#160; &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62; &#60;!DOCTYPE xsl:stylesheet [ &#60;!ENTITY laquo &#34;&#38;#171;&#34;&#62; &#60;!ENTITY raquo &#34;&#38;#187;&#34;&#62; &#60;!ENTITY hellip &#34;&#38;#8230;&#34;&#62; ]&#62; &#60;xsl:stylesheet… You add the lines marked above. They defined [...]]]></description>
			<content:encoded><![CDATA[<p>When you work with <a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a> you sometimes need special characters like “«” and “»”. You can define “entities” which can then be used in the document. Here is how:</p>
<p>&#160;</p>
<pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!DOCTYPE xsl:<a href="http://www.netsi.dk/wordpress/index.php/tag/stylesheet/" class="st_tag internal_tag" rel="tag" title="Posts tagged with stylesheet">stylesheet</a> [
  &lt;!ENTITY laquo &quot;&amp;#171;&quot;&gt;
  &lt;!ENTITY raquo &quot;&amp;#187;&quot;&gt;
  &lt;!ENTITY hellip &quot;&amp;#8230;&quot;&gt;
]&gt;
&lt;xsl:<a href="http://www.netsi.dk/wordpress/index.php/tag/stylesheet/" class="st_tag internal_tag" rel="tag" title="Posts tagged with stylesheet">stylesheet</a>…</pre>
<p>You add the lines marked above. They defined a relation between a entity name and a character code. For instance the “laquo” will make it possibel for you to use &amp;laquo; when inserting a “«”.</p>
<p>&#160;</p>
<h3>HTML Entities codes</h3>
<p>The website “<a title="A very well structured overview of HTML entities codes" href="http://entitycode.com/" target="_blank">entitycode.com</a>” has a very nice structured overview of HTML Entities Codes. You can see the relation between characters, their entity name, the decimal code and a short description of the character. They are very well organised in categories, go and see it for your self…</p>
<p>&#160;</p>
<h4>Links</h4>
<ul>
<li><a title="A very well structured overview of HTML entities codes" href="http://entitycode.com/" target="_blank">entitycode.com</a> </li>
<li><a href="http://stackoverflow.com/questions/31870/using-a-html-entity-in-xslt-e-g-nbsp">Stackoverflow.com: Using a html entity in xslt (e.g. &amp;nbsp;)</a> </li>
</ul>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2012%2F01%2F18%2Fhow-to-add-entities-to-xslt-templates%2F&amp;title=How%20to%20add%20entities%20to%20XSLT%20templates" id="wpa2a_4"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2012/01/18/how-to-add-entities-to-xslt-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Did you remember to exclude namespaces from output?</title>
		<link>http://www.netsi.dk/wordpress/index.php/2012/01/16/did-you-remember-to-exclude-namespaces-from-output/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2012/01/16/did-you-remember-to-exclude-namespaces-from-output/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 12:06:40 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[C# in XSLT]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[namespace]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2012/01/16/did-you-remember-to-exclude-namespaces-from-output/</guid>
		<description><![CDATA[When you work with XSLT, transforming XML to for instance the web in some CMS system, you might use some extra namespaces. Perhaps the CMS offers you some utilitiy namespace to handle relevant datastructure or procedures. You add them to your XSLT but perhaps you forgot to tell the XSLT processor not to add the [...]]]></description>
			<content:encoded><![CDATA[<p>When you work with <a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a>, transforming XML to for instance the web in some CMS system, you might use some extra namespaces. Perhaps the CMS offers you some utilitiy <a href="http://www.netsi.dk/wordpress/index.php/tag/namespace/" class="st_tag internal_tag" rel="tag" title="Posts tagged with namespace">namespace</a> to handle relevant datastructure or procedures. You add them to your <a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a> but perhaps you forgot to tell the <a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a> processor not to add the namespaces to the output? Well I do some times… </p>
<p>&#160;</p>
<h2>Namespaces in a XSLT template</h2>
<p>Adding namespaces to get extra features in your XSLT templates is easy. You may or may not think about it, but you will allways add at least one namespace “xsl”. Using <a href="http://www.netsi.dk/wordpress/index.php/tag/microsoft-visual-studio/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Microsoft Visual studio">Microsoft Visual Studio</a> and selecting “New XSLT…” you will probertly also get a MS namespace like this: “msxsl”. I all happens in the beging of the template like this:</p>
<pre>&lt;xsl:<a href="http://www.netsi.dk/wordpress/index.php/tag/stylesheet/" class="st_tag internal_tag" rel="tag" title="Posts tagged with stylesheet">stylesheet</a> version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot;
  exclude-result-prefixes=&quot;msxsl &quot;
  xmlns:cs=&quot;urn:custom-cs&quot;
&gt;</pre>
<p>In the above example there are three namespaces:</p>
<ul>
<li>xmlns:<strong>xsl</strong>=&quot;http://www.w3.org/1999/XSL/Transform&quot; </li>
<li>xmlns:<strong>msxsl</strong>=&quot;urn:schemas-microsoft-com:xslt&quot; </li>
<li>xmlns:<strong>cs</strong>=&quot;urn:custom-cs&quot; </li>
</ul>
<p>The first one “xsl” is telling the XSLT processor that we are using XSLT and that the we will be using the XSLT rules defined in 1999 by w3.org. </p>
<p>The next one “msxsl” addes MS custom features and will give you some nice new features, for instance <a title="Converts standard XSD date formats to characters suitable for output." href="http://msdn.microsoft.com/en-us/library/ms256099.aspx" target="_blank">functions to format dates (ms:format-date Function)</a>. </p>
<p>The last one I use for adding custom C# code in my XSLT. That is a very powerfull way of extending the XSLT processor with your own custom .NET code. But <a title="Read my blog post about adding C# to XSLT, this links to part 1." href="http://www.netsi.dk/wordpress/index.php/2009/12/19/using-c-in-xslt-transformations-very-strong-tool/" target="_blank">please take care when doing that</a>!</p>
<p>&#160;</p>
<h2>Removing the namespace from the output</h2>
<p>If you use custom namespaces you may end up with the namespaces added to the output elements. In the above code you may observe that there is an attribute “exclude-result-prefixes” on the xsl:stylesheet tag. It is used to tell the XSLT processor which namespaces should not be added to the output elements. I have added “msxsl” but not “cs”. I the example I use XSLT in Dynamicweb CMS to generate HTML, so I may get output looking like this:</p>
<pre>&lt;ul xmlns:cs=&quot;urn:custom-cs&quot;&gt;</pre>
<p>That is not what I wanted! To remove the “cs” namespace I simply need to modify the xsl:stylesheet attribute “exclude-result-prefix” to:</p>
<pre>&lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot;
  exclude-result-prefixes=&quot;msxsl <strong>cs</strong>&quot;
  xmlns:cs=&quot;urn:custom-cs&quot;
&gt;</pre>
<p>I have added the “cs” namespace, so I will now get a tag without the “cs” namespace in my HTML.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2012%2F01%2F16%2Fdid-you-remember-to-exclude-namespaces-from-output%2F&amp;title=Did%20you%20remember%20to%20exclude%20namespaces%20from%20output%3F" id="wpa2a_6"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2012/01/16/did-you-remember-to-exclude-namespaces-from-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XSLT: Insert newline in output</title>
		<link>http://www.netsi.dk/wordpress/index.php/2011/08/05/xslt-insert-linebreak-in-output/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2011/08/05/xslt-insert-linebreak-in-output/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 08:54:35 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[XSLT]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[linebreak]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2011/08/05/xslt-insert-linebreak-in-output/</guid>
		<description><![CDATA[To insert a linebreak you simply output the unescaped values of carriage return and linebreak, which is CR+LF (char 13 + char 10). &#60;xsl:value-of select="'&#38;#13;&#38;#10;'" disable-output-escaping="yes"/&#62; You may read more about newline on wikipedia.]]></description>
			<content:encoded><![CDATA[<p>To insert a <a href="http://www.netsi.dk/wordpress/index.php/tag/linebreak/" class="st_tag internal_tag" rel="tag" title="Posts tagged with linebreak">linebreak</a> you simply output the unescaped values of carriage return and <a href="http://www.netsi.dk/wordpress/index.php/tag/linebreak/" class="st_tag internal_tag" rel="tag" title="Posts tagged with linebreak">linebreak</a>, which is CR+LF (char 13 + char 10).</p>
<p><code>&lt;xsl:value-of select="'&amp;#13;&amp;#10;'" disable-output-escaping="yes"/&gt;</code></p>
<p>You may read <a href="http://en.wikipedia.org/wiki/Newline" target="_blank">more about newline on wikipedia</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2011%2F08%2F05%2Fxslt-insert-linebreak-in-output%2F&amp;title=XSLT%3A%20Insert%20newline%20in%20output" id="wpa2a_8"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2011/08/05/xslt-insert-linebreak-in-output/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Encode URL in XSLT</title>
		<link>http://www.netsi.dk/wordpress/index.php/2011/02/02/encode-url-in-xslt/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2011/02/02/encode-url-in-xslt/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 11:48:05 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[dynamicweb]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[encodeURI]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2011/02/02/encode-url-in-xslt/</guid>
		<description><![CDATA[If you need to URL encode something in XSLT, you can use javascript serverside – not perfect, but it gets the job done. Here is the javascript and below you can find link to a simpel XSLT which has the script implemented. 1: &#60;script language=&#34;javascript&#34; xmlns=&#34;urn:schemas-microsoft-com:xslt&#34; implements-prefix=&#34;js&#34;&#62; 2: &#60;![CDATA[ 3: // This will return a [...]]]></description>
			<content:encoded><![CDATA[<p>If you need to URL encode something in <a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a>, you can use <a href="http://www.netsi.dk/wordpress/index.php/tag/javascript/" class="st_tag internal_tag" rel="tag" title="Posts tagged with javascript">javascript</a> serverside – not perfect, but it gets the job done. Here is the <a href="http://www.netsi.dk/wordpress/index.php/tag/javascript/" class="st_tag internal_tag" rel="tag" title="Posts tagged with javascript">javascript</a> and below you can find link to a simpel <a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a> which has the script implemented.</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum">   1:  </span>  &lt;script language=<span class="str">&quot;javascript&quot;</span> xmlns=<span class="str">&quot;urn:schemas-microsoft-com:xslt&quot;</span> implements-prefix=<span class="str">&quot;js&quot;</span>&gt;</pre>
<pre><span class="lnum">   2:  </span>    &lt;![CDATA[ </pre>
<pre class="alt"><span class="lnum">   3:  </span>    <span class="rem"><a href="http://www.netsi.dk/wordpress/index.php/tag/164/" class="st_tag internal_tag" rel="tag" title="Posts tagged with //">//</a> This will return a URI encoded string</span></pre>
<pre><span class="lnum">   4:  </span>    <span class="kwrd">function</span> encodeURL(sUrl) {</pre>
<pre class="alt"><span class="lnum">   5:  </span>      sUrl.MoveNext();</pre>
<pre><span class="lnum">   6:  </span>      sUrl = sUrl.Current.Value;</pre>
<pre class="alt"><span class="lnum">   7:  </span>      <span class="kwrd">return</span> <a href="http://www.netsi.dk/wordpress/index.php/tag/encodeuri/" class="st_tag internal_tag" rel="tag" title="Posts tagged with encodeURI">encodeURI</a>(sUrl);</pre>
<pre><span class="lnum">   8:  </span>    }</pre>
<pre class="alt"><span class="lnum">   9:  </span>    ]]&gt;</pre>
<pre><span class="lnum">  10:  </span>  &lt;/script&gt;</pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Find example XSLT here: <a title="http://dl.dropbox.com/u/3260327/xslt/js_encodeURL.xslt" href="http://dl.dropbox.com/u/3260327/xslt/js_encodeURL.xslt">http://dl.dropbox.com/u/3260327/xslt/js_encodeURL.xslt</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2011%2F02%2F02%2Fencode-url-in-xslt%2F&amp;title=Encode%20URL%20in%20XSLT" id="wpa2a_10"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2011/02/02/encode-url-in-xslt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XPath evaluation in Visual Studio 2010: TTXPathNavigatorVSIX</title>
		<link>http://www.netsi.dk/wordpress/index.php/2010/11/28/xpath-evaluation-in-visual-studio-2010-ttxpathnavigatorvsix/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2010/11/28/xpath-evaluation-in-visual-studio-2010-ttxpathnavigatorvsix/#comments</comments>
		<pubDate>Sun, 28 Nov 2010 21:53:28 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[XPath]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2010/11/28/xpath-evaluation-in-visual-studio-2010-ttxpathnavigatorvsix/</guid>
		<description><![CDATA[My daily tool for creating webpages is Visual studio 2010 (VS2010), but one thing which I think it lacks in are XML/XSLT related tools. One such thing is XPath related, XPath is the one of the building blocks of XSLT which I use often during my work with Dynamicweb CMS. I found a free addin [...]]]></description>
			<content:encoded><![CDATA[<p>My daily tool for creating webpages is <a href="http://www.netsi.dk/wordpress/index.php/tag/visual-studio-2010/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Visual Studio 2010">Visual studio 2010</a> (VS2010), but one thing which I think it lacks in are XML/<a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a> related tools. One such thing is <a href="http://www.netsi.dk/wordpress/index.php/tag/xpath/" class="st_tag internal_tag" rel="tag" title="Posts tagged with XPath">XPath</a> related, <a href="http://www.netsi.dk/wordpress/index.php/tag/xpath/" class="st_tag internal_tag" rel="tag" title="Posts tagged with XPath">XPath</a> is the one of the building blocks of <a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a> which I use often during my work with <a title="Besøg Dynamicwebs hjemmeside" href="http://www.dynamicweb.dk" target="_blank">Dynamicweb CMS</a>.</p>
<p>I found a free addin for VS2010 <a title="TTXPathNavigatorVSIX is a free tool for Visual Studio 2010" href="http://visualstudiogallery.msdn.microsoft.com/en-us/c5d4671c-2e29-4452-b039-6f931b7b1155" target="_blank">TTXPathNavigatorVSIX</a> which I tried to download. The way you should install it is by:</p>
<p>Open Extention Manager and Select “Online Gallery”, now type “TTXPathNavigator” in the search field. You should get something like this:</p>
<p><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/11/image7.png" rel="lightbox[453]"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="This is how the tool appears in the online gallery found under Extention Manager in your Visual studio 2010" border="0" alt="This is how the tool appears in the online gallery found under Extention Manager in your Visual studio 2010" src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/11/image_thumb6.png" width="437" height="302" /></a></p>
<p>Now click “Download” and after having accepted something the plugin is installed into your VS2010. You must restart VS2010 in order to make the plugin work, so do that. You simply press restart. </p>
<h3>Using the plugin</h3>
<p>After VS2010 has restarted you now have a new XPath query field as shown here below.</p>
<p><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/11/image8.png" rel="lightbox[453]"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="This is a screenshoot taken by the tool creator" border="0" alt="This is a screenshoot taken by the tool creator" src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/11/image_thumb7.png" width="480" height="277" /></a></p>
<h3>So off you go! XPathing away! Happy XPathing…</h3>
<p>Or so I though.. I might have guessed by the lacking documentation on the page where I initially found the plugin, that I needed to do <em>some</em> trying out before I could start to use this very simple plugin. So to save your time here is what I found out:</p>
<ul>
<li>Before using it you should know that it is a simple plugin:      <br />- no highlighting of XPath results in the XML tree       <br />- results are only presented in the <strong>output window</strong>. So you need to open (and pin) the output window. So open the debug window and pin it (so that it stays open)       </p>
<p><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/11/image9.png" rel="lightbox[453]"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="You find the debug window under Debug - Windows - Output" border="0" alt="You find the debug window under Debug - Windows - Output" src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/11/image_thumb8.png" width="480" height="72" /></a>       </li>
<li>In the output window you wil have to select to see the output from <strong>XPath navigator</strong>, and you might have to execute a XPath navigator before the option is there in the “Show output from” selectbox.
<p><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/11/image10.png" rel="lightbox[453]"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/11/image_thumb9.png" width="452" height="116" /></a>       </li>
<li>It only handles results which return a node-set, which is, well a limitation IMHO. What this means is that you cannot get a result from say this XPath:      <br /><code>count(//Page[string-length(@Icon)&gt;0])</code>       </li>
<li><strong>The good news!</strong>       <br />You can actually double click on the output to goto the line containing the found element! Very nice! </li>
</ul>
<h3>My wish – an XPath generator!</h3>
<p>To make things work perfectect in VS2010 it would be <strong>so nice</strong> to have <strong>a XPath generator!</strong> As you have when you debug XSLT in the watch area. I would love to be able to select an element or an attribute and right click to get the option: “Generate XPath” – wow, please someone create such a plugin and I will buy you a beer! <img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smiley" src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/11/wlEmoticon-smile1.png" /></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2010%2F11%2F28%2Fxpath-evaluation-in-visual-studio-2010-ttxpathnavigatorvsix%2F&amp;title=XPath%20evaluation%20in%20Visual%20Studio%202010%3A%20TTXPathNavigatorVSIX" id="wpa2a_12"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2010/11/28/xpath-evaluation-in-visual-studio-2010-ttxpathnavigatorvsix/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Improvements in Microsoft Visual Studio 2010, from a frontend webdevelopers point of view, part 1: javascript</title>
		<link>http://www.netsi.dk/wordpress/index.php/2010/09/22/improvements-in-microsoft-visual-studio-2010-from-a-frontend-webdevelopers-point-of-view-part-1-javascript/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2010/09/22/improvements-in-microsoft-visual-studio-2010-from-a-frontend-webdevelopers-point-of-view-part-1-javascript/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 21:48:39 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[intellisense]]></category>
		<category><![CDATA[Microsoft Visual studio 2010]]></category>
		<category><![CDATA[xml commenta]]></category>
		<category><![CDATA[xml documentation]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2010/09/22/improvements-in-microsoft-visual-studio-2010-from-a-frontend-webdevelopers-point-of-view-part-1-javascript/</guid>
		<description><![CDATA[Sometimes I have wondered just what the h**l they were thinking over at Microsoft: their flagship development tool just didn’t perform and deliver what you would expect from a tool of that caliber. That was before the Microsoft Visual Studio 2010 (VS 2010)! I will try to write about features in VS 2010 which makes [...]]]></description>
			<content:encoded><![CDATA[<p><em>Sometimes I have wondered just what the h**l they were thinking over at Microsoft: their flagship development tool just didn’t perform and deliver what you would expect from a tool of that caliber. That was before the <a href="http://www.netsi.dk/wordpress/index.php/tag/microsoft-visual-studio/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Microsoft Visual studio">Microsoft Visual Studio</a> 2010 (VS 2010)! I will try to write about features in VS 2010 which makes me happy as a frontend web developer, hoping that you will gain something from it – and please do comment and share your experiences.</em></p>
<h1>The background: What I missed…</h1>
<p>I have during my 15 years career as web developer tried various development tools, and have touched the “backend” development side of web applications also. It seems that many rich development tools focus on the heavier backend development part of web application development with things like <a href="http://www.netsi.dk/wordpress/index.php/tag/intellisense/" class="st_tag internal_tag" rel="tag" title="Posts tagged with intellisense">intellisense</a>, <a href="http://www.netsi.dk/wordpress/index.php/tag/snippets/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Snippets">snippets</a> and so on. I have often wondered: Why should it be so difficult and not possible – especially in VS – to automate things, processes which is done many times every day? Rich development tools RDTs should support the “web craftsmen” trying to produce quality work. In real life “real” tools for craftsmen like a carpenter have evolved. Quality tools make the fundament for quality work! Anyway, we might just have got a piece of quality tool in VS 2010!</p>
<h2>The new features &#8211; <a href="http://www.netsi.dk/wordpress/index.php/tag/javascript/" class="st_tag internal_tag" rel="tag" title="Posts tagged with javascript">javascript</a></h2>
<p>In this part I focus on javascript in VS 2010.</p>
<h3>Javascript intellicence</h3>
<p><strong>jQuery embedded from local “standard” API javascript file.</strong> </p>
<p>It is near perfect now! The intellisense engine in VS 2010 seems to “think” nearly perfect. Say you want to use jQuery. If you include your jQuery API using a local version, you <em>will</em> get <strong>basic</strong> intellisense – that is objects inside the jQuery API will appear as you start typing. You will get <em>relevant</em> methods shown together with basic information about which parameters you can use. Okay, but it gets better!<br />
<h4>Microsoft minimised version of jQuery still has intellisence</h4>
</p>
<p>jQuery embedded from Microsoft at: <a title="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" href="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" target="_blank">http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js</a> <br />Using the MS CDN to get even a <strong>minified version</strong> of jQuery, you <strong>still</strong> get extensive intellisence!<a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image9.png" rel="lightbox[394]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="absMiddle" src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image_thumb9.png" width="640" height="79"/></a> </p>
<blockquote><p>Note: <br />After you have added any external script file you can <em>update the javascript intellisense</em> using <code>[Shift]+[Ctrl]+J</code>. For big APIs like jQuery this might take perhaps 20 seconds.</p>
</p>
</blockquote>
<h4>jQuery plug-ins handled as well in intelisence</h4>
<p>Extra jQuery plug-ins added will also get intellisense, as expected, but also at the correct place <br />below you can see that I have added a script reference to the <a title="jQuery Cycle plug-in homepage" href="http://jquery.malsup.com/cycle/" target="_blank">jQuery Cycle plug-in</a> for jQuery. The “cycle” method now exists after I have used a jQuery selector $(‘#test’). The description of the method “cycle” however is not very useful – but that is because that the jquery.cycle.all.min.js file <strong>does not contain JavaScript documentation</strong> (more about that later). </p>
<p>If you think about it – VS 2010 is quit smart! It scans the cycle plug-in and sees that it <strong>extends</strong> the jQuery API. That is how it can figure out – I guess – that the cycle method fits in as a method on a found elements of the “$” (or jQuery) method. Nice feature! </p>
<p>&nbsp; </p>
<p><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image10.png" rel="lightbox[394]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="The intellisence works perfect" border="0" alt="The intellisence works perfect" src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image_thumb10.png" width="554" height="315"/></a> </p>
<h4>Dropdown filelist simplified</h4>
<p>Automatic dropdown file list when adding HTML code like “script”. Previously you had to click the “Pick URL…” and then point to the file which you wanted to use in your HTML document. Now you simply click on the file, if it is located at the same place as the current document. Nice. </p>
<p>&nbsp; </p>
<p>”<a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image11.png" rel="lightbox[394]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Dropdown filelist simplified" border="0" alt="Dropdown filelist simplified" src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image_thumb11.png" width="566" height="214"/></a></p>
<h4>Snippets – finally!!</h4>
<p>I have written about snippets in Visual Studio in a previous post: <a title="Find Visual Studio Snippets ready for download on my DropBox folder" href="http://www.netsi.dk/wordpress/index.php/2010/08/05/find-visual-studio-snippets-ready-for-download-on-my-dropbox-folder/" target="_blank">Find Visual Studio Snippets ready for download on my DropBox folder</a>, but it is first in VS 2010 that it is actually possible to execute snippets in HTML mode! (Why, why, why?). Anyway you can now! And VS 2010 comes with a few snippets installed. </p>
<p><strong>Snippet types “Surround with” and “Insert snippet” </strong><b><br /></b>If you do not know <a href="http://www.netsi.dk/wordpress/index.php/tag/how-to/" class="st_tag internal_tag" rel="tag" title="Posts tagged with how to">how to</a> activate them try the “<em>surround with snippet</em>” by pressing <code>[Ctrl]-K, [Ctrl]-S</code>. By doing that you get the chance to automate things like creating a JavaScript function using just two keyboard clicks and a mouse click. The Insert snippet can be archived using <code>[Ctrl]-K, [Ctrl]-X</code>. And remember: You can always create your own! </p>
</p>
<p><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image12.png" rel="lightbox[394]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Using the surround with snippet" border="0" alt="Using the surround with snippet" src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image_thumb12.png" width="547" height="262"/></a> </p>
<p>Just discovered that in fact Microsoft has not made it possibel to use snippets within CSS… Why, why, why???</p>
<h4>Intellisence will execute your code dynamically to give better suggestions</h4>
<p>Say you define a string “effect” and assign it a <em>string</em> value. This will make VS 2010 execute the assignment and then “guess” that your variable is of the type String. So at a late point in your code you try to use the variable, <strong>the suggestions given by intellisense</strong> will be <strong>relevant</strong> to that type (string). Look at the example below. To the left a variable “effect” and to the right an “int”, the suggestions are not the same. Smart! and you can do some pretty nice things when your code is dynamically executed – try visiting the <a title="JavaScript Intellisense Improvements with VS 2010 - on ScottGu's Blog" href="http://weblogs.asp.net/scottgu/archive/2010/04/08/javascript-intellisense-improvements-with-vs-2010.aspx" target="_blank">JavaScript Intellisense Improvements with VS 2010 &#8211; on ScottGu&#8217;s Blog</a> and have a look at those examples.  </p>
<p><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image13.png" rel="lightbox[394]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Intelligence sugestions are related to the type of your variable..." border="0" alt="Intelligence sugestions are related to the type of your variable..." src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image_thumb13.png" width="640" height="212"/></a></p>
<h4>Your own intellisence using XML comments! </h4>
<p>Now there is no excuse why you do not document your JavaScript code! VS 2010 offers <strong>easy</strong> documentation using <strong>snippets and XML comments!</strong> It is so easy, simply press <code>[Ctrl]+K, [Ctrl]+X</code>, choose “XML Comments” and what type of comment you want to insert. After having done and (of cause) filling out the marked fields, <strong>your</strong> code will be providing <strong>intellisense</strong> and <strong>suggestions</strong> when other people use it! <strong>Cool!</strong> </p>
<p>You can see below a simple function called “myhide”, The 3 lines below the function have been inserted using the above mentioned XML comments snippet. I defined a summary, a return definition and a param description. Voila! My function now has intellisense and build in help – which will without doubt be useful for me and others at a later state. You can make this part quit advanced with references to documentation files, assemblies and more.  </p>
</p>
<p><a href="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image14.png" rel="lightbox[394]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Here goes your excuse for not documenting your javascript code anymore! XML Comments in javascript." border="0" alt="Here goes your excuse for not documenting your javascript code anymore! XML Comments in javascript." src="http://www.netsi.dk/wordpress/wp-content/uploads/2010/09/image_thumb14.png" width="640" height="351"/></a> </p>
<p>&nbsp;</p>
<h4>Various small changes</h4>
<ul>
<li>You can zoom the work area as you can in your browser. Just hold down <code>[Ctrl]</code>while rolling the wheel of you mouse up and down. Guess that woud be nice for elderly people like me <img src='http://www.netsi.dk/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   </li>
<li>All these improvements also apply to the <strong>free</strong> <a title="Go to this url to start installing the Visual Web Developer 2010 Express" href="http://www.microsoft.com/web/gallery/install.aspx?appid=VWD2010" target="_blank">Visual Web Developer 2010 Express</a>! </li>
</ul>
<p>&nbsp;</p>
</p>
<h5>Links</h5>
<ul>
<li><a title="JavaScript Intellisense Improvements with VS 2010 - on ScottGu's Blog" href="http://weblogs.asp.net/scottgu/archive/2010/04/08/javascript-intellisense-improvements-with-vs-2010.aspx" target="_blank">JavaScript Intellisense Improvements with VS 2010 &#8211; on ScottGu&#8217;s Blog</a>  </li>
<li><a title="VS 2010 and .NET 4 Series - on ScottGu's Blog" href="http://weblogs.asp.net/scottgu/archive/2009/08/25/vs-2010-and-net-4-series.aspx" target="_blank">VS 2010 and .NET 4 Series &#8211; on ScottGu&#8217;s Blog</a> </li>
</ul>
<pre></pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2010%2F09%2F22%2Fimprovements-in-microsoft-visual-studio-2010-from-a-frontend-webdevelopers-point-of-view-part-1-javascript%2F&amp;title=Improvements%20in%20Microsoft%20Visual%20Studio%202010%2C%20from%20a%20frontend%20webdevelopers%20point%20of%20view%2C%20part%201%3A%20javascript" id="wpa2a_14"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2010/09/22/improvements-in-microsoft-visual-studio-2010-from-a-frontend-webdevelopers-point-of-view-part-1-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find Visual Studio Snippets ready for download on my DropBox folder</title>
		<link>http://www.netsi.dk/wordpress/index.php/2010/08/05/find-visual-studio-snippets-ready-for-download-on-my-dropbox-folder/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2010/08/05/find-visual-studio-snippets-ready-for-download-on-my-dropbox-folder/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 10:52:35 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[Microsoft Visual studio]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2010/08/05/find-visual-studio-snippets-ready-for-download-on-my-dropbox-folder/</guid>
		<description><![CDATA[I will be sharing future Snippets for use in Microsoft Visual Studio on my public dropbox here: http://db.tt/3p5Sav At the time of writing only one is out there – it is “Surround in CDATA”. You may also read about that particular one here: Article on Stack Overflow: Can I define custom “surround with” templates in [...]]]></description>
			<content:encoded><![CDATA[<p>I will be sharing future <a href="http://www.netsi.dk/wordpress/index.php/tag/snippets/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Snippets">Snippets</a> for use in <a href="http://www.netsi.dk/wordpress/index.php/tag/microsoft-visual-studio/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Microsoft Visual studio">Microsoft Visual Studio</a> on my public dropbox here: <a title="http://db.tt/3p5Sav" href="http://db.tt/3p5Sav">http://db.tt/3p5Sav</a></p>
<p>At the time of writing only one is out there – it is “Surround in CDATA”. You may also read about that particular one here: <a title="Article on Stack Overflow: Can I define custom “surround with” templates in Visual Studio 2008?" href="http://bit.ly/9JinuY" target="_blank">Article on Stack Overflow: Can I define custom “surround with” templates in Visual Studio 2008?</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2010%2F08%2F05%2Ffind-visual-studio-snippets-ready-for-download-on-my-dropbox-folder%2F&amp;title=Find%20Visual%20Studio%20Snippets%20ready%20for%20download%20on%20my%20DropBox%20folder" id="wpa2a_16"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2010/08/05/find-visual-studio-snippets-ready-for-download-on-my-dropbox-folder/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using XPath operator &#8220;//&#8221; aka &#8220;descendant-or-self&#8221; in XSLT</title>
		<link>http://www.netsi.dk/wordpress/index.php/2010/06/08/using-xpath-operator-aka-descendant-or-self-in-xslt/</link>
		<comments>http://www.netsi.dk/wordpress/index.php/2010/06/08/using-xpath-operator-aka-descendant-or-self-in-xslt/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 20:36:58 +0000</pubDate>
		<dc:creator>netsi</dc:creator>
				<category><![CDATA[XSLT]]></category>
		<category><![CDATA[//]]></category>
		<category><![CDATA[descendant-or-self]]></category>
		<category><![CDATA[operator]]></category>
		<category><![CDATA[XPath]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://www.netsi.dk/wordpress/index.php/2010/06/08/using-xpath-operator-aka-descendant-or-self-in-xslt/</guid>
		<description><![CDATA[In my daily work as frontend developer at www.bleau.dk I do a lot of XSLT “programming” – XPath is one of the things you need to master most. With the focus mainly set on closing tasks I have not had the time to test a – well nice to know thing with the “//” XPath [...]]]></description>
			<content:encoded><![CDATA[<p>In my daily work as frontend developer at <a href="http://www.bleau.dk">www.bleau.dk</a> I do a lot of <a href="http://www.netsi.dk/wordpress/index.php/tag/xslt/" class="st_tag internal_tag" rel="tag" title="Posts tagged with xslt">XSLT</a> “programming” – <a href="http://www.netsi.dk/wordpress/index.php/tag/xpath/" class="st_tag internal_tag" rel="tag" title="Posts tagged with XPath">XPath</a> is one of the things you need to master most. With the focus mainly set on closing tasks I have not had the time to test a – well nice to know thing with the “<a href="http://www.netsi.dk/wordpress/index.php/tag/164/" class="st_tag internal_tag" rel="tag" title="Posts tagged with //">//</a>” XPath <a href="http://www.netsi.dk/wordpress/index.php/tag/operator/" class="st_tag internal_tag" rel="tag" title="Posts tagged with operator">operator</a>. Tonight I finally found out what had been a question in my mind for at long period:</p>
<blockquote><p>The “//” (decendant-or-self) XPath operator: <em>Can</em> it be used <em><strong>relative</strong> </em>inside a full XPath? Will it “search” from the Document top, or start where it is placed inside the XPath selector?</p>
</blockquote>
<h3>An example XML:</h3>
</p>
<pre class="xml" name="code">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;people&gt;
&#160; &lt;group type=&quot;frontEnd&quot;&gt;
&#160;&#160;&#160; &lt;person name=&quot;Sten&quot; /&gt;
&#160; &lt;/group&gt;
&#160; &lt;group type=&quot;backend&quot;&gt;
&#160;&#160;&#160; &lt;person name=&quot;Sten&quot; /&gt;
&#160; &lt;/group&gt;
&lt;/people&gt;</pre>
<h3>The two XPaths</h3>
<p><code>//person[@name='Sten']</code> – Returns a nodeset containing <strong>2 elements</strong></p>
<p><code>//group[@type=&quot;frontEnd&quot;]//person[@name='Sten']</code> – Returns a nodeset containing only <strong>1 element</strong></p>
<p>So as you can see the first one looked from the <strong>root</strong> (/People) and <strong>anywhere</strong> inside the document. The second one had the “//” <em>inside</em> a XPath, which in made the “//” operator look <strong>from the spot it was and below</strong>. </p>
<h3>Conclusion</h3>
<p>Well, I just got a litle wiser as I learned that I actually can use the “//” operator inside XPath selectors. </p>
<h6>Links</h6>
<ul>
<li><a title="XSLT Reference at New Mexico Tech" href="https://infohost.nmt.edu/tcc/help/pubs/xslt/operator-sect.html">https://infohost.nmt.edu/tcc/help/pubs/xslt/operator-sect.html</a> </li>
</ul>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.netsi.dk%2Fwordpress%2Findex.php%2F2010%2F06%2F08%2Fusing-xpath-operator-aka-descendant-or-self-in-xslt%2F&amp;title=Using%20XPath%20operator%20%26ldquo%3B%2F%2F%26rdquo%3B%20aka%20%26ldquo%3Bdescendant-or-self%26rdquo%3B%20in%20XSLT" id="wpa2a_18"><img src="http://www.netsi.dk/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.netsi.dk/wordpress/index.php/2010/06/08/using-xpath-operator-aka-descendant-or-self-in-xslt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

