Unknown SXLT element: result-document

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
coupes
Posts: 12
Joined: Tue Jun 14, 2005 6:40 pm

Unknown SXLT element: result-document

Post by coupes » Tue Jun 14, 2005 6:48 pm

Hi, I'm new to the XSLT 2.0, and I would like to use the new result-document tag to create multiple output files. However, when I try to do so, I get an error message saying :"E Unknown XSLT element: reslut-document"

I've made sure I selected "2.0" from the drop-down menu when I created the xsl file and I also specified the correct version in the stylesheet tag.

Any help on that matter would be greatly appreciated,

Thanks in advance.

george
Site Admin
Posts: 2101
Joined: Thu Jan 09, 2003 2:58 pm

Post by george » Tue Jun 14, 2005 6:57 pm

Hi,

result-document should work, try the following stylesheet:

Code: Select all


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="/">
<xsl:result-document href="test.txt"> test </xsl:result-document>
</xsl:template>
</xsl:stylesheet>
You just have to make sure the version attribute is set to 2.0, oXygen changes dymanically the support from/to 2.0 to/from 1.0 depending on the version attribute value.

Best Regards,
George

coupes
Posts: 12
Joined: Tue Jun 14, 2005 6:40 pm

Post by coupes » Tue Jun 14, 2005 7:51 pm

Thanks for your reply, but I still can't get it to work.

I wanted to experiment with it before I started to work on my project, so I found an example somewhere. Here's what I've got :

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">

<xsl:output method="text"/>
<xsl:output method="html" indent="yes" name="html"/>

<xsl:template match="/">
<xsl:for-each select="//testrun">
<xsl:variable name="filename"
select="concat('output1/',@run,'.html')" />
<xsl:value-of select="$filename" /> <!-- Creating -->
<xsl:result-document href="{$filename}" format="html">
<html><body>
<xsl:value-of select="@run"/>
</body></html>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Whenever I try to parse the file I get the error mentionned in my previous post.

coupes
Posts: 12
Joined: Tue Jun 14, 2005 6:40 pm

Post by coupes » Tue Jun 14, 2005 9:58 pm

Nevermind... I found out what the problem was. The processor was set to Saxon6.5.3 by default, I suppose it didn't support the new features of XSLT 2.0. I simply switched to another one.

Thanks again for your help ;)

Post Reply