<?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/"
	>

<channel>
	<title>Expressing IT &#187; XML</title>
	<atom:link href="http://developer.expressionz.in/blogs/tag/xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://developer.expressionz.in/blogs</link>
	<description>User Interface : just another, but a serious developers weblog</description>
	<lastBuildDate>Thu, 20 May 2010 18:05:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting the DOCTYPE in XSL</title>
		<link>http://developer.expressionz.in/blogs/2008/08/02/setting-the-doctype-in-xsl/</link>
		<comments>http://developer.expressionz.in/blogs/2008/08/02/setting-the-doctype-in-xsl/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 05:28:33 +0000</pubDate>
		<dc:creator>Nikhil</dc:creator>
				<category><![CDATA[XSL]]></category>
		<category><![CDATA[Browser Quirks]]></category>
		<category><![CDATA[Doctype]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://developer.expressionz.in/blogs/?p=14</guid>
		<description><![CDATA[The PROBLEM :
You want control over the DOCTYPE, since your transformation will include a default DOCTYPE explicitly, and you layout will be out for a toss.

The Solution:
XSLT specs provides output methods to set a the DOCTYPE of choise. Also, for us UI developers, the topics of interest would be HTML output methods and XML output methods.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdeveloper.expressionz.in%2Fblogs%2F2008%2F08%2F02%2Fsetting-the-doctype-in-xsl%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdeveloper.expressionz.in%2Fblogs%2F2008%2F08%2F02%2Fsetting-the-doctype-in-xsl%2F&amp;source=nikhild&amp;style=normal&amp;hashtags=Browser+Quirks,Doctype,XML,XSL" height="61" width="50" /><br />
			</a>
		</div>
<p>Last week I created a progessive HTML/CSS layout for a client, tested it in IE6, IE7 and FF 3, seemed perfectly fine&#8230; UNTIL! the layout went further down the manufacting cycle. It failed. Page layout elements just went all over the place when the HTML layout was converted into  XSL and  XML applied to it &#8230; Bummer!!!</p>
<p>Could not sleep ok over the weekend, in anticipation of Monday morning, when I&#8217;ll have to fix this SH**. But now having a little experince in dealing with these kind of situations ( Browser Quirks, I mean), I knew it had to do with nothing else but DOCTYPE&#8230;. and It WAS&#8230;</p>
<p><strong>The Problem:</strong><br />
You want control over the DOCTYPE, since your transformation will include a default DOCTYPE explicitly, and you layout will be out for a toss.</p>
<p><strong>The Solution:</strong><br />
<a title="XSL Specs" href="http://www.w3.org/TR/xslt" target="_blank">XSLT specs</a> provides output methods to set a the DOCTYPE of choise. Also, for us UI developers, the topics of interest would be <a title="XSl Specs : HTMl Output" href="http://www.w3.org/TR/xslt#section-HTML-Output-Method" target="_blank">HTML output methods </a>and <a title="XSl Specs : XSl Output" href="http://www.w3.org/TR/xslt#section-XML-Output-Method" target="_blank">XML output methods</a>.</p>
<p>Well! before you get bored , here is the fix.</p>
<p>For eg., if you had the following DOCTYPE in your HTML version :-</p>
<blockquote><p><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;</code></p></blockquote>
<p>Then in the XSL you would have to have the following :-</p>
<blockquote><p><code>&lt;xsl:output method="html" doctype-system="http://www.w3.org/TR/html4/loose.dtd" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" indent="yes" /&gt;<br />
</code></p></blockquote>
<p>and Finally! do make sure your XSLT output obeys the DOCTYPE  you have chosen.</p>
]]></content:encoded>
			<wfw:commentRss>http://developer.expressionz.in/blogs/2008/08/02/setting-the-doctype-in-xsl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Include XSL inside XSL</title>
		<link>http://developer.expressionz.in/blogs/2008/05/04/include-xsl-inside-xsl/</link>
		<comments>http://developer.expressionz.in/blogs/2008/05/04/include-xsl-inside-xsl/#comments</comments>
		<pubDate>Sun, 04 May 2008 09:48:51 +0000</pubDate>
		<dc:creator>Nikhil</dc:creator>
				<category><![CDATA[XSL]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XSL Includes]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://developer.expressionz.in/blogs/?p=16</guid>
		<description><![CDATA[Imagine you are creating a website (and using XML, XSL transfroms ofcourse) and most of the pages would have a <strong>Comments Module </strong>. Well! then either you copy or paste this code into every page template or even better you create an INCLUDE file can call it where ever you want it in your main page template...<strong>So HOW DO WE INCLUDE a XSL file inside another XSL file</strong>? Here is how...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdeveloper.expressionz.in%2Fblogs%2F2008%2F05%2F04%2Finclude-xsl-inside-xsl%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdeveloper.expressionz.in%2Fblogs%2F2008%2F05%2F04%2Finclude-xsl-inside-xsl%2F&amp;source=nikhild&amp;style=normal&amp;hashtags=Tutorials,XML,XSL,XSL+Includes,XSLT" height="61" width="50" /><br />
			</a>
		</div>
<p>If XML/XSL Transforms is your domian, then there are times when we want a peice of Dynamic code to be used library item(to be made re-usable). What I mean , probably could be made more clear with this example scenario.</p>
<p>Imagine you are creating a website (and using XML, XSL transfroms ofcourse) and most of the pages would have a <strong>Comments Module </strong>. Well! then either you copy or paste this code into every page template (which I dont have say, but make maintenance and rework a nightmare) or even better, you create an INCLUDE file which could be pulled in where ever you want it in your page(s)&#8230;<br />
<strong>So HOW DO WE CREATE a XSL INCLUDE file and include it inside another XSL file</strong>? Here is how&#8230;</p>
<p>Just to make things clear &#8230; here is quick list of files that you would create &#8230; here , we will be including info about fruits and vegetables into a parent page called food.</p>
<p>1. food.xml &#8211; xml data file on which the transformation will be applied<br />
2. food.xsl  -  main XSL file, which will transform our food.xml<br />
3. inc_fruits.xsl &#8211; XSL include file that will render fruits data<br />
4. inc_vegtables.xsl &#8211; XSL include file that will render vetetables data</p>
<p>I dont think I have explain much , the codes for above elements , will be self explanatory&#8230;</p>
<p><strong>FOOD.XML</strong></p>
<blockquote>
<div><code><br />
&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;<br />
&lt;?xml-stylesheet type="text/xsl" href="food.xsl"?&gt;<br />
&lt;food&gt;<br />
&lt;date&gt;July 2008&lt;/date&gt;<br />
&lt;description&gt;All about things we eat everyday&lt;/description&gt;<br />
&lt;fruits type="tropical"&gt;<br />
&lt;item name="mango" moreinfo="http://www.mango.com"&gt;Mango is the king of fruits&lt;/item&gt;<br />
&lt;item name="banana" moreinfo="http://www.banana.com"&gt;Banana once a day , keeps the doctor away&lt;/item&gt;<br />
&lt;item name="orange" moreinfo="http://www.orange.com"&gt;Orange is the color and rich in vitamin C&lt;/item&gt;<br />
&lt;item name="Papaya" moreinfo="http://www.papaya.com"&gt;Papaya - Hot when raw, cold when ripe&lt;/item&gt;<br />
&lt;/fruits&gt; </code></div>
<p><code>&lt;vegetables&gt;<br />
&lt;item name="spinach" moreinfo="http://www.spinach.com"&gt;Spinach is full of iron&lt;/item&gt;<br />
&lt;item name="asparagus" moreinfo="http://www.asparagus.com"&gt;Asparagus contains loads of vitamin D &lt;/item&gt;<br />
&lt;item name="fenugreek" moreinfo="http://www.fenugreek.com"&gt;Fenugreek is rich in vitamin C&lt;/item&gt;<br />
&lt;/vegetables&gt;<br />
&lt;/food&gt;</p>
<p></code></p></blockquote>
<hr />
<strong>FOOD.XSL</strong></p>
<blockquote>
<div><code><br />
&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;<br />
&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;<br />
&lt;xsl:include href="inc_fruits.xsl" /&gt;<br />
&lt;xsl:include href="inc_vegetables.xsl" /&gt;<br />
&lt;xsl:template match="/"&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Title&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;h3&gt;&lt;xsl:value-of select="/food/description" /&gt;&lt;/h3&gt;<br />
Modification Date : &lt;xsl:value-of select="/food/date" /&gt;<br />
&lt;hr/&gt;<br />
&lt;h5&gt; About Fruits&lt;/h5&gt;<br />
&lt;xsl:call-template name="about_fruits"/&gt;</code></div>
<p><code>&lt;hr/&gt;<br />
&lt;h5&gt; About Vegetables&lt;/h5&gt;<br />
&lt;xsl:call-template name="about_vegetables"/&gt;</p>
<p>&lt;hr/&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
&lt;/xsl:template&gt;<br />
&lt;/xsl:stylesheet&gt;</p>
<p> </p>
<p></code></p></blockquote>
<hr />
<strong>INC_FRUITS.XSL</strong></p>
<blockquote><p><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;<br />
&lt;xsl:output method="html" encoding="iso-8859-1" /&gt;<br />
&lt;xsl:template name="about_fruits"&gt;<br />
&lt;xsl:for-each select="/food/fruits/item/@*"&gt;<br />
attribute name : &lt;xsl:value-of select="name()"/&gt; <br />
attribute value : &lt;xsl:value-of select="."/&gt; &lt;br /&gt;<br />
&lt;/xsl:for-each&gt;<br />
&lt;/xsl:template&gt;<br />
&lt;/xsl:stylesheet&gt;</code></p></blockquote>
<hr />
<strong>INC_VEGETABLES.XSL</strong></p>
<blockquote><p><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;<br />
&lt;xsl:output method="html" encoding="iso-8859-1" /&gt;<br />
&lt;xsl:template name="about_vegetables"&gt;<br />
&lt;xsl:for-each select="/food/vegetables/item/@*"&gt;<br />
attribute name : &lt;xsl:value-of select="name()"/&gt; <br />
attribute value : &lt;xsl:value-of select="."/&gt; &lt;br/&gt;<br />
&lt;/xsl:for-each&gt;<br />
&lt;/xsl:template&gt;<br />
&lt;/xsl:stylesheet&gt;</code></p></blockquote>
<p><strong><a title="download" href="http://developer.expressionz.in/blogs/wp-content/plugins/download-monitor/download.php?id=5" target="_blank">Download all the above files here (88 downloads)</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://developer.expressionz.in/blogs/2008/05/04/include-xsl-inside-xsl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with XML Node Attributes in XSLT</title>
		<link>http://developer.expressionz.in/blogs/2008/04/04/working-with-xml-node-attributes-in-xslt/</link>
		<comments>http://developer.expressionz.in/blogs/2008/04/04/working-with-xml-node-attributes-in-xslt/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 08:17:25 +0000</pubDate>
		<dc:creator>Nikhil</dc:creator>
				<category><![CDATA[XSL]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XML Attributes]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://developer.expressionz.in/blogs/?p=15</guid>
		<description><![CDATA[If you use XML and XSL, then you might have come across a time , when you have to play around with attributes and values of XML nodes in you XSL. They are loads of sites with long winded info about this, but none I found were brief and precise ... This is NO XML/XSL TUTORIAL,but my attempt to put-together some sort of cheat list ...
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdeveloper.expressionz.in%2Fblogs%2F2008%2F04%2F04%2Fworking-with-xml-node-attributes-in-xslt%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdeveloper.expressionz.in%2Fblogs%2F2008%2F04%2F04%2Fworking-with-xml-node-attributes-in-xslt%2F&amp;source=nikhild&amp;style=normal&amp;hashtags=Tutorials,XML,XML+Attributes,XSL,XSLT" height="61" width="50" /><br />
			</a>
		</div>
<p>If you use XML and XSL, then you might have come across a time , when you have to play around with attributes and values of XML nodes in you XSL. They are loads of sites with long winded info about this, but none I found were brief and precise &#8230; This is NO XML/XSL TUTORIAL,but my attempt to put-together some sort of cheat list &#8230;</p>
<p>The sample XML that we will working with looks like this&#8230;</p>
<blockquote><p><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;<br />
&lt;?xml-stylesheet type="text/xsl" href="food.xsl"?&gt;<br />
&lt;food&gt;<br />
&lt;fruits type="tropical"&gt;<br />
&lt;item name="mango" moreinfo="http://www.mango.com"&gt;Mango is the king of fruits&lt;/item&gt;<br />
&lt;item name="banana" moreinfo="http://www.banana.com"&gt;Banana once a day , keeps the doctor away&lt;/item&gt;<br />
&lt;item name="orange" moreinfo="http://www.orange.com"&gt;Orange is the color and rich in vitamin C&lt;/item&gt;<br />
&lt;item name="Papaya" moreinfo="http://www.papaya.com"&gt;Papaya - Hot when raw, cold when ripe&lt;/item&gt;<br />
&lt;/fruits&gt;<br />
&lt;/food&gt;</code></p></blockquote>
<p>So Lets begin transforming our above XML using XSL</p>
<p><strong>Example 1 : Displaying value at a chosen Attribute</strong></p>
<blockquote><p><code>&lt;xsl:value-of select="/food/fruits/item[@name='orange']" /&gt;&lt;br /&gt;<br />
to get more information about &lt;a href="{/food/fruits/item[@name='orange']/@moreinfo}" target="new" &gt;&lt;xsl:value-of select="/food/fruits/item[@name='orange']/@name" /&gt; &lt;/a&gt;</code></p></blockquote>
<p>HTML result will look like</p>
<blockquote><p><code>Orange is the color and rich in vitamin C,<br />
to get more information about &lt;a href="http://www.orange.com" target="new"&gt;</code></p></blockquote>
<hr/>
<p><strong>Example 2 : Looping through and displaying all XML Attribute Names and their Values</strong></p>
<blockquote><p> <code>&lt;xsl:for-each select="/food/fruits/item/@*"&gt;<br />
  attribute name : &lt;xsl:value-of select="name()"/&gt;,&#160;<br />
    attribute value : &lt;xsl:value-of select="."/&gt;&#160; &lt;br /&gt;<br />
  &lt;/xsl:for-each&gt;</code></p></blockquote>
<p>HTML result will look like</p>
<blockquote><p><code><br />
attribute name : name,  attribute value : mango<br />
attribute name : moreinfo,  attribute value : http://www.mango.com<br />
attribute name : name,  attribute value : banana<br />
attribute name : moreinfo,  attribute value : http://www.banana.com<br />
attribute name : name,  attribute value : orange<br />
attribute name : moreinfo, attribute value : http://www.orange.com<br />
attribute name : name,  attribute value : Papaya<br />
attribute name : moreinfo,  attribute value : http://www.papaya.com<br />
</code></p></blockquote>
<hr/>
<strong><a title="download" href="http://developer.expressionz.in/blogs/wp-content/plugins/download-monitor/download.php?id=4" target="_blank">Download all the above files here (111 downloads)</a></strong></p>
<p><br/><br />
Watch this space, I&#8217;ll keep updating this with new findings&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://developer.expressionz.in/blogs/2008/04/04/working-with-xml-node-attributes-in-xslt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
