<?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>agfitzp.org &#187; xml</title>
	<atom:link href="http://agfitzp.org/blog/tag/xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://agfitzp.org/blog</link>
	<description>Postcards From Cyberspace</description>
	<lastBuildDate>Fri, 04 Jun 2010 05:11:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Does XSL Leak File Handles?</title>
		<link>http://agfitzp.org/blog/2009/04/08/does-xsl-leak-file-handles/</link>
		<comments>http://agfitzp.org/blog/2009/04/08/does-xsl-leak-file-handles/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 17:37:17 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://agfitzp.org/blog/?p=18</guid>
		<description><![CDATA[Does XSL Leak File Handles?
No, but it may appear to in some use cases. If you use redirect:write a lot for example:

   &#60;redirect:write file=&#34;{$outfile}&#34;&#62;
   ...
   &#60;/redirect:write&#62;

The solution here is to bracket the write with open and close so that the engine does not have to implicitly track the open [...]]]></description>
			<content:encoded><![CDATA[<p><H3>Does XSL Leak File Handles?</H3></p>
<p>No, but it may appear to in some use cases. If you use <code>redirect:write</code> a lot for example:</p>
<pre>
   &lt;redirect:write file=&quot;{$outfile}&quot;&gt;
   ...
   &lt;/redirect:write&gt;
</pre>
<p>The solution here is to bracket the write with open and close so that the engine does not have to implicitly track the open file stream:</p>
<pre>
   &lt;redirect:open file=&quot;{$outfile}&quot;/&gt;
   &lt;redirect:write file=&quot;{$outfile}&quot;&gt;
   ...
   &lt;/redirect:write&gt;
   &lt;redirect:close file=&quot;{$outfile}&quot;/&gt;
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://agfitzp.org/blog/2009/04/08/does-xsl-leak-file-handles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How Do I Create Standards Compliant HTML in Java?</title>
		<link>http://agfitzp.org/blog/2009/04/03/how-do-i-create-standards-compliant-html-in-java/</link>
		<comments>http://agfitzp.org/blog/2009/04/03/how-do-i-create-standards-compliant-html-in-java/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 22:27:45 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://agfitzp.org/blog/?p=15</guid>
		<description><![CDATA[This is a common question and the answers out there are pretty sketchy. So I&#8217;m going to provide my example code:

package demo;

import java.io.FileOutputStream;
import java.io.IOException;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Text;

public class HTMLDemo {

   public static void main(String[] args) {
      FileOutputStream outputStream = null;

     [...]]]></description>
			<content:encoded><![CDATA[<p>This is a common question and the answers out there are pretty sketchy. So I&#8217;m going to provide my example code:</p>
<pre>
package demo;

import java.io.FileOutputStream;
import java.io.IOException;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Text;

public class HTMLDemo {

   public static void main(String[] args) {
      FileOutputStream outputStream = null;

      try {
         Document newDocument = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
         Element html = newDocument.createElement("html");
         Element head = newDocument.createElement("head");
         Element body = newDocument.createElement("body");

         Element p = newDocument.createElement("p");
         Text textNode = newDocument.createTextNode("Hello World");

         p.appendChild(textNode);
         body.appendChild(p);

         html.appendChild(head);
         html.appendChild(body);

         newDocument.appendChild(html);

         outputStream = new FileOutputStream("/demo.html");
         TransformerFactory.newInstance().newTransformer().transform(
               new DOMSource(newDocument), new StreamResult(outputStream));         

      } catch (Exception e) {
         e.printStackTrace();
      } finally {
         if (outputStream != null) {
            try {
               outputStream.close();
            } catch (IOException e) {
               e.printStackTrace();
            }
         }
      }
   }
}</pre>
<p>I leave things like doctype as an exercise to the reader.</p>
]]></content:encoded>
			<wfw:commentRss>http://agfitzp.org/blog/2009/04/03/how-do-i-create-standards-compliant-html-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is XML a &#8220;Bad Smell&#8221; in Software?</title>
		<link>http://agfitzp.org/blog/2009/01/20/is-xml-a-bad-smell-in-software/</link>
		<comments>http://agfitzp.org/blog/2009/01/20/is-xml-a-bad-smell-in-software/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 18:50:21 +0000</pubDate>
		<dc:creator>alex</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[antipattern]]></category>
		<category><![CDATA[Bad Smells]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://agfitzp.org/blog/?p=3</guid>
		<description><![CDATA[Is XML just plain bad? Or is it an otherwise useful tool that gets abused?
]]></description>
			<content:encoded><![CDATA[<p>Is XML just plain bad? Or is it an otherwise useful tool that gets abused?</p>
]]></content:encoded>
			<wfw:commentRss>http://agfitzp.org/blog/2009/01/20/is-xml-a-bad-smell-in-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
