Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by X.B. on Dec 01, 2008 08:03
open dhtmlx forum
creating own type for dhtmlxFolder

Hello

I am trying to create my own type for dhtmlxFolder and having some problem

here's the code I have right now

in html page
<div id="container" style="height:600px;width:580px;">
</div>

<script type="text/javascript">
var folder = new dhtmlxFolders("container");
folder.loadXMLString(document.getElementById.('podcast_list').value, "../dhtmlxFolders/codebase/types/podcast.xsl");
</script>

in podcast.xsl file (using the most simple case)
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="item">
<div style="color:red"><xsl:value-of select="./title"/></div>
</xsl:template>
</xsl:stylesheet>

for xml data the format is (the same string I load into loadXMLString function)
<data>
<item id="1">
<title>title</title>
<desc>desc</desc>
<url>url</url>
<image></image>
</item>
<item id="2">
...
</item>
...
</data>

the problem is this give error displaying
"The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document."


I am guessing this might come from the xsl file because when I switch to another working file, there's no error and the content at least loads up but when I switch to this file (even with the same code from the working file), this error appears.

What might be the problem here?, if the problem can be identified, can you send a working file?

Thanks in advance
Answer posted on Dec 01, 2008 08:25
Which version of dhtmlxFolders you are using?
( there was issue related to your situation in dhtmlxFolders 1.6, which was resolved in 2.0 version ) 

>>I am guessing this might come from the xsl file 
The same xsl file works without any errors in case of local samples.
Please be sure 
a) you have not any extra whitespaces in code of  podcast.xsl  before <xsl:stylesheet
b) server configured to send xsl files with correct content type (  application/xml or text/xml ) 

>>What might be the problem here?
Normally such situation occurs if you are using incorrect XSL file

If issue still occurs - please provide any kind of sample where error can be reconstructed ( you can send it directly to support@dhtmlx.com