title: XML / XSL: The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document
body: <p>I have been debugging this for days and I can't seem to know why the error keeps telling me that <code>The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document.</code></p>
  
  <p>What could be the problem? here's the code I have been working through:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
    &lt;xsl:template match="/object"&gt;
      &lt;div class="wp_codebox" id="divInput" style="width:850px;display:block;"&gt;
        &lt;table width="100%"&gt;
          &lt;tr&gt;
            &lt;td &gt;
              &lt;fieldset&gt;
                &lt;table align="center"&gt;
                  &lt;tbody&gt;
                    &lt;tr&gt;
                      &lt;td align="center"&gt;進捗&lt;/td&gt;
                      &lt;td colspan="7"&gt;
                        &lt;xsl:for-each select="CT_A000000117"&gt;
                          &lt;select style="width:50px;" id ="M221ATTR1" name="M221ATTR1"&gt;
                            &lt;xsl:for-each select="option"&gt;
                              &lt;option&gt;
                                &lt;xsl:attribute name="value"&gt;
                                  &lt;xsl:value-of select="value"/&gt;
                                &lt;/xsl:attribute&gt;
                                &lt;xsl:if test="selected"&gt;
                                  &lt;xsl:attribute name="selected"&gt;
                                    &lt;xsl:text&gt;selected&lt;/xsl:text&gt;
                                  &lt;/xsl:attribute&gt;
                                &lt;/xsl:if&gt;
                                &lt;xsl:value-of select="item"/&gt;
                              &lt;/option&gt;
                            &lt;/xsl:for-each&gt;
                          &lt;/select&gt;
                        &lt;/xsl:for-each&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td align="center"&gt;担当課&lt;/td&gt;
                      &lt;td colspan="2"&gt;
                          &lt;xsl:variable name="atr2" select="M221ATTR2"/&gt;
                          &lt;input type="text" id="M221ATTR2"  value="{$atr2}" size="35" maxlength="100"/&gt;
                      &lt;/td&gt;
                      &lt;td align="center"&gt;計画名&lt;/td&gt;
                      &lt;td colspan="4"&gt;
                          &lt;xsl:variable name="atr3" select="M221ATTR3"/&gt;
                          &lt;input type="text" id="M221ATTR3"  value="{$atr3}" size="60" maxlength="100"/&gt;
                      &lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td align="center"&gt;申請地&lt;/td&gt;
                      &lt;td colspan="7"&gt;
                        &lt;xsl:variable name="atr4" select="M221ATTR4"/&gt;
                        &lt;input type="text" id="M221ATTR4" value="{$atr4}" size="105" maxlength="100"/&gt;
                      &lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td align="center"&gt;計画日&lt;/td&gt;
                      &lt;td colspan="2"&gt;
                        &lt;input type="text" name="M221ATTR6" id="M221ATTR6" value="" size="11" onfocus="_calndarCtl.setInput('M221ATTR6','M221ATTR6', 'true');_calndarCtl.setDate();_calndarCtl.open(this,'DORODATE','M221ATTR6');" onkeydown="return _calndarCtl.keyHandler(event);"&gt;
                          &lt;xsl:attribute name="value"&gt;
                            &lt;xsl:if test="M221ATTR6 != ''"&gt;
                              &lt;xsl:value-of select="M221ATTR6"/&gt;
                            &lt;/xsl:if&gt;
                          &lt;/xsl:attribute&gt;
                        &lt;/input&gt;&amp;#160;&lt;a href="javascript:_calndarCtl.setInput('M221ATTR6','M221ATTR6','true');_calndarCtl.setDate();_calndarCtl.open(document.getElementById('M221ATTR6'),'DORODATE','M221ATTR6');"&gt;
                          &lt;img border="0" src="img/cal.gif" style="vertical-align:middle;"&gt;&lt;/img&gt;
                        &lt;/a&gt;
                        &lt;td colspan="1" align="center"&gt;完了日&lt;/td&gt;
                        &lt;td colspan="4"&gt;    
                            &lt;input type="text" name="M221ATTR5" id="M221ATTR5" value="" size="11" onfocus="_calndarCtl.setInput('M221ATTR5','M221ATTR5', 'true');_calndarCtl.setDate();_calndarCtl.open(this,'DORODATE','M221ATTR5');" onkeydown="return _calndarCtl.keyHandler(event);"&gt;
                              &lt;xsl:attribute name="value"&gt;
                                &lt;xsl:if test="M221ATTR5 != ''"&gt;
                                  &lt;xsl:value-of select="M221ATTR5"/&gt;
                                &lt;/xsl:if&gt;
                              &lt;/xsl:attribute&gt;
                            &lt;/input&gt;&amp;#160;&lt;a href="javascript:_calndarCtl.setInput('M221ATTR5','M221ATTR5','true');_calndarCtl.setDate();_calndarCtl.open(document.getElementById('M221ATTR5'),'DORODATE','M221ATTR5');"&gt;
                              &lt;img border="0" src="img/cal.gif" style="vertical-align:middle;"&gt;&lt;/img&gt;
                            &lt;/a&gt;       
                        &lt;/td&gt;
                    &lt;/tr&gt;
                  &lt;/tbody&gt;
                &lt;/table&gt;
              &lt;/fieldset&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td colspan="2"&gt;
              &lt;fieldset&gt;
                &lt;legend&gt;地権者情報&lt;/legend&gt;
                &lt;div id="M221SyusenConsts"&gt;&lt;/div&gt;
              &lt;/fieldset&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td align="right"&gt;
              &lt;table&gt;
                &lt;tr&gt;
                  &lt;td&gt;
                    &lt;button type="button" class="button" eventid="cancel" id="InDataPrint" onclick="javascript:M221Doro.Print();"&gt;登録&lt;/button&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                    &lt;button type="button" class="button" eventid="cancel" id="InDataAdd" onclick="javascript:M221Doro.Input();"&gt;削除&lt;/button&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                    &lt;button type="button" class="button" eventid="cancel" id="InDataDel" onclick="javascript:M221Doro.Delete();"&gt;作図&lt;/button&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                    &lt;button type="button" class="button" eventid="cancel" id="InFeatureAdd" onclick="javascript:M221Doro.CallEdit();"&gt;ファイリング&lt;/button&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                    &lt;button type="button" class="button" eventid="cancel" onclick="javascript:M221Doro.InputClear();"&gt;キャンセル&lt;/button&gt;
                  &lt;/td&gt;        
                &lt;/tr&gt;
              &lt;/table&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
        &lt;/table&gt;
        &lt;xsl:variable name="objectId" select="OBJECTID"/&gt;
        &lt;input type="hidden" id="hiddenObjectId" name="hiddenObjectId" value="{$objectId}" /&gt;
        &lt;xsl:variable name="sLinkId" select="SLINKID"/&gt;
        &lt;input type="hidden" id="hiddenLinkId" name="hiddenLinkId" value="{$sLinkId}" /&gt;
        &lt;/div&gt;
    &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Tried adding <code>&lt;html&gt;</code> tags but it is not working.</p>
  
  <p><strong>NOTE:</strong>
  There are japanese texts, I am sorry for that but I am working from a Japanese Company :D</p>
  
  <p>Also, I am a newbie.. this is my first time to encounter something like this. I don't know XSL and XML.</p>